407 lines
480 KiB
JavaScript
407 lines
480 KiB
JavaScript
var SM=Object.defineProperty,EM=Object.defineProperties;var CM=Object.getOwnPropertyDescriptors;var hu=Object.getOwnPropertySymbols;var i0=Object.prototype.hasOwnProperty,s0=Object.prototype.propertyIsEnumerable;var a0=(e,t,r)=>t in e?SM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wi=(e,t)=>{for(var r in t||(t={}))i0.call(t,r)&&a0(e,r,t[r]);if(hu)for(var r of hu(t))s0.call(t,r)&&a0(e,r,t[r]);return e},tc=(e,t)=>EM(e,CM(t));var o0=(e,t)=>{var r={};for(var n in e)i0.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hu)for(var n of hu(e))t.indexOf(n)<0&&s0.call(e,n)&&(r[n]=e[n]);return r};import{N as ae,O as Fh,P as OM,S as Ct,i as Ot,s as At,e as k,c as H,a as V,d as M,g as q,J as _n,K as mn,L as $n,q as W,o as X,I as bn,C as Bt,k as ht,m as pt,Q as la,R as Me,M as j,T as Hu,n as pr,p as vr,z as ne,U as ca,V as AM,W as Li,X as ao,r as Mc,Y as p$,G as io,Z as Ne,_ as TM,b as F,$ as Ni,a0 as u0,l as je,a1 as Fn,a2 as zn,f as Ln,E as se,w as st,x as ft,y as ot,B as ut,t as mt,h as $t,a3 as Nn,a4 as Pc,a5 as xc,a6 as Wa,j as er,a7 as xe,a8 as vn,a9 as Hr,aa as js,ab as $a,ac as kn,ad as Be,A as ue,ae as Wu,F as MM,af as PM,v as xM,ag as IM,D as DM,ah as qs,ai as RM}from"../chunks/index-3711c71a.js";import{r as BM,d as LM,w as FM,b as yn}from"../chunks/paths-5193a87e.js";function zM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function l0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f0(Object(r),!0).forEach(function(n){zM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GM(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ec=function(){return Math.random().toString(36).substring(7).split("").join(".")};""+ec(),""+ec();function v$(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function NM(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(GM(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},u=t.map(function(f){return f(s)});return i=v$.apply(void 0,u)(a.dispatch),l0(l0({},a),{},{dispatch:i})}}}var jM={isEqual:!0,isMatchingKey:!0,isPromise:!0,maxSize:!0,onCacheAdd:!0,onCacheChange:!0,onCacheHit:!0,transformKey:!0},qM=Array.prototype.slice;function Du(e){var t=e.length;return t?t===1?[e[0]]:t===2?[e[0],e[1]]:t===3?[e[0],e[1],e[2]]:qM.call(e,0):[]}function UM(e){var t={};for(var r in e)jM[r]||(t[r]=e[r]);return t}function kM(e){return typeof e=="function"&&e.isMemoized}function HM(e,t){return e===t||e!==e&&t!==t}function c0(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r}var WM=function(){function e(t){this.keys=[],this.values=[],this.options=t;var r=typeof t.isMatchingKey=="function";r?this.getKeyIndex=this._getKeyIndexFromMatchingKey:t.maxSize>1?this.getKeyIndex=this._getKeyIndexForMany:this.getKeyIndex=this._getKeyIndexForSingle,this.canTransformKey=typeof t.transformKey=="function",this.shouldCloneArguments=this.canTransformKey||r,this.shouldUpdateOnAdd=typeof t.onCacheAdd=="function",this.shouldUpdateOnChange=typeof t.onCacheChange=="function",this.shouldUpdateOnHit=typeof t.onCacheHit=="function"}return Object.defineProperty(e.prototype,"size",{get:function(){return this.keys.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return{keys:Du(this.keys),size:this.size,values:Du(this.values)}},enumerable:!0,configurable:!0}),e.prototype._getKeyIndexFromMatchingKey=function(t){var r=this.options,n=r.isMatchingKey,a=r.maxSize,i=this.keys,s=i.length;if(!s)return-1;if(n(i[0],t))return 0;if(a>1){for(var u=1;u<s;u++)if(n(i[u],t))return u}return-1},e.prototype._getKeyIndexForMany=function(t){var r=this.options.isEqual,n=this.keys,a=n.length;if(!a)return-1;if(a===1)return this._getKeyIndexForSingle(t);var i=t.length,s,u;if(i>1){for(var f=0;f<a;f++)if(s=n[f],s.length===i){for(u=0;u<i&&r(s[u],t[u]);u++);if(u===i)return f}}else for(var f=0;f<a;f++)if(s=n[f],s.length===i&&r(s[0],t[0]))return f;return-1},e.prototype._getKeyIndexForSingle=function(t){var r=this.keys;if(!r.length)return-1;var n=r[0],a=n.length;if(t.length!==a)return-1;var i=this.options.isEqual;if(a>1){for(var s=0;s<a;s++)if(!i(n[s],t[s]))return-1;return 0}return i(n[0],t[0])?0:-1},e.prototype.orderByLru=function(t,r,n){for(var a=this.keys,i=this.values,s=a.length,u=n;u--;)a[u+1]=a[u],i[u+1]=i[u];a[0]=t,i[0]=r;var f=this.options.maxSize;s===f&&n===s?(a.pop(),i.pop()):n>=f&&(a.length=i.length=f)},e.prototype.updateAsyncCache=function(t){var r=this,n=this.options,a=n.onCacheChange,i=n.onCacheHit,s=this.keys[0],u=this.values[0];this.values[0]=u.then(function(f){return r.shouldUpdateOnHit&&i(r,r.options,t),r.shouldUpdateOnChange&&a(r,r.options,t),f},function(f){var c=r.getKeyIndex(s);throw c!==-1&&(r.keys.splice(c,1),r.values.splice(c,1)),f})},e}();function d$(e,t){if(t===void 0&&(t={}),kM(e))return d$(e.fn,c0(e.options,t));if(typeof e!="function")throw new TypeError("You must pass a function to `memoize`.");var r=t.isEqual,n=r===void 0?HM:r,a=t.isMatchingKey,i=t.isPromise,s=i===void 0?!1:i,u=t.maxSize,f=u===void 0?1:u,c=t.onCacheAdd,h=t.onCacheChange,p=t.onCacheHit,v=t.transformKey,g=c0({isEqual:n,isMatchingKey:a,isPromise:s,maxSize:f,onCacheAdd:c,onCacheChange:h,onCacheHit:p,transformKey:v},UM(t)),_=new WM(g),m=_.keys,b=_.values,y=_.canTransformKey,w=_.shouldCloneArguments,C=_.shouldUpdateOnAdd,T=_.shouldUpdateOnChange,A=_.shouldUpdateOnHit,x=function I(){var B=w?Du(arguments):arguments;y&&(B=v(B));var P=m.length?_.getKeyIndex(B):-1;if(P!==-1)A&&p(_,g,I),P&&(_.orderByLru(m[P],b[P],P),T&&h(_,g,I));else{var L=e.apply(this,arguments),G=w?B:Du(arguments);_.orderByLru(G,L,m.length),s&&_.updateAsyncCache(I),C&&c(_,g,I),T&&h(_,g,I)}return b[0]};return x.cache=_,x.fn=e,x.isMemoized=!0,x.options=g,x}var KM=typeof WeakSet=="function",h0=Object.keys;function Ku(e,t){return e===t||e!==e&&t!==t}function p0(e){return e.constructor===Object||e.constructor==null}function v0(e){return!!e&&typeof e.then=="function"}function d0(e){return!!(e&&e.$$typeof)}function YM(){var e=[];return{add:function(t){e.push(t)},has:function(t){return e.indexOf(t)!==-1}}}var XM=function(e){return e?function(){return new WeakSet}:YM}(KM);function g$(e){return function(r){var n=e||r;return function(i,s,u){u===void 0&&(u=XM());var f=!!i&&typeof i=="object",c=!!s&&typeof s=="object";if(f||c){var h=f&&u.has(i),p=c&&u.has(s);if(h||p)return h&&p;f&&u.add(i),c&&u.add(s)}return n(i,s,u)}}}function VM(e,t,r,n){var a=e.length;if(t.length!==a)return!1;for(;a-- >0;)if(!r(e[a],t[a],n))return!1;return!0}function ZM(e,t,r,n){var a=e.size===t.size;return a&&e.size&&e.forEach(function(i,s){a&&(a=!1,t.forEach(function(u,f){!a&&r(s,f,n)&&(a=r(i,u,n))}))}),a}var JM="_owner",QM=Function.prototype.bind.call(Function.prototype.call,Object.prototype.hasOwnProperty);function g0(e,t,r,n){var a=h0(e),i=a.length;if(h0(t).length!==i)return!1;if(i)for(var s=void 0;i-- >0;){if(s=a[i],s===JM){var u=d0(e),f=d0(t);if((u||f)&&u!==f)return!1}if(!QM(t,s)||!r(e[s],t[s],n))return!1}return!0}function tP(e,t){return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.sticky===t.sticky&&e.lastIndex===t.lastIndex}function eP(e,t,r,n){var a=e.size===t.size;return a&&e.size&&e.forEach(function(i){a&&(a=!1,t.forEach(function(s){a||(a=r(i,s,n))}))}),a}var rP=typeof Map=="function",nP=typeof Set=="function";function Yu(e){var t=typeof e=="function"?e(r):r;function r(n,a,i){if(n===a)return!0;if(n&&a&&typeof n=="object"&&typeof a=="object"){if(p0(n)&&p0(a))return g0(n,a,t,i);var s=Array.isArray(n),u=Array.isArray(a);return s||u?s===u&&VM(n,a,t,i):(s=n instanceof Date,u=a instanceof Date,s||u?s===u&&Ku(n.getTime(),a.getTime()):(s=n instanceof RegExp,u=a instanceof RegExp,s||u?s===u&&tP(n,a):v0(n)||v0(a)?n===a:rP&&(s=n instanceof Map,u=a instanceof Map,s||u)?s===u&&ZM(n,a,t,i):nP&&(s=n instanceof Set,u=a instanceof Set,s||u)?s===u&&eP(n,a,t,i):g0(n,a,t,i)))}return n!==n&&a!==a}return r}var aP=Yu(),iP=Yu(function(){return Ku});Yu(g$());Yu(g$(Ku));function ha(){return ha=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ha.apply(this,arguments)}function sP(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}var Ei={isDeepEqual:!1,isPromise:!1,isReact:!1,isSerialized:!1,isShallowEqual:!1,matchesArg:void 0,matchesKey:void 0,maxAge:void 0,maxArgs:void 0,maxSize:1,onExpire:void 0,profileName:void 0,serializer:void 0,updateCacheForKey:void 0,transformArgs:void 0,updateExpire:!1};function Ls(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(n,a){if(typeof n=="function")return typeof a=="function"?function(){n.apply(this,arguments),a.apply(this,arguments)}:n;if(typeof a=="function")return a})}function zh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(n,a){if(typeof n=="function")return typeof a=="function"?function(){return n(a.apply(this,arguments))}:n;if(typeof a=="function")return a})}function Gh(e,t){for(var r=0;r<e.length;r++)if(e[r].key===t)return r;return-1}function _$(e,t){var r=typeof t=="function"?t:function(n,a){for(var i=0;i<a.length;i++)if(!e(n[i],a[i]))return!1;return!0};return function(n,a){for(var i=0;i<n.length;i++)if(n[i].length===a.length&&r(n[i],a))return i;return-1}}function rc(e,t){return!t||t===Ei?e:ha({},e,t,{onCacheAdd:Ls(e.onCacheAdd,t.onCacheAdd),onCacheChange:Ls(e.onCacheChange,t.onCacheChange),onCacheHit:Ls(e.onCacheHit,t.onCacheHit),transformArgs:zh(e.transformArgs,t.transformArgs)})}function oP(e){return typeof e=="function"&&e.isMoized}function m$(e,t,r){try{var n=r||t||"anonymous";Object.defineProperty(e,"name",{configurable:!0,enumerable:!1,value:"moized("+n+")",writable:!0})}catch{}}function Nh(e,t,r){var n=Gh(e,t);n!==-1&&(clearTimeout(e[n].timeoutId),r&&e.splice(n,1))}function $$(e,t){var r=setTimeout(e,t);return typeof r.unref=="function"&&r.unref(),r}function uP(e,t,r,n){var a=t.maxAge;return function i(s,u,f){var c=s.keys[0];if(Gh(e,c)===-1){var h=function(){var v=_$(r,n),g=v(s.keys,c),_=s.values[g];~g&&(s.keys.splice(g,1),s.values.splice(g,1),typeof t.onCacheChange=="function"&&t.onCacheChange(s,u,f)),Nh(e,c,!0),typeof t.onExpire=="function"&&t.onExpire(c)===!1&&(s.keys.unshift(c),s.values.unshift(_),i(s,u,f),typeof t.onCacheChange=="function"&&t.onCacheChange(s,u,f))};e.push({expirationMethod:h,key:c,timeoutId:$$(h,a)})}}}function fP(e,t){return function(n){var a=n.keys[0],i=Gh(e,a);~i&&(Nh(e,a,!1),e[i].timeoutId=$$(e[i].expirationMethod,t.maxAge))}}function lP(e,t,r,n){var a=typeof t.maxAge=="number"&&isFinite(t.maxAge)?uP(e,t,r,n):void 0;return{onCacheAdd:a,onCacheHit:a&&t.updateExpire?fP(e,t):void 0}}var Ar={anonymousProfileNameCounter:1,isCollectingStats:!1,profiles:{}},_0=!1;function b$(e){e?delete Ar.profiles[e]:Ar.profiles={}}function cP(e){e===void 0&&(e=!0),Ar.isCollectingStats=e}function hP(e){var t=e.profileName;return function(){t&&!Ar.profiles[t]&&(Ar.profiles[t]={calls:0,hits:0}),Ar.profiles[t].calls++}}function pP(e){return function(){var t=Ar.profiles,r=e.profileName;t[r]||(t[r]={calls:0,hits:0}),t[r].calls++,t[r].hits++}}function vP(e){var t=new Error().stack,r=e.displayName||e.name||"Anonymous "+Ar.anonymousProfileNameCounter++;if(!t)return r;for(var n=t.split(`
|
|
`).slice(3),a,i,s=0;s<n.length;s++)if(a=n[s],a.indexOf("/moize/")===-1&&a.indexOf(" (native)")===-1&&a.indexOf(" Function.")===-1){i=a.replace(/\n/g,"\\n").trim();break}return i?r+" "+i:r}function m0(e,t){return e?(t/e*100).toFixed(4)+"%":"0.0000%"}function jh(e){!Ar.isCollectingStats&&!_0&&(console.warn('Stats are not currently being collected, please run "collectStats" to enable them.'),_0=!0);var t=Ar.profiles;if(e){if(!t[e])return{calls:0,hits:0,usage:"0.0000%"};var r=t[e];return ha({},r,{usage:m0(r.calls,r.hits)})}var n=Object.keys(Ar.profiles).reduce(function(a,i){return a.calls+=t[i].calls,a.hits+=t[i].hits,a},{calls:0,hits:0});return ha({},n,{profiles:Object.keys(t).reduce(function(a,i){return a[i]=jh(i),a},{}),usage:m0(n.calls,n.hits)})}function dP(e){return Ar.isCollectingStats?{onCacheAdd:hP(e),onCacheHit:pP(e)}:{}}var gP={arguments:!0,callee:!0,caller:!0,constructor:!0,length:!0,name:!0,prototype:!0};function qh(e,t,r){r===void 0&&(r=[]),Object.getOwnPropertyNames(e).forEach(function(n){if(!gP[n]&&r.indexOf(n)===-1){var a=Object.getOwnPropertyDescriptor(e,n);a.get||a.set?Object.defineProperty(t,n,a):t[n]=e[n]}})}function _P(e,t){var r=t.expirations,n=e.options,a=_$(n.isEqual,n.isMatchingKey),i=e;i.clear=function(){var s=i._microMemoizeOptions.onCacheChange,u=i.cache;return u.keys.length=0,u.values.length=0,s&&s(u,i.options,i),!0},i.clearStats=function(){b$(i.options.profileName)},i.get=function(s){var u=i._microMemoizeOptions.transformKey,f=i.cache,c=u?u(s):s,h=a(f.keys,c);return h!==-1?i.apply(this,s):void 0},i.getStats=function(){return jh(i.options.profileName)},i.has=function(s){var u=i._microMemoizeOptions.transformKey,f=u?u(s):s;return a(i.cache.keys,f)!==-1},i.keys=function(){return i.cacheSnapshot.keys},i.remove=function(s){var u=i._microMemoizeOptions,f=u.onCacheChange,c=u.transformKey,h=i.cache,p=a(h.keys,c?c(s):s);if(p===-1)return!1;var v=h.keys[p];return h.keys.splice(p,1),h.values.splice(p,1),f&&f(h,i.options,i),Nh(r,v,!0),!0},i.set=function(s,u){var f=i._microMemoizeOptions,c=i.cache,h=i.options,p=f.onCacheAdd,v=f.onCacheChange,g=f.transformKey,_=g?g(s):s,m=a(c.keys,_);if(m===-1){var b=h.maxSize-1;c.size>b&&(c.keys.length=b,c.values.length=b),c.keys.unshift(_),c.values.unshift(u),h.isPromise&&c.updateAsyncCache(i),p&&p(c,h,i),v&&v(c,h,i)}else{var y=c.keys[m];c.values[m]=u,m>0&&c.orderByLru(y,u,m),h.isPromise&&c.updateAsyncCache(i),typeof v=="function"&&v(c,h,i)}},i.values=function(){return i.cacheSnapshot.values}}function mP(e,t){var r=t.expirations,n=t.options,a=t.originalFunction,i=e.options;Object.defineProperties(e,{_microMemoizeOptions:{configurable:!0,get:function(){return i}},cacheSnapshot:{configurable:!0,get:function(){var f=e.cache;return{keys:f.keys.slice(0),size:f.size,values:f.values.slice(0)}}},expirations:{configurable:!0,get:function(){return r}},expirationsSnapshot:{configurable:!0,get:function(){return r.slice(0)}},isMoized:{configurable:!0,get:function(){return!0}},options:{configurable:!0,get:function(){return n}},originalFunction:{configurable:!0,get:function(){return a}}});var s=e;qh(a,s)}function $P(e,t){return _P(e,t),mP(e,t),e}var bP=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function yP(e,t,r){var n=e(ha({maxArgs:2,isShallowEqual:!0},r,{isReact:!1}));t.displayName||(t.displayName=t.name||"Component");function a(i,s,u){this.props=i,this.context=s,this.updater=u,this.MoizedComponent=n(t)}return a.prototype.isReactComponent={},a.prototype.render=function(){return{$$typeof:bP,type:this.MoizedComponent,props:this.props,ref:null,key:null,_owner:null}},qh(t,a,["contextType","contextTypes"]),a.displayName="Moized("+(t.displayName||t.name||"Component")+")",m$(a,t.name,r.profileName),a}function wP(e){return function(t){if(e>=t.length)return t;if(e===0)return[];if(e===1)return[t[0]];if(e===2)return[t[0],t[1]];if(e===3)return[t[0],t[1],t[2]];for(var r=[],n=0;n<e;n++)r[n]=t[n];return r}}function $0(e,t){for(var r=e.length,n=0;n<r;++n)if(e[n]===t)return n+1;return 0}function SP(){var e=[],t=[];return function(n,a){var i=typeof a;if(i==="function"||i==="symbol")return a.toString();if(typeof a=="object"){if(e.length){var s=$0(e,this);s===0?e[e.length]=this:(e.splice(s),t.splice(s)),t[t.length]=n;var u=$0(e,a);if(u!==0)return"[ref="+(t.slice(0,u).join(".")||".")+"]"}else e[0]=a,t[0]=n;return a}return""+a}}function EP(e){var t=typeof e;return e&&(t==="object"||t==="function")?JSON.stringify(e,SP()):e}function CP(e){for(var t="|",r=0;r<e.length;r++)t+=EP(e[r])+"|";return[t]}function OP(e){return typeof e.serializer=="function"?e.serializer:CP}function AP(e,t){return e[0]===t[0]}function nc(e){if(typeof e=="function")return function(t,r,n){return e(n.cache,n.options,n)}}function TP(e){return e.matchesArg||e.isDeepEqual&&aP||e.isShallowEqual&&iP||Ku}function MP(e){return e.matchesKey||e.isSerialized&&AP||void 0}function PP(e){return zh(e.isSerialized&&OP(e),typeof e.transformArgs=="function"&&e.transformArgs,typeof e.maxArgs=="number"&&wP(e.maxArgs))}function xP(e){var t=e.options.updateCacheForKey,r=function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];if(!t(i))return e.apply(this,i);var u=e.fn.apply(this,i);return e.set(i,u),u};return qh(e,r),r}var IP=["matchesArg","isDeepEqual","isPromise","isReact","isSerialized","isShallowEqual","matchesKey","maxAge","maxArgs","maxSize","onCacheAdd","onCacheChange","onCacheHit","onExpire","profileName","serializer","updateCacheForKey","transformArgs","updateExpire"],It=function e(t,r){var n=r||Ei;if(oP(t)){var a=t.originalFunction,i=rc(t.options,n);return e(a,i)}if(typeof t=="object")return function(I,B){if(typeof I=="function"){var P=rc(t,B);return e(I,P)}var L=rc(t,I);return e(L)};if(n.isReact)return yP(e,t,n);var s=ha({},Ei,n,{maxAge:typeof n.maxAge=="number"&&n.maxAge>=0?n.maxAge:Ei.maxAge,maxArgs:typeof n.maxArgs=="number"&&n.maxArgs>=0?n.maxArgs:Ei.maxArgs,maxSize:typeof n.maxSize=="number"&&n.maxSize>=0?n.maxSize:Ei.maxSize,profileName:n.profileName||vP(t)}),u=[];s.matchesArg,s.isDeepEqual;var f=s.isPromise;s.isReact,s.isSerialized,s.isShallowEqual,s.matchesKey,s.maxAge,s.maxArgs;var c=s.maxSize,h=s.onCacheAdd,p=s.onCacheChange,v=s.onCacheHit;s.onExpire,s.profileName,s.serializer;var g=s.updateCacheForKey;s.transformArgs,s.updateExpire;var _=sP(s,IP),m=TP(s),b=MP(s),y=lP(u,s,m,b),w=dP(s),C=PP(s),T=ha({},_,{isEqual:m,isMatchingKey:b,isPromise:f,maxSize:c,onCacheAdd:nc(Ls(h,y.onCacheAdd,w.onCacheAdd)),onCacheChange:nc(p),onCacheHit:nc(Ls(v,y.onCacheHit,w.onCacheHit)),transformKey:C}),A=d$(t,T),x=$P(A,{expirations:u,options:s,originalFunction:t});return g&&(x=xP(x)),m$(x,t.name,n.profileName),x};It.clearStats=b$;It.collectStats=cP;It.compose=function(){return zh.apply(void 0,arguments)||It};It.deep=It({isDeepEqual:!0});It.getStats=jh;It.infinite=It({maxSize:1/0});It.isCollectingStats=function(){return Ar.isCollectingStats};It.isMoized=function(t){return typeof t=="function"&&!!t.isMoized};It.matchesArg=function(e){return It({matchesArg:e})};It.matchesKey=function(e){return It({matchesKey:e})};function DP(e,t){if(t===!0)return It({maxAge:e,updateExpire:t});if(typeof t=="object"){var r=t.onExpire,n=t.updateExpire;return It({maxAge:e,onExpire:r,updateExpire:n})}return It(typeof t=="function"?{maxAge:e,onExpire:t,updateExpire:!0}:{maxAge:e})}It.maxAge=DP;It.maxArgs=function(e){return It({maxArgs:e})};It.maxSize=function(e){return It({maxSize:e})};It.profile=function(e){return It({profileName:e})};It.promise=It({isPromise:!0,updateExpire:!0});It.react=It({isReact:!0});It.serialize=It({isSerialized:!0});It.serializeWith=function(e){return It({isSerialized:!0,serializer:e})};It.shallow=It({isShallowEqual:!0});It.transformArgs=function(e){return It({transformArgs:e})};It.updateCacheForKey=function(e){return It({updateCacheForKey:e})};Object.defineProperty(It,"default",{configurable:!1,enumerable:!1,value:It,writable:!1});function RP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function y0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b0(Object(r),!0).forEach(function(n){RP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var w0=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),ac=function(){return Math.random().toString(36).substring(7).split("").join(".")},S0={INIT:"@@redux/INIT"+ac(),REPLACE:"@@redux/REPLACE"+ac(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ac()}};function BP(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function y$(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Sr(0));if(typeof t=="function"&&typeof r=="undefined"&&(r=t,t=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error(Sr(1));return r(y$)(e,t)}if(typeof e!="function")throw new Error(Sr(2));var a=e,i=t,s=[],u=s,f=!1;function c(){u===s&&(u=s.slice())}function h(){if(f)throw new Error(Sr(3));return i}function p(m){if(typeof m!="function")throw new Error(Sr(4));if(f)throw new Error(Sr(5));var b=!0;return c(),u.push(m),function(){if(!!b){if(f)throw new Error(Sr(6));b=!1,c();var w=u.indexOf(m);u.splice(w,1),s=null}}}function v(m){if(!BP(m))throw new Error(Sr(7));if(typeof m.type=="undefined")throw new Error(Sr(8));if(f)throw new Error(Sr(9));try{f=!0,i=a(i,m)}finally{f=!1}for(var b=s=u,y=0;y<b.length;y++){var w=b[y];w()}return m}function g(m){if(typeof m!="function")throw new Error(Sr(10));a=m,v({type:S0.REPLACE})}function _(){var m,b=p;return m={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(Sr(11));function C(){w.next&&w.next(h())}C();var T=b(C);return{unsubscribe:T}}},m[w0]=function(){return this},m}return v({type:S0.INIT}),n={dispatch:v,subscribe:p,getState:h,replaceReducer:g},n[w0]=_,n}function LP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function FP(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(Sr(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},u=t.map(function(f){return f(s)});return i=LP.apply(void 0,u)(a.dispatch),y0(y0({},a),{},{dispatch:i})}}}var zP=typeof global=="object"&&global&&global.Object===Object&&global,w$=zP,GP=typeof self=="object"&&self&&self.Object===Object&&self,NP=w$||GP||Function("return this")(),wn=NP,jP=wn.Symbol,dn=jP,S$=Object.prototype,qP=S$.hasOwnProperty,UP=S$.toString,Cs=dn?dn.toStringTag:void 0;function kP(e){var t=qP.call(e,Cs),r=e[Cs];try{e[Cs]=void 0;var n=!0}catch{}var a=UP.call(e);return n&&(t?e[Cs]=r:delete e[Cs]),a}var HP=Object.prototype,WP=HP.toString;function KP(e){return WP.call(e)}var YP="[object Null]",XP="[object Undefined]",E0=dn?dn.toStringTag:void 0;function Ka(e){return e==null?e===void 0?XP:YP:E0&&E0 in Object(e)?kP(e):KP(e)}function pa(e){return e!=null&&typeof e=="object"}var VP="[object Symbol]";function Uh(e){return typeof e=="symbol"||pa(e)&&Ka(e)==VP}function kh(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var ZP=Array.isArray,Tr=ZP,JP=1/0,C0=dn?dn.prototype:void 0,O0=C0?C0.toString:void 0;function E$(e){if(typeof e=="string")return e;if(Tr(e))return kh(e,E$)+"";if(Uh(e))return O0?O0.call(e):"";var t=e+"";return t=="0"&&1/e==-JP?"-0":t}function ba(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Hh(e){return e}var QP="[object AsyncFunction]",tx="[object Function]",ex="[object GeneratorFunction]",rx="[object Proxy]";function Wh(e){if(!ba(e))return!1;var t=Ka(e);return t==tx||t==ex||t==QP||t==rx}var nx=wn["__core-js_shared__"],ic=nx,A0=function(){var e=/[^.]+$/.exec(ic&&ic.keys&&ic.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ax(e){return!!A0&&A0 in e}var ix=Function.prototype,sx=ix.toString;function Ya(e){if(e!=null){try{return sx.call(e)}catch{}try{return e+""}catch{}}return""}var ox=/[\\^$.*+?()[\]{}|]/g,ux=/^\[object .+?Constructor\]$/,fx=Function.prototype,lx=Object.prototype,cx=fx.toString,hx=lx.hasOwnProperty,px=RegExp("^"+cx.call(hx).replace(ox,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vx(e){if(!ba(e)||ax(e))return!1;var t=Wh(e)?px:ux;return t.test(Ya(e))}function dx(e,t){return e==null?void 0:e[t]}function Xa(e,t){var r=dx(e,t);return vx(r)?r:void 0}var gx=Xa(wn,"WeakMap"),Ic=gx,T0=Object.create,_x=function(){function e(){}return function(t){if(!ba(t))return{};if(T0)return T0(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),mx=_x;function $x(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function bx(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var yx=800,wx=16,Sx=Date.now;function Ex(e){var t=0,r=0;return function(){var n=Sx(),a=wx-(n-r);if(r=n,a>0){if(++t>=yx)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Cx(e){return function(){return e}}var Ox=function(){try{var e=Xa(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ru=Ox,Ax=Ru?function(e,t){return Ru(e,"toString",{configurable:!0,enumerable:!1,value:Cx(t),writable:!0})}:Hh,Tx=Ax,Mx=Ex(Tx),Px=Mx;function xx(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}function Ix(e){return e!==e}function Dx(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}function Rx(e,t,r){return t===t?Dx(e,t,r):xx(e,Ix,r)}function Bx(e,t){var r=e==null?0:e.length;return!!r&&Rx(e,t,0)>-1}var Lx=9007199254740991,Fx=/^(?:0|[1-9]\d*)$/;function Kh(e,t){var r=typeof e;return t=t==null?Lx:t,!!t&&(r=="number"||r!="symbol"&&Fx.test(e))&&e>-1&&e%1==0&&e<t}function Xu(e,t,r){t=="__proto__"&&Ru?Ru(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function so(e,t){return e===t||e!==e&&t!==t}var zx=Object.prototype,Gx=zx.hasOwnProperty;function Nx(e,t,r){var n=e[t];(!(Gx.call(e,t)&&so(n,r))||r===void 0&&!(t in e))&&Xu(e,t,r)}function jx(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var u=t[i],f=n?n(r[u],e[u],u,r,e):void 0;f===void 0&&(f=e[u]),a?Xu(r,u,f):Nx(r,u,f)}return r}var M0=Math.max;function qx(e,t,r){return t=M0(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=M0(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=n[a];return u[t]=r(s),$x(e,this,u)}}function C$(e,t){return Px(qx(e,t,Hh),e+"")}var Ux=9007199254740991;function Yh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ux}function ji(e){return e!=null&&Yh(e.length)&&!Wh(e)}function kx(e,t,r){if(!ba(r))return!1;var n=typeof t;return(n=="number"?ji(r)&&Kh(t,r.length):n=="string"&&t in r)?so(r[t],e):!1}function Hx(e){return C$(function(t,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,s&&kx(r[0],r[1],s)&&(i=a<3?void 0:i,a=1),t=Object(t);++n<a;){var u=r[n];u&&e(t,u,n,i)}return t})}var Wx=Object.prototype;function Xh(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Wx;return e===r}function Kx(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Yx="[object Arguments]";function P0(e){return pa(e)&&Ka(e)==Yx}var O$=Object.prototype,Xx=O$.hasOwnProperty,Vx=O$.propertyIsEnumerable,Zx=P0(function(){return arguments}())?P0:function(e){return pa(e)&&Xx.call(e,"callee")&&!Vx.call(e,"callee")},Us=Zx;function Jx(){return!1}var A$=typeof exports=="object"&&exports&&!exports.nodeType&&exports,x0=A$&&typeof module=="object"&&module&&!module.nodeType&&module,Qx=x0&&x0.exports===A$,I0=Qx?wn.Buffer:void 0,tI=I0?I0.isBuffer:void 0,eI=tI||Jx,Bu=eI,rI="[object Arguments]",nI="[object Array]",aI="[object Boolean]",iI="[object Date]",sI="[object Error]",oI="[object Function]",uI="[object Map]",fI="[object Number]",lI="[object Object]",cI="[object RegExp]",hI="[object Set]",pI="[object String]",vI="[object WeakMap]",dI="[object ArrayBuffer]",gI="[object DataView]",_I="[object Float32Array]",mI="[object Float64Array]",$I="[object Int8Array]",bI="[object Int16Array]",yI="[object Int32Array]",wI="[object Uint8Array]",SI="[object Uint8ClampedArray]",EI="[object Uint16Array]",CI="[object Uint32Array]",we={};we[_I]=we[mI]=we[$I]=we[bI]=we[yI]=we[wI]=we[SI]=we[EI]=we[CI]=!0;we[rI]=we[nI]=we[dI]=we[aI]=we[gI]=we[iI]=we[sI]=we[oI]=we[uI]=we[fI]=we[lI]=we[cI]=we[hI]=we[pI]=we[vI]=!1;function OI(e){return pa(e)&&Yh(e.length)&&!!we[Ka(e)]}function T$(e){return function(t){return e(t)}}var M$=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fs=M$&&typeof module=="object"&&module&&!module.nodeType&&module,AI=Fs&&Fs.exports===M$,sc=AI&&w$.process,TI=function(){try{var e=Fs&&Fs.require&&Fs.require("util").types;return e||sc&&sc.binding&&sc.binding("util")}catch{}}(),D0=TI,R0=D0&&D0.isTypedArray,MI=R0?T$(R0):OI,Vh=MI,PI=Object.prototype,xI=PI.hasOwnProperty;function P$(e,t){var r=Tr(e),n=!r&&Us(e),a=!r&&!n&&Bu(e),i=!r&&!n&&!a&&Vh(e),s=r||n||a||i,u=s?Kx(e.length,String):[],f=u.length;for(var c in e)(t||xI.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Kh(c,f)))&&u.push(c);return u}function x$(e,t){return function(r){return e(t(r))}}var II=x$(Object.keys,Object),DI=II,RI=Object.prototype,BI=RI.hasOwnProperty;function LI(e){if(!Xh(e))return DI(e);var t=[];for(var r in Object(e))BI.call(e,r)&&r!="constructor"&&t.push(r);return t}function Zh(e){return ji(e)?P$(e):LI(e)}function FI(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var zI=Object.prototype,GI=zI.hasOwnProperty;function NI(e){if(!ba(e))return FI(e);var t=Xh(e),r=[];for(var n in e)n=="constructor"&&(t||!GI.call(e,n))||r.push(n);return r}function I$(e){return ji(e)?P$(e,!0):NI(e)}var jI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qI=/^\w*$/;function Jh(e,t){if(Tr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Uh(e)?!0:qI.test(e)||!jI.test(e)||t!=null&&e in Object(t)}var UI=Xa(Object,"create"),ks=UI;function kI(){this.__data__=ks?ks(null):{},this.size=0}function HI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var WI="__lodash_hash_undefined__",KI=Object.prototype,YI=KI.hasOwnProperty;function XI(e){var t=this.__data__;if(ks){var r=t[e];return r===WI?void 0:r}return YI.call(t,e)?t[e]:void 0}var VI=Object.prototype,ZI=VI.hasOwnProperty;function JI(e){var t=this.__data__;return ks?t[e]!==void 0:ZI.call(t,e)}var QI="__lodash_hash_undefined__";function tD(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ks&&t===void 0?QI:t,this}function ka(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ka.prototype.clear=kI;ka.prototype.delete=HI;ka.prototype.get=XI;ka.prototype.has=JI;ka.prototype.set=tD;function eD(){this.__data__=[],this.size=0}function Vu(e,t){for(var r=e.length;r--;)if(so(e[r][0],t))return r;return-1}var rD=Array.prototype,nD=rD.splice;function aD(e){var t=this.__data__,r=Vu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():nD.call(t,r,1),--this.size,!0}function iD(e){var t=this.__data__,r=Vu(t,e);return r<0?void 0:t[r][1]}function sD(e){return Vu(this.__data__,e)>-1}function oD(e,t){var r=this.__data__,n=Vu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Hn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hn.prototype.clear=eD;Hn.prototype.delete=aD;Hn.prototype.get=iD;Hn.prototype.has=sD;Hn.prototype.set=oD;var uD=Xa(wn,"Map"),Hs=uD;function fD(){this.size=0,this.__data__={hash:new ka,map:new(Hs||Hn),string:new ka}}function lD(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Zu(e,t){var r=e.__data__;return lD(t)?r[typeof t=="string"?"string":"hash"]:r.map}function cD(e){var t=Zu(this,e).delete(e);return this.size-=t?1:0,t}function hD(e){return Zu(this,e).get(e)}function pD(e){return Zu(this,e).has(e)}function vD(e,t){var r=Zu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Wn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Wn.prototype.clear=fD;Wn.prototype.delete=cD;Wn.prototype.get=hD;Wn.prototype.has=pD;Wn.prototype.set=vD;var dD="Expected a function";function Qh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(dD);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Qh.Cache||Wn),r}Qh.Cache=Wn;var gD=500;function _D(e){var t=Qh(e,function(n){return r.size===gD&&r.clear(),n}),r=t.cache;return t}var mD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$D=/\\(\\)?/g,bD=_D(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mD,function(r,n,a,i){t.push(a?i.replace($D,"$1"):n||r)}),t}),yD=bD;function wD(e){return e==null?"":E$(e)}function D$(e,t){return Tr(e)?e:Jh(e,t)?[e]:yD(wD(e))}var SD=1/0;function Ju(e){if(typeof e=="string"||Uh(e))return e;var t=e+"";return t=="0"&&1/e==-SD?"-0":t}function R$(e,t){t=D$(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Ju(t[r++])];return r&&r==n?e:void 0}function tp(e,t,r){var n=e==null?void 0:R$(e,t);return n===void 0?r:n}function B$(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var B0=dn?dn.isConcatSpreadable:void 0;function ED(e){return Tr(e)||Us(e)||!!(B0&&e&&e[B0])}function L$(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=ED),a||(a=[]);++i<s;){var u=e[i];t>0&&r(u)?t>1?L$(u,t-1,r,n,a):B$(a,u):n||(a[a.length]=u)}return a}var CD=x$(Object.getPrototypeOf,Object),F$=CD,OD="[object Object]",AD=Function.prototype,TD=Object.prototype,z$=AD.toString,MD=TD.hasOwnProperty,PD=z$.call(Object);function xD(e){if(!pa(e)||Ka(e)!=OD)return!1;var t=F$(e);if(t===null)return!0;var r=MD.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&z$.call(r)==PD}function ID(){this.__data__=new Hn,this.size=0}function DD(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function RD(e){return this.__data__.get(e)}function BD(e){return this.__data__.has(e)}var LD=200;function FD(e,t){var r=this.__data__;if(r instanceof Hn){var n=r.__data__;if(!Hs||n.length<LD-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wn(n)}return r.set(e,t),this.size=r.size,this}function hn(e){var t=this.__data__=new Hn(e);this.size=t.size}hn.prototype.clear=ID;hn.prototype.delete=DD;hn.prototype.get=RD;hn.prototype.has=BD;hn.prototype.set=FD;var G$=typeof exports=="object"&&exports&&!exports.nodeType&&exports,L0=G$&&typeof module=="object"&&module&&!module.nodeType&&module,zD=L0&&L0.exports===G$,F0=zD?wn.Buffer:void 0,z0=F0?F0.allocUnsafe:void 0;function GD(e,t){if(t)return e.slice();var r=e.length,n=z0?z0(r):new e.constructor(r);return e.copy(n),n}function ND(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}function jD(){return[]}var qD=Object.prototype,UD=qD.propertyIsEnumerable,G0=Object.getOwnPropertySymbols,kD=G0?function(e){return e==null?[]:(e=Object(e),ND(G0(e),function(t){return UD.call(e,t)}))}:jD,HD=kD;function WD(e,t,r){var n=t(e);return Tr(e)?n:B$(n,r(e))}function N0(e){return WD(e,Zh,HD)}var KD=Xa(wn,"DataView"),Dc=KD,YD=Xa(wn,"Promise"),Rc=YD,XD=Xa(wn,"Set"),Bc=XD,j0="[object Map]",VD="[object Object]",q0="[object Promise]",U0="[object Set]",k0="[object WeakMap]",H0="[object DataView]",ZD=Ya(Dc),JD=Ya(Hs),QD=Ya(Rc),t3=Ya(Bc),e3=Ya(Ic),Ba=Ka;(Dc&&Ba(new Dc(new ArrayBuffer(1)))!=H0||Hs&&Ba(new Hs)!=j0||Rc&&Ba(Rc.resolve())!=q0||Bc&&Ba(new Bc)!=U0||Ic&&Ba(new Ic)!=k0)&&(Ba=function(e){var t=Ka(e),r=t==VD?e.constructor:void 0,n=r?Ya(r):"";if(n)switch(n){case ZD:return H0;case JD:return j0;case QD:return q0;case t3:return U0;case e3:return k0}return t});var W0=Ba,r3=wn.Uint8Array,Lu=r3;function n3(e){var t=new e.constructor(e.byteLength);return new Lu(t).set(new Lu(e)),t}function a3(e,t){var r=t?n3(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function i3(e){return typeof e.constructor=="function"&&!Xh(e)?mx(F$(e)):{}}var s3="__lodash_hash_undefined__";function o3(e){return this.__data__.set(e,s3),this}function u3(e){return this.__data__.has(e)}function Ws(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Wn;++t<r;)this.add(e[t])}Ws.prototype.add=Ws.prototype.push=o3;Ws.prototype.has=u3;function f3(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function N$(e,t){return e.has(t)}var l3=1,c3=2;function j$(e,t,r,n,a,i){var s=r&l3,u=e.length,f=t.length;if(u!=f&&!(s&&f>u))return!1;var c=i.get(e),h=i.get(t);if(c&&h)return c==t&&h==e;var p=-1,v=!0,g=r&c3?new Ws:void 0;for(i.set(e,t),i.set(t,e);++p<u;){var _=e[p],m=t[p];if(n)var b=s?n(m,_,p,t,e,i):n(_,m,p,e,t,i);if(b!==void 0){if(b)continue;v=!1;break}if(g){if(!f3(t,function(y,w){if(!N$(g,w)&&(_===y||a(_,y,r,n,i)))return g.push(w)})){v=!1;break}}else if(!(_===m||a(_,m,r,n,i))){v=!1;break}}return i.delete(e),i.delete(t),v}function h3(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function p3(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var v3=1,d3=2,g3="[object Boolean]",_3="[object Date]",m3="[object Error]",$3="[object Map]",b3="[object Number]",y3="[object RegExp]",w3="[object Set]",S3="[object String]",E3="[object Symbol]",C3="[object ArrayBuffer]",O3="[object DataView]",K0=dn?dn.prototype:void 0,oc=K0?K0.valueOf:void 0;function A3(e,t,r,n,a,i,s){switch(r){case O3:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case C3:return!(e.byteLength!=t.byteLength||!i(new Lu(e),new Lu(t)));case g3:case _3:case b3:return so(+e,+t);case m3:return e.name==t.name&&e.message==t.message;case y3:case S3:return e==t+"";case $3:var u=h3;case w3:var f=n&v3;if(u||(u=p3),e.size!=t.size&&!f)return!1;var c=s.get(e);if(c)return c==t;n|=d3,s.set(e,t);var h=j$(u(e),u(t),n,a,i,s);return s.delete(e),h;case E3:if(oc)return oc.call(e)==oc.call(t)}return!1}var T3=1,M3=Object.prototype,P3=M3.hasOwnProperty;function x3(e,t,r,n,a,i){var s=r&T3,u=N0(e),f=u.length,c=N0(t),h=c.length;if(f!=h&&!s)return!1;for(var p=f;p--;){var v=u[p];if(!(s?v in t:P3.call(t,v)))return!1}var g=i.get(e),_=i.get(t);if(g&&_)return g==t&&_==e;var m=!0;i.set(e,t),i.set(t,e);for(var b=s;++p<f;){v=u[p];var y=e[v],w=t[v];if(n)var C=s?n(w,y,v,t,e,i):n(y,w,v,e,t,i);if(!(C===void 0?y===w||a(y,w,r,n,i):C)){m=!1;break}b||(b=v=="constructor")}if(m&&!b){var T=e.constructor,A=t.constructor;T!=A&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof A=="function"&&A instanceof A)&&(m=!1)}return i.delete(e),i.delete(t),m}var I3=1,Y0="[object Arguments]",X0="[object Array]",pu="[object Object]",D3=Object.prototype,V0=D3.hasOwnProperty;function R3(e,t,r,n,a,i){var s=Tr(e),u=Tr(t),f=s?X0:W0(e),c=u?X0:W0(t);f=f==Y0?pu:f,c=c==Y0?pu:c;var h=f==pu,p=c==pu,v=f==c;if(v&&Bu(e)){if(!Bu(t))return!1;s=!0,h=!1}if(v&&!h)return i||(i=new hn),s||Vh(e)?j$(e,t,r,n,a,i):A3(e,t,f,r,n,a,i);if(!(r&I3)){var g=h&&V0.call(e,"__wrapped__"),_=p&&V0.call(t,"__wrapped__");if(g||_){var m=g?e.value():e,b=_?t.value():t;return i||(i=new hn),a(m,b,r,n,i)}}return v?(i||(i=new hn),x3(e,t,r,n,a,i)):!1}function ep(e,t,r,n,a){return e===t?!0:e==null||t==null||!pa(e)&&!pa(t)?e!==e&&t!==t:R3(e,t,r,n,ep,a)}var B3=1,L3=2;function F3(e,t,r,n){var a=r.length,i=a,s=!n;if(e==null)return!i;for(e=Object(e);a--;){var u=r[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<i;){u=r[a];var f=u[0],c=e[f],h=u[1];if(s&&u[2]){if(c===void 0&&!(f in e))return!1}else{var p=new hn;if(n)var v=n(c,h,f,e,t,p);if(!(v===void 0?ep(h,c,B3|L3,n,p):v))return!1}}return!0}function q$(e){return e===e&&!ba(e)}function z3(e){for(var t=Zh(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,q$(a)]}return t}function U$(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function G3(e){var t=z3(e);return t.length==1&&t[0][2]?U$(t[0][0],t[0][1]):function(r){return r===e||F3(r,e,t)}}function N3(e,t){return e!=null&&t in Object(e)}function j3(e,t,r){t=D$(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var s=Ju(t[n]);if(!(i=e!=null&&r(e,s)))break;e=e[s]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&Yh(a)&&Kh(s,a)&&(Tr(e)||Us(e)))}function q3(e,t){return e!=null&&j3(e,t,N3)}var U3=1,k3=2;function H3(e,t){return Jh(e)&&q$(t)?U$(Ju(e),t):function(r){var n=tp(r,e);return n===void 0&&n===t?q3(r,e):ep(t,n,U3|k3)}}function W3(e){return function(t){return t==null?void 0:t[e]}}function K3(e){return function(t){return R$(t,e)}}function Y3(e){return Jh(e)?W3(Ju(e)):K3(e)}function k$(e){return typeof e=="function"?e:e==null?Hh:typeof e=="object"?Tr(e)?H3(e[0],e[1]):G3(e):Y3(e)}function X3(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),u=s.length;u--;){var f=s[e?u:++a];if(r(i[f],f,i)===!1)break}return t}}var V3=X3(),H$=V3;function W$(e,t){return e&&H$(e,t,Zh)}function Z3(e,t){return function(r,n){if(r==null)return r;if(!ji(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var J3=Z3(W$),Q3=J3;function Lc(e,t,r){(r!==void 0&&!so(e[t],r)||r===void 0&&!(t in e))&&Xu(e,t,r)}function Fc(e){return pa(e)&&ji(e)}function zc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function tR(e){return jx(e,I$(e))}function eR(e,t,r,n,a,i,s){var u=zc(e,r),f=zc(t,r),c=s.get(f);if(c){Lc(e,r,c);return}var h=i?i(u,f,r+"",e,t,s):void 0,p=h===void 0;if(p){var v=Tr(f),g=!v&&Bu(f),_=!v&&!g&&Vh(f);h=f,v||g||_?Tr(u)?h=u:Fc(u)?h=bx(u):g?(p=!1,h=GD(f,!0)):_?(p=!1,h=a3(f,!0)):h=[]:xD(f)||Us(f)?(h=u,Us(u)?h=tR(u):(!ba(u)||Wh(u))&&(h=i3(f))):p=!1}p&&(s.set(f,h),a(h,f,n,i,s),s.delete(f)),Lc(e,r,h)}function K$(e,t,r,n,a){e!==t&&H$(t,function(i,s){if(a||(a=new hn),ba(i))eR(e,t,s,r,K$,n,a);else{var u=n?n(zc(e,s),i,s+"",e,t,a):void 0;u===void 0&&(u=i),Lc(e,s,u)}},I$)}function rR(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var nR=200;function aR(e,t,r,n){var a=-1,i=Bx,s=!0,u=e.length,f=[],c=t.length;if(!u)return f;r&&(t=kh(t,T$(r))),n?(i=rR,s=!1):t.length>=nR&&(i=N$,s=!1,t=new Ws(t));t:for(;++a<u;){var h=e[a],p=r==null?h:r(h);if(h=n||h!==0?h:0,s&&p===p){for(var v=c;v--;)if(t[v]===p)continue t;f.push(h)}else i(t,p,n)||f.push(h)}return f}var iR=C$(function(e,t){return Fc(e)?aR(e,L$(t,1,Fc,!0)):[]}),Z0=iR;function sR(e,t){var r=-1,n=ji(e)?Array(e.length):[];return Q3(e,function(a,i,s){n[++r]=t(a,i,s)}),n}function Y$(e,t){var r=Tr(e)?kh:sR;return r(e,k$(t))}function qn(e,t){var r={};return t=k$(t),W$(e,function(n,a,i){Xu(r,a,t(n,a,i))}),r}var oR=Hx(function(e,t,r){K$(e,t,r)}),Gc=oR,Cr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},uR=typeof Cr=="object"&&Cr&&Cr.Object===Object&&Cr,X$=uR,fR=X$,lR=typeof self=="object"&&self&&self.Object===Object&&self,cR=fR||lR||Function("return this")(),Sn=cR,hR=Sn,pR=hR.Symbol,qi=pR,J0=qi,V$=Object.prototype,vR=V$.hasOwnProperty,dR=V$.toString,Os=J0?J0.toStringTag:void 0;function gR(e){var t=vR.call(e,Os),r=e[Os];try{e[Os]=void 0;var n=!0}catch{}var a=dR.call(e);return n&&(t?e[Os]=r:delete e[Os]),a}var _R=gR,mR=Object.prototype,$R=mR.toString;function bR(e){return $R.call(e)}var yR=bR,Q0=qi,wR=_R,SR=yR,ER="[object Null]",CR="[object Undefined]",t1=Q0?Q0.toStringTag:void 0;function OR(e){return e==null?e===void 0?CR:ER:t1&&t1 in Object(e)?wR(e):SR(e)}var Ui=OR;function AR(e,t){return function(r){return e(t(r))}}var Z$=AR,TR=Z$,MR=TR(Object.getPrototypeOf,Object),rp=MR;function PR(e){return e!=null&&typeof e=="object"}var ya=PR,xR=Ui,IR=rp,DR=ya,RR="[object Object]",BR=Function.prototype,LR=Object.prototype,J$=BR.toString,FR=LR.hasOwnProperty,zR=J$.call(Object);function GR(e){if(!DR(e)||xR(e)!=RR)return!1;var t=IR(e);if(t===null)return!0;var r=FR.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&J$.call(r)==zR}var np=GR;function NR(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var Q$=NR;function jR(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),u=s.length;u--;){var f=s[e?u:++a];if(r(i[f],f,i)===!1)break}return t}}var qR=jR,UR=qR,kR=UR(),HR=kR;function WR(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var KR=WR,YR=Ui,XR=ya,VR="[object Arguments]";function ZR(e){return XR(e)&&YR(e)==VR}var JR=ZR,e1=JR,QR=ya,tb=Object.prototype,t4=tb.hasOwnProperty,e4=tb.propertyIsEnumerable,r4=e1(function(){return arguments}())?e1:function(e){return QR(e)&&t4.call(e,"callee")&&!e4.call(e,"callee")},ap=r4,n4=Array.isArray,xr=n4,Ks={exports:{}};function a4(){return!1}var i4=a4;(function(e,t){var r=Sn,n=i4,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,u=s?r.Buffer:void 0,f=u?u.isBuffer:void 0,c=f||n;e.exports=c})(Ks,Ks.exports);var s4=9007199254740991,o4=/^(?:0|[1-9]\d*)$/;function u4(e,t){var r=typeof e;return t=t==null?s4:t,!!t&&(r=="number"||r!="symbol"&&o4.test(e))&&e>-1&&e%1==0&&e<t}var ip=u4,f4=9007199254740991;function l4(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=f4}var sp=l4,c4=Ui,h4=sp,p4=ya,v4="[object Arguments]",d4="[object Array]",g4="[object Boolean]",_4="[object Date]",m4="[object Error]",$4="[object Function]",b4="[object Map]",y4="[object Number]",w4="[object Object]",S4="[object RegExp]",E4="[object Set]",C4="[object String]",O4="[object WeakMap]",A4="[object ArrayBuffer]",T4="[object DataView]",M4="[object Float32Array]",P4="[object Float64Array]",x4="[object Int8Array]",I4="[object Int16Array]",D4="[object Int32Array]",R4="[object Uint8Array]",B4="[object Uint8ClampedArray]",L4="[object Uint16Array]",F4="[object Uint32Array]",Se={};Se[M4]=Se[P4]=Se[x4]=Se[I4]=Se[D4]=Se[R4]=Se[B4]=Se[L4]=Se[F4]=!0;Se[v4]=Se[d4]=Se[A4]=Se[g4]=Se[T4]=Se[_4]=Se[m4]=Se[$4]=Se[b4]=Se[y4]=Se[w4]=Se[S4]=Se[E4]=Se[C4]=Se[O4]=!1;function z4(e){return p4(e)&&h4(e.length)&&!!Se[c4(e)]}var G4=z4;function N4(e){return function(t){return e(t)}}var op=N4,Ys={exports:{}};(function(e,t){var r=X$,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,u=function(){try{var f=a&&a.require&&a.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}}();e.exports=u})(Ys,Ys.exports);var j4=G4,q4=op,r1=Ys.exports,n1=r1&&r1.isTypedArray,U4=n1?q4(n1):j4,eb=U4,k4=KR,H4=ap,W4=xr,K4=Ks.exports,Y4=ip,X4=eb,V4=Object.prototype,Z4=V4.hasOwnProperty;function J4(e,t){var r=W4(e),n=!r&&H4(e),a=!r&&!n&&K4(e),i=!r&&!n&&!a&&X4(e),s=r||n||a||i,u=s?k4(e.length,String):[],f=u.length;for(var c in e)(t||Z4.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Y4(c,f)))&&u.push(c);return u}var rb=J4,Q4=Object.prototype;function tB(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Q4;return e===r}var up=tB,eB=Z$,rB=eB(Object.keys,Object),nB=rB,aB=up,iB=nB,sB=Object.prototype,oB=sB.hasOwnProperty;function uB(e){if(!aB(e))return iB(e);var t=[];for(var r in Object(e))oB.call(e,r)&&r!="constructor"&&t.push(r);return t}var fB=uB;function lB(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Va=lB,cB=Ui,hB=Va,pB="[object AsyncFunction]",vB="[object Function]",dB="[object GeneratorFunction]",gB="[object Proxy]";function _B(e){if(!hB(e))return!1;var t=cB(e);return t==vB||t==dB||t==pB||t==gB}var nb=_B,mB=nb,$B=sp;function bB(e){return e!=null&&$B(e.length)&&!mB(e)}var Qu=bB,yB=rb,wB=fB,SB=Qu;function EB(e){return SB(e)?yB(e):wB(e)}var oo=EB,CB=HR,OB=oo;function AB(e,t){return e&&CB(e,t,OB)}var ab=AB,TB=Qu;function MB(e,t){return function(r,n){if(r==null)return r;if(!TB(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var PB=MB,xB=ab,IB=PB,DB=IB(xB),fp=DB,RB=fp;function BB(e,t){var r=[];return RB(e,function(n,a,i){t(n,a,i)&&r.push(n)}),r}var LB=BB;function FB(){this.__data__=[],this.size=0}var zB=FB;function GB(e,t){return e===t||e!==e&&t!==t}var lp=GB,NB=lp;function jB(e,t){for(var r=e.length;r--;)if(NB(e[r][0],t))return r;return-1}var tf=jB,qB=tf,UB=Array.prototype,kB=UB.splice;function HB(e){var t=this.__data__,r=qB(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():kB.call(t,r,1),--this.size,!0}var WB=HB,KB=tf;function YB(e){var t=this.__data__,r=KB(t,e);return r<0?void 0:t[r][1]}var XB=YB,VB=tf;function ZB(e){return VB(this.__data__,e)>-1}var JB=ZB,QB=tf;function tL(e,t){var r=this.__data__,n=QB(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var eL=tL,rL=zB,nL=WB,aL=XB,iL=JB,sL=eL;function ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ki.prototype.clear=rL;ki.prototype.delete=nL;ki.prototype.get=aL;ki.prototype.has=iL;ki.prototype.set=sL;var ef=ki,oL=ef;function uL(){this.__data__=new oL,this.size=0}var fL=uL;function lL(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var cL=lL;function hL(e){return this.__data__.get(e)}var pL=hL;function vL(e){return this.__data__.has(e)}var dL=vL,gL=Sn,_L=gL["__core-js_shared__"],mL=_L,uc=mL,a1=function(){var e=/[^.]+$/.exec(uc&&uc.keys&&uc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $L(e){return!!a1&&a1 in e}var bL=$L,yL=Function.prototype,wL=yL.toString;function SL(e){if(e!=null){try{return wL.call(e)}catch{}try{return e+""}catch{}}return""}var ib=SL,EL=nb,CL=bL,OL=Va,AL=ib,TL=/[\\^$.*+?()[\]{}|]/g,ML=/^\[object .+?Constructor\]$/,PL=Function.prototype,xL=Object.prototype,IL=PL.toString,DL=xL.hasOwnProperty,RL=RegExp("^"+IL.call(DL).replace(TL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function BL(e){if(!OL(e)||CL(e))return!1;var t=EL(e)?RL:ML;return t.test(AL(e))}var LL=BL;function FL(e,t){return e==null?void 0:e[t]}var zL=FL,GL=LL,NL=zL;function jL(e,t){var r=NL(e,t);return GL(r)?r:void 0}var Za=jL,qL=Za,UL=Sn,kL=qL(UL,"Map"),cp=kL,HL=Za,WL=HL(Object,"create"),rf=WL,i1=rf;function KL(){this.__data__=i1?i1(null):{},this.size=0}var YL=KL;function XL(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VL=XL,ZL=rf,JL="__lodash_hash_undefined__",QL=Object.prototype,tF=QL.hasOwnProperty;function eF(e){var t=this.__data__;if(ZL){var r=t[e];return r===JL?void 0:r}return tF.call(t,e)?t[e]:void 0}var rF=eF,nF=rf,aF=Object.prototype,iF=aF.hasOwnProperty;function sF(e){var t=this.__data__;return nF?t[e]!==void 0:iF.call(t,e)}var oF=sF,uF=rf,fF="__lodash_hash_undefined__";function lF(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=uF&&t===void 0?fF:t,this}var cF=lF,hF=YL,pF=VL,vF=rF,dF=oF,gF=cF;function Hi(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hi.prototype.clear=hF;Hi.prototype.delete=pF;Hi.prototype.get=vF;Hi.prototype.has=dF;Hi.prototype.set=gF;var _F=Hi,s1=_F,mF=ef,$F=cp;function bF(){this.size=0,this.__data__={hash:new s1,map:new($F||mF),string:new s1}}var yF=bF;function wF(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var SF=wF,EF=SF;function CF(e,t){var r=e.__data__;return EF(t)?r[typeof t=="string"?"string":"hash"]:r.map}var nf=CF,OF=nf;function AF(e){var t=OF(this,e).delete(e);return this.size-=t?1:0,t}var TF=AF,MF=nf;function PF(e){return MF(this,e).get(e)}var xF=PF,IF=nf;function DF(e){return IF(this,e).has(e)}var RF=DF,BF=nf;function LF(e,t){var r=BF(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var FF=LF,zF=yF,GF=TF,NF=xF,jF=RF,qF=FF;function Wi(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Wi.prototype.clear=zF;Wi.prototype.delete=GF;Wi.prototype.get=NF;Wi.prototype.has=jF;Wi.prototype.set=qF;var hp=Wi,UF=ef,kF=cp,HF=hp,WF=200;function KF(e,t){var r=this.__data__;if(r instanceof UF){var n=r.__data__;if(!kF||n.length<WF-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new HF(n)}return r.set(e,t),this.size=r.size,this}var YF=KF,XF=ef,VF=fL,ZF=cL,JF=pL,QF=dL,tz=YF;function Ki(e){var t=this.__data__=new XF(e);this.size=t.size}Ki.prototype.clear=VF;Ki.prototype.delete=ZF;Ki.prototype.get=JF;Ki.prototype.has=QF;Ki.prototype.set=tz;var pp=Ki,ez="__lodash_hash_undefined__";function rz(e){return this.__data__.set(e,ez),this}var nz=rz;function az(e){return this.__data__.has(e)}var iz=az,sz=hp,oz=nz,uz=iz;function Fu(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new sz;++t<r;)this.add(e[t])}Fu.prototype.add=Fu.prototype.push=oz;Fu.prototype.has=uz;var fz=Fu;function lz(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var cz=lz;function hz(e,t){return e.has(t)}var pz=hz,vz=fz,dz=cz,gz=pz,_z=1,mz=2;function $z(e,t,r,n,a,i){var s=r&_z,u=e.length,f=t.length;if(u!=f&&!(s&&f>u))return!1;var c=i.get(e),h=i.get(t);if(c&&h)return c==t&&h==e;var p=-1,v=!0,g=r&mz?new vz:void 0;for(i.set(e,t),i.set(t,e);++p<u;){var _=e[p],m=t[p];if(n)var b=s?n(m,_,p,t,e,i):n(_,m,p,e,t,i);if(b!==void 0){if(b)continue;v=!1;break}if(g){if(!dz(t,function(y,w){if(!gz(g,w)&&(_===y||a(_,y,r,n,i)))return g.push(w)})){v=!1;break}}else if(!(_===m||a(_,m,r,n,i))){v=!1;break}}return i.delete(e),i.delete(t),v}var sb=$z,bz=Sn,yz=bz.Uint8Array,ob=yz;function wz(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var Sz=wz;function Ez(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Cz=Ez,o1=qi,u1=ob,Oz=lp,Az=sb,Tz=Sz,Mz=Cz,Pz=1,xz=2,Iz="[object Boolean]",Dz="[object Date]",Rz="[object Error]",Bz="[object Map]",Lz="[object Number]",Fz="[object RegExp]",zz="[object Set]",Gz="[object String]",Nz="[object Symbol]",jz="[object ArrayBuffer]",qz="[object DataView]",f1=o1?o1.prototype:void 0,fc=f1?f1.valueOf:void 0;function Uz(e,t,r,n,a,i,s){switch(r){case qz:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case jz:return!(e.byteLength!=t.byteLength||!i(new u1(e),new u1(t)));case Iz:case Dz:case Lz:return Oz(+e,+t);case Rz:return e.name==t.name&&e.message==t.message;case Fz:case Gz:return e==t+"";case Bz:var u=Tz;case zz:var f=n&Pz;if(u||(u=Mz),e.size!=t.size&&!f)return!1;var c=s.get(e);if(c)return c==t;n|=xz,s.set(e,t);var h=Az(u(e),u(t),n,a,i,s);return s.delete(e),h;case Nz:if(fc)return fc.call(e)==fc.call(t)}return!1}var kz=Uz;function Hz(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var vp=Hz,Wz=vp,Kz=xr;function Yz(e,t,r){var n=t(e);return Kz(e)?n:Wz(n,r(e))}var ub=Yz;function Xz(){return[]}var fb=Xz,Vz=Q$,Zz=fb,Jz=Object.prototype,Qz=Jz.propertyIsEnumerable,l1=Object.getOwnPropertySymbols,tG=l1?function(e){return e==null?[]:(e=Object(e),Vz(l1(e),function(t){return Qz.call(e,t)}))}:Zz,dp=tG,eG=ub,rG=dp,nG=oo;function aG(e){return eG(e,nG,rG)}var lb=aG,c1=lb,iG=1,sG=Object.prototype,oG=sG.hasOwnProperty;function uG(e,t,r,n,a,i){var s=r&iG,u=c1(e),f=u.length,c=c1(t),h=c.length;if(f!=h&&!s)return!1;for(var p=f;p--;){var v=u[p];if(!(s?v in t:oG.call(t,v)))return!1}var g=i.get(e),_=i.get(t);if(g&&_)return g==t&&_==e;var m=!0;i.set(e,t),i.set(t,e);for(var b=s;++p<f;){v=u[p];var y=e[v],w=t[v];if(n)var C=s?n(w,y,v,t,e,i):n(y,w,v,e,t,i);if(!(C===void 0?y===w||a(y,w,r,n,i):C)){m=!1;break}b||(b=v=="constructor")}if(m&&!b){var T=e.constructor,A=t.constructor;T!=A&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof A=="function"&&A instanceof A)&&(m=!1)}return i.delete(e),i.delete(t),m}var fG=uG,lG=Za,cG=Sn,hG=lG(cG,"DataView"),pG=hG,vG=Za,dG=Sn,gG=vG(dG,"Promise"),_G=gG,mG=Za,$G=Sn,bG=mG($G,"Set"),yG=bG,wG=Za,SG=Sn,EG=wG(SG,"WeakMap"),CG=EG,Nc=pG,jc=cp,qc=_G,Uc=yG,kc=CG,cb=Ui,Yi=ib,h1="[object Map]",OG="[object Object]",p1="[object Promise]",v1="[object Set]",d1="[object WeakMap]",g1="[object DataView]",AG=Yi(Nc),TG=Yi(jc),MG=Yi(qc),PG=Yi(Uc),xG=Yi(kc),La=cb;(Nc&&La(new Nc(new ArrayBuffer(1)))!=g1||jc&&La(new jc)!=h1||qc&&La(qc.resolve())!=p1||Uc&&La(new Uc)!=v1||kc&&La(new kc)!=d1)&&(La=function(e){var t=cb(e),r=t==OG?e.constructor:void 0,n=r?Yi(r):"";if(n)switch(n){case AG:return g1;case TG:return h1;case MG:return p1;case PG:return v1;case xG:return d1}return t});var af=La,lc=pp,IG=sb,DG=kz,RG=fG,_1=af,m1=xr,$1=Ks.exports,BG=eb,LG=1,b1="[object Arguments]",y1="[object Array]",vu="[object Object]",FG=Object.prototype,w1=FG.hasOwnProperty;function zG(e,t,r,n,a,i){var s=m1(e),u=m1(t),f=s?y1:_1(e),c=u?y1:_1(t);f=f==b1?vu:f,c=c==b1?vu:c;var h=f==vu,p=c==vu,v=f==c;if(v&&$1(e)){if(!$1(t))return!1;s=!0,h=!1}if(v&&!h)return i||(i=new lc),s||BG(e)?IG(e,t,r,n,a,i):DG(e,t,f,r,n,a,i);if(!(r&LG)){var g=h&&w1.call(e,"__wrapped__"),_=p&&w1.call(t,"__wrapped__");if(g||_){var m=g?e.value():e,b=_?t.value():t;return i||(i=new lc),a(m,b,r,n,i)}}return v?(i||(i=new lc),RG(e,t,r,n,a,i)):!1}var GG=zG,NG=GG,S1=ya;function hb(e,t,r,n,a){return e===t?!0:e==null||t==null||!S1(e)&&!S1(t)?e!==e&&t!==t:NG(e,t,r,n,hb,a)}var pb=hb,jG=pp,qG=pb,UG=1,kG=2;function HG(e,t,r,n){var a=r.length,i=a,s=!n;if(e==null)return!i;for(e=Object(e);a--;){var u=r[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<i;){u=r[a];var f=u[0],c=e[f],h=u[1];if(s&&u[2]){if(c===void 0&&!(f in e))return!1}else{var p=new jG;if(n)var v=n(c,h,f,e,t,p);if(!(v===void 0?qG(h,c,UG|kG,n,p):v))return!1}}return!0}var WG=HG,KG=Va;function YG(e){return e===e&&!KG(e)}var vb=YG,XG=vb,VG=oo;function ZG(e){for(var t=VG(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,XG(a)]}return t}var JG=ZG;function QG(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var db=QG,tN=WG,eN=JG,rN=db;function nN(e){var t=eN(e);return t.length==1&&t[0][2]?rN(t[0][0],t[0][1]):function(r){return r===e||tN(r,e,t)}}var aN=nN,iN=Ui,sN=ya,oN="[object Symbol]";function uN(e){return typeof e=="symbol"||sN(e)&&iN(e)==oN}var gp=uN,fN=xr,lN=gp,cN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hN=/^\w*$/;function pN(e,t){if(fN(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||lN(e)?!0:hN.test(e)||!cN.test(e)||t!=null&&e in Object(t)}var _p=pN,gb=hp,vN="Expected a function";function mp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(vN);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(mp.Cache||gb),r}mp.Cache=gb;var dN=mp,gN=dN,_N=500;function mN(e){var t=gN(e,function(n){return r.size===_N&&r.clear(),n}),r=t.cache;return t}var $N=mN,bN=$N,yN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wN=/\\(\\)?/g,SN=bN(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(yN,function(r,n,a,i){t.push(a?i.replace(wN,"$1"):n||r)}),t}),EN=SN;function CN(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var sf=CN,E1=qi,ON=sf,AN=xr,TN=gp,MN=1/0,C1=E1?E1.prototype:void 0,O1=C1?C1.toString:void 0;function _b(e){if(typeof e=="string")return e;if(AN(e))return ON(e,_b)+"";if(TN(e))return O1?O1.call(e):"";var t=e+"";return t=="0"&&1/e==-MN?"-0":t}var PN=_b,xN=PN;function IN(e){return e==null?"":xN(e)}var DN=IN,RN=xr,BN=_p,LN=EN,FN=DN;function zN(e,t){return RN(e)?e:BN(e,t)?[e]:LN(FN(e))}var Xi=zN,GN=gp,NN=1/0;function jN(e){if(typeof e=="string"||GN(e))return e;var t=e+"";return t=="0"&&1/e==-NN?"-0":t}var Vi=jN,qN=Xi,UN=Vi;function kN(e,t){t=qN(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[UN(t[r++])];return r&&r==n?e:void 0}var of=kN,HN=of;function WN(e,t,r){var n=e==null?void 0:HN(e,t);return n===void 0?r:n}var KN=WN;function YN(e,t){return e!=null&&t in Object(e)}var XN=YN,VN=Xi,ZN=ap,JN=xr,QN=ip,t6=sp,e6=Vi;function r6(e,t,r){t=VN(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var s=e6(t[n]);if(!(i=e!=null&&r(e,s)))break;e=e[s]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&t6(a)&&QN(s,a)&&(JN(e)||ZN(e)))}var n6=r6,a6=XN,i6=n6;function s6(e,t){return e!=null&&i6(e,t,a6)}var o6=s6,u6=pb,f6=KN,l6=o6,c6=_p,h6=vb,p6=db,v6=Vi,d6=1,g6=2;function _6(e,t){return c6(e)&&h6(t)?p6(v6(e),t):function(r){var n=f6(r,e);return n===void 0&&n===t?l6(r,e):u6(t,n,d6|g6)}}var m6=_6;function $6(e){return e}var $p=$6;function b6(e){return function(t){return t==null?void 0:t[e]}}var y6=b6,w6=of;function S6(e){return function(t){return w6(t,e)}}var E6=S6,C6=y6,O6=E6,A6=_p,T6=Vi;function M6(e){return A6(e)?C6(T6(e)):O6(e)}var P6=M6,x6=aN,I6=m6,D6=$p,R6=xr,B6=P6;function L6(e){return typeof e=="function"?e:e==null?D6:typeof e=="object"?R6(e)?I6(e[0],e[1]):x6(e):B6(e)}var uo=L6,F6="Expected a function";function z6(e){if(typeof e!="function")throw new TypeError(F6);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var mb=z6,G6=Q$,N6=LB,j6=uo,q6=xr,U6=mb;function k6(e,t){var r=q6(e)?G6:N6;return r(e,U6(j6(t)))}var $b=k6,H6=Za,W6=function(){try{var e=H6(Object,"defineProperty");return e({},"",{}),e}catch{}}(),bb=W6,A1=bb;function K6(e,t,r){t=="__proto__"&&A1?A1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var bp=K6,Y6=bp,X6=lp,V6=Object.prototype,Z6=V6.hasOwnProperty;function J6(e,t,r){var n=e[t];(!(Z6.call(e,t)&&X6(n,r))||r===void 0&&!(t in e))&&Y6(e,t,r)}var yp=J6,Q6=yp,t5=Xi,e5=ip,T1=Va,r5=Vi;function n5(e,t,r,n){if(!T1(e))return e;t=t5(t,e);for(var a=-1,i=t.length,s=i-1,u=e;u!=null&&++a<i;){var f=r5(t[a]),c=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(a!=s){var h=u[f];c=n?n(h,f,u):void 0,c===void 0&&(c=T1(h)?h:e5(t[a+1])?[]:{})}Q6(u,f,c),u=u[f]}return e}var a5=n5,i5=of,s5=a5,o5=Xi;function u5(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var s=t[n],u=i5(e,s);r(u,s)&&s5(i,o5(s,e),u)}return i}var f5=u5,l5=vp,c5=rp,h5=dp,p5=fb,v5=Object.getOwnPropertySymbols,d5=v5?function(e){for(var t=[];e;)l5(t,h5(e)),e=c5(e);return t}:p5,yb=d5;function g5(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var _5=g5,m5=Va,$5=up,b5=_5,y5=Object.prototype,w5=y5.hasOwnProperty;function S5(e){if(!m5(e))return b5(e);var t=$5(e),r=[];for(var n in e)n=="constructor"&&(t||!w5.call(e,n))||r.push(n);return r}var E5=S5,C5=rb,O5=E5,A5=Qu;function T5(e){return A5(e)?C5(e,!0):O5(e)}var wp=T5,M5=ub,P5=yb,x5=wp;function I5(e){return M5(e,x5,P5)}var Sp=I5,D5=sf,R5=uo,B5=f5,L5=Sp;function F5(e,t){if(e==null)return{};var r=D5(L5(e),function(n){return[n]});return t=R5(t),B5(e,r,function(n,a){return t(n,a[0])})}var z5=F5,G5=uo,N5=mb,j5=z5;function q5(e,t){return j5(e,N5(G5(t)))}var wb=q5;function U5(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Sb=U5,k5=$p;function H5(e){return typeof e=="function"?e:k5}var W5=H5,K5=Sb,Y5=fp,X5=W5,V5=xr;function Z5(e,t){var r=V5(e)?K5:Y5;return r(e,X5(t))}var J5=Z5,Q5=fp,tj=Qu;function ej(e,t){var r=-1,n=tj(e)?Array(e.length):[];return Q5(e,function(a,i,s){n[++r]=t(a,i,s)}),n}var rj=ej,nj=sf,aj=uo,ij=rj,sj=xr;function oj(e,t){var r=sj(e)?nj:ij;return r(e,aj(t))}var uj=oj,fj=bp,lj=ab,cj=uo;function hj(e,t){var r={};return t=cj(t),lj(e,function(n,a,i){fj(r,a,t(n,a,i))}),r}var pj=hj,vj=yp,dj=bp;function gj(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var u=t[i],f=n?n(r[u],e[u],u,r,e):void 0;f===void 0&&(f=e[u]),a?dj(r,u,f):vj(r,u,f)}return r}var fo=gj,_j=fo,mj=oo;function $j(e,t){return e&&_j(t,mj(t),e)}var bj=$j,yj=fo,wj=wp;function Sj(e,t){return e&&yj(t,wj(t),e)}var Ej=Sj,Hc={exports:{}};(function(e,t){var r=Sn,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function f(c,h){if(h)return c.slice();var p=c.length,v=u?u(p):new c.constructor(p);return c.copy(v),v}e.exports=f})(Hc,Hc.exports);function Cj(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Oj=Cj,Aj=fo,Tj=dp;function Mj(e,t){return Aj(e,Tj(e),t)}var Pj=Mj,xj=fo,Ij=yb;function Dj(e,t){return xj(e,Ij(e),t)}var Rj=Dj,Bj=Object.prototype,Lj=Bj.hasOwnProperty;function Fj(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Lj.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var zj=Fj,M1=ob;function Gj(e){var t=new e.constructor(e.byteLength);return new M1(t).set(new M1(e)),t}var Ep=Gj,Nj=Ep;function jj(e,t){var r=t?Nj(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var qj=jj,Uj=/\w*$/;function kj(e){var t=new e.constructor(e.source,Uj.exec(e));return t.lastIndex=e.lastIndex,t}var Hj=kj,P1=qi,x1=P1?P1.prototype:void 0,I1=x1?x1.valueOf:void 0;function Wj(e){return I1?Object(I1.call(e)):{}}var Kj=Wj,Yj=Ep;function Xj(e,t){var r=t?Yj(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Vj=Xj,Zj=Ep,Jj=qj,Qj=Hj,tq=Kj,eq=Vj,rq="[object Boolean]",nq="[object Date]",aq="[object Map]",iq="[object Number]",sq="[object RegExp]",oq="[object Set]",uq="[object String]",fq="[object Symbol]",lq="[object ArrayBuffer]",cq="[object DataView]",hq="[object Float32Array]",pq="[object Float64Array]",vq="[object Int8Array]",dq="[object Int16Array]",gq="[object Int32Array]",_q="[object Uint8Array]",mq="[object Uint8ClampedArray]",$q="[object Uint16Array]",bq="[object Uint32Array]";function yq(e,t,r){var n=e.constructor;switch(t){case lq:return Zj(e);case rq:case nq:return new n(+e);case cq:return Jj(e,r);case hq:case pq:case vq:case dq:case gq:case _q:case mq:case $q:case bq:return eq(e,r);case aq:return new n;case iq:case uq:return new n(e);case sq:return Qj(e);case oq:return new n;case fq:return tq(e)}}var wq=yq,Sq=Va,D1=Object.create,Eq=function(){function e(){}return function(t){if(!Sq(t))return{};if(D1)return D1(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Cq=Eq,Oq=Cq,Aq=rp,Tq=up;function Mq(e){return typeof e.constructor=="function"&&!Tq(e)?Oq(Aq(e)):{}}var Pq=Mq,xq=af,Iq=ya,Dq="[object Map]";function Rq(e){return Iq(e)&&xq(e)==Dq}var Bq=Rq,Lq=Bq,Fq=op,R1=Ys.exports,B1=R1&&R1.isMap,zq=B1?Fq(B1):Lq,Gq=zq,Nq=af,jq=ya,qq="[object Set]";function Uq(e){return jq(e)&&Nq(e)==qq}var kq=Uq,Hq=kq,Wq=op,L1=Ys.exports,F1=L1&&L1.isSet,Kq=F1?Wq(F1):Hq,Yq=Kq,Xq=pp,Vq=Sb,Zq=yp,Jq=bj,Qq=Ej,t8=Hc.exports,e8=Oj,r8=Pj,n8=Rj,a8=lb,i8=Sp,s8=af,o8=zj,u8=wq,f8=Pq,l8=xr,c8=Ks.exports,h8=Gq,p8=Va,v8=Yq,d8=oo,g8=wp,_8=1,m8=2,$8=4,Eb="[object Arguments]",b8="[object Array]",y8="[object Boolean]",w8="[object Date]",S8="[object Error]",Cb="[object Function]",E8="[object GeneratorFunction]",C8="[object Map]",O8="[object Number]",Ob="[object Object]",A8="[object RegExp]",T8="[object Set]",M8="[object String]",P8="[object Symbol]",x8="[object WeakMap]",I8="[object ArrayBuffer]",D8="[object DataView]",R8="[object Float32Array]",B8="[object Float64Array]",L8="[object Int8Array]",F8="[object Int16Array]",z8="[object Int32Array]",G8="[object Uint8Array]",N8="[object Uint8ClampedArray]",j8="[object Uint16Array]",q8="[object Uint32Array]",me={};me[Eb]=me[b8]=me[I8]=me[D8]=me[y8]=me[w8]=me[R8]=me[B8]=me[L8]=me[F8]=me[z8]=me[C8]=me[O8]=me[Ob]=me[A8]=me[T8]=me[M8]=me[P8]=me[G8]=me[N8]=me[j8]=me[q8]=!0;me[S8]=me[Cb]=me[x8]=!1;function Ou(e,t,r,n,a,i){var s,u=t&_8,f=t&m8,c=t&$8;if(r&&(s=a?r(e,n,a,i):r(e)),s!==void 0)return s;if(!p8(e))return e;var h=l8(e);if(h){if(s=o8(e),!u)return e8(e,s)}else{var p=s8(e),v=p==Cb||p==E8;if(c8(e))return t8(e,u);if(p==Ob||p==Eb||v&&!a){if(s=f||v?{}:f8(e),!u)return f?n8(e,Qq(s,e)):r8(e,Jq(s,e))}else{if(!me[p])return a?e:{};s=u8(e,p,u)}}i||(i=new Xq);var g=i.get(e);if(g)return g;i.set(e,s),v8(e)?e.forEach(function(b){s.add(Ou(b,t,r,b,e,i))}):h8(e)&&e.forEach(function(b,y){s.set(y,Ou(b,t,r,y,e,i))});var _=c?f?i8:a8:f?g8:d8,m=h?void 0:_(e);return Vq(m||e,function(b,y){m&&(y=b,b=e[y]),Zq(s,y,Ou(b,t,r,y,e,i))}),s}var U8=Ou;function k8(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var H8=k8;function W8(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var K8=W8,Y8=of,X8=K8;function V8(e,t){return t.length<2?e:Y8(e,X8(t,0,-1))}var Z8=V8,J8=Xi,Q8=H8,tU=Z8,eU=Vi;function rU(e,t){return t=J8(t,e),e=tU(e,t),e==null||delete e[eU(Q8(t))]}var nU=rU,aU=np;function iU(e){return aU(e)?void 0:e}var sU=iU,z1=qi,oU=ap,uU=xr,G1=z1?z1.isConcatSpreadable:void 0;function fU(e){return uU(e)||oU(e)||!!(G1&&e&&e[G1])}var lU=fU,cU=vp,hU=lU;function Ab(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=hU),a||(a=[]);++i<s;){var u=e[i];t>0&&r(u)?t>1?Ab(u,t-1,r,n,a):cU(a,u):n||(a[a.length]=u)}return a}var pU=Ab,vU=pU;function dU(e){var t=e==null?0:e.length;return t?vU(e,1):[]}var gU=dU;function _U(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var mU=_U,$U=mU,N1=Math.max;function bU(e,t,r){return t=N1(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=N1(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=n[a];return u[t]=r(s),$U(e,this,u)}}var yU=bU;function wU(e){return function(){return e}}var SU=wU,EU=SU,j1=bb,CU=$p,OU=j1?function(e,t){return j1(e,"toString",{configurable:!0,enumerable:!1,value:EU(t),writable:!0})}:CU,AU=OU,TU=800,MU=16,PU=Date.now;function xU(e){var t=0,r=0;return function(){var n=PU(),a=MU-(n-r);if(r=n,a>0){if(++t>=TU)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var IU=xU,DU=AU,RU=IU,BU=RU(DU),LU=BU,FU=gU,zU=yU,GU=LU;function NU(e){return GU(zU(e,void 0,FU),e+"")}var jU=NU,qU=sf,UU=U8,kU=nU,HU=Xi,WU=fo,KU=sU,YU=jU,XU=Sp,VU=1,ZU=2,JU=4,QU=YU(function(e,t){var r={};if(e==null)return r;var n=!1;t=qU(t,function(i){return i=HU(i,e),n||(n=i.length>1),i}),WU(e,XU(e),r),n&&(r=UU(r,VU|ZU|JU,KU));for(var a=t.length;a--;)kU(r,t[a]);return r}),tk=QU;function ek(e){return e}function Tb(e){var t=e;return function(){return t}}function Mb(e){return Array.isArray(e)?e:$b((""+e).split("."),function(t){return!t})}var ce="@@updeep/placeholder";function uf(e,t){var r=e.length;for(r>t&&(r=t);e[r-1]===ce;)r-=1;return r}function ln(e){return function t(r){var n=[].slice.call(arguments,1),a=n[0],i=n[1],s=uf(arguments);return s>=1?e(r,a,i):t}}function un(e){return function t(r,n){var a=[].slice.call(arguments,2),i=a[0],s=a[1],u=uf(arguments,2);if(n===ce||i===ce||s===ce)throw new Error("Can only use placeholder on first argument of this function.");return u>=2?r===ce?ln(function(f,c,h){return e(f,n,c,h)}):e(r,n,i,s):u===1?ln(function(f,c,h){return e(r,f,c,h)}):t}}function Ms(e){return function t(r,n,a){var i=[].slice.call(arguments,3),s=i[0],u=i[1],f=uf(arguments,3);if(a===ce||s===ce||u===ce)throw new Error("Can only use placeholder on first or second argument of this function.");return f>=3?r===ce?n===ce?un(function(c,h,p,v){return e(c,h,a,p,v)}):ln(function(c,h,p){return e(c,n,a,h,p)}):n===ce?ln(function(c,h,p){return e(r,c,a,h,p)}):e(r,n,a,s,u):f===2?r===ce?un(function(c,h,p,v){return e(c,n,h,p,v)}):ln(function(c,h,p){return e(r,n,c,h,p)}):f===1?un(function(c,h,p,v){return e(r,c,h,p,v)}):t}}function rk(e){return function t(r,n,a,i){var s=[].slice.call(arguments,4),u=s[0],f=s[1],c=uf(arguments,4);if(i===ce||u===ce||f===ce)throw new Error("Can only use placeholder on first, second or third argument of this function.");return c>=4?r===ce?n===ce?a===ce?Ms(function(h,p,v,g,_){return e(h,p,v,i,g,_)}):un(function(h,p,v,g){return e(h,p,a,i,v,g)}):a===ce?un(function(h,p,v,g){return e(h,n,p,i,v,g)}):ln(function(h,p,v){return e(h,n,a,i,p,v)}):n===ce?a===ce?un(function(h,p,v,g){return e(r,h,p,i,v,g)}):ln(function(h,p,v){return e(r,h,a,i,p,v)}):a===ce?ln(function(h,p,v){return e(r,n,h,i,p,v)}):e(r,n,a,i,u,f):c===3?r===ce?n===ce?Ms(function(h,p,v,g,_){return e(h,p,a,v,g,_)}):un(function(h,p,v,g){return e(h,n,a,p,v,g)}):n===ce?un(function(h,p,v,g){return e(r,h,a,p,v,g)}):ln(function(h,p,v){return e(r,n,a,h,p,v)}):c===2?r===ce?Ms(function(h,p,v,g,_){return e(h,n,p,v,g,_)}):un(function(h,p,v,g){return e(r,n,h,p,v,g)}):c===1?Ms(function(h,p,v,g,_){return e(r,h,p,v,g,_)}):t}}function lo(e,t){return t===void 0&&(t=e.length),[e,ln,un,Ms,rk][t](e)}var nk=lo(function(e,t,r){for(var n=Mb(e),a=r,i=0;i<n.length;i+=1){if(a===void 0)return!1;a=a[n[i]]}return typeof t=="function"?t(a):t===a});function Pb(){return(Pb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Zi(e,t){return t===void 0&&(t=e.length),lo(function(){return e.apply(void 0,[].slice.call(arguments))},t)}var Wc={__omitted:!0},ak=Tb(Wc);function ik(e){return!Object.keys(e).length}function sk(e,t){return function(r,n,a){return Object.keys(r).reduce(function(i,s){return n(i,r[s],s)},{})}(e,function(r,n,a){var i=n;return Array.isArray(n)||n===null||typeof n!="object"?typeof n=="function"&&(i=n(t[a])):i=xb(n,t[a]),t[a]!==i&&(r[a]=i),r})}function ok(e,t){var r=[].concat(t);return Object.keys(e).forEach(function(n){r[n]=e[n]}),r}function xb(e,t){if(typeof e=="function")return e.apply(void 0,[t].concat([].slice.call(arguments,2)));if(!np(e))return e;var r=t==null?{}:t,n=sk(e,r);return ik(n)?r:Array.isArray(r)?ok(n,r).filter(function(a){return a!==Wc}):wb(Pb({},r,n),function(a){return a===Wc})}var Ja=Zi(xb,2),Ib=Zi(function(e,t,r,n){var a=typeof e=="function"?e(n):e;return Ja(a?t:r,n)}),uk=lo(function(e,t,r){return Ib(e,t,function(n){return n},r)}),Db=Zi(function(e,t){var r=typeof e=="function"?e:Ja(e),n=(Array.isArray(t)?uj:pj)(t,r);return function(a,i){var s=!0;return J5(i,function(u,f){if(u!==a[f])return s=!1,!1}),s}(t,n)?t:n}),fk=Zi(function(e,t){return tk(t,e)}),lk=Zi(function(e,t){return wb(t,e)}),ck=Zi(function(e,t){var r=$b(t,e);return t.length===r.length?t:r});function hk(e,t){var r;return t==="*"?function(n){var a;return Object.prototype.hasOwnProperty.call(n,"*")?Ja(((a={})["*"]=e,a),n):Db(e,n)}:((r={})[t]=e,r)}var pk=lo(function(e,t,r){var n=Mb(e).reduceRight(hk,t);return Ja(n,r)}),vk=lo(function(e,t,r){return Ja(t,r===void 0?e:r)}),Ve=Ja;Ve._=ce,Ve.constant=Tb,Ve.if=uk,Ve.ifElse=Ib,Ve.is=nk,Ve.freeze=ek,Ve.map=Db,Ve.omit=fk,Ve.omitBy=lk,Ve.reject=ck,Ve.update=Ja,Ve.updateIn=pk,Ve.omitted=ak,Ve.withDefault=vk;function dk(e,t={}){if(!np(e)&&Object.keys(t).length>0)throw new Error("can't have subduxes on a dux which state is not an object");if(Object.keys(t).length===1&&t["*"])return e;const r=qn(t,({initial:n},a)=>a==="*"?[]:n);return Ve(e,r)}function gk(e={},t={}){const r=Object.assign({},e);return Object.values(t).forEach(({actions:n})=>{!n||Object.entries(n).forEach(([a,i])=>{if(r[a]){if(r[a]===i)return;throw new Error(`trying to merge two different actions ${a}`)}r[a]=i})}),r}function _k(e,t={},r={}){const n=Y$(r,({selectors:i},s)=>i?s==="*"?{}:qn(i,u=>f=>u(f[s])):{});let a={};for(const i in t)a[i]=s=>(...u)=>{const f=t[i](s)(...u);return Gc(()=>f,qn(r["*"].selectors,h=>()=>h(f)))};return Gc({},...n,e,a)}function q1(e,t,r){let n=function(...a){const i={type:e};return t?i.payload=t(...a):a[0]!==void 0&&(i.payload=a[0]),i};if(r){const a=n;n=(...i)=>r(a(...i),i)}return n.type=e,n}function mk(e,t,r={},n=void 0){const a=Object.keys(r).length>0?qn(r,({upreducer:s})=>s):null,i=s=>u=>{if(!(s!=null&&s.type))throw new Error("upreducer called with a bad action");let f=u!=null?u:e;if(a)if(r["*"])f=Ve.updateIn("*",r["*"].upreducer(s),f);else{const h=qn(a,p=>p(s));f=Ve(h,f)}const c=t[s.type]||t["+"];return c?c(s.payload,s)(f):f};return n?n(i):i}const $k=(e,t)=>r=>n=>a=>e!=="*"&&a.type!==e?n(a):t(r)(n)(a),bk=(e,t)=>r=>{const n=()=>tp(r.getState(),e);return t(Object.assign(Object.assign({},r),{getState:n}))};function Kc(e,t,r){const n=()=>e.getState(),a=i=>e.dispatch(i);return Object.assign(n,qn(r,i=>(...s)=>{let u=i(e.getState());return typeof u=="function"?u(...s):u})),Object.assign(a,qn(t,i=>(...s)=>e.dispatch(i(...s)))),Object.assign(Object.assign({},e),{getState:n,dispatch:a,actions:t,selectors:r})}const Rb=(e,t,r)=>{let n=e,a="*";return Array.isArray(e)&&(a=e[0],n=e[1],n=$k(a,n)),i=>n(Kc(i,t,r))},yk=e=>t=>r=>e.reduceRight((n,a)=>a(t)(n),r);function wk(e=[],t={},r={},n={},a=void 0,i=void 0){let s=Y$(n,({middleware:c},h)=>h!=="*"&&c?bk(h,c):void 0).filter(c=>c),f=[...e.map(c=>Rb(c,t,r)),...s];return a&&(f=a(f,i)),yk(f)}var He=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},te=globalThis&&globalThis.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Au,Er,Fa,Ci,za,Oi,sa,Ai,Ps,Tu,xs,Yc,Xc,Vc,Zc,Jc;class Ke{constructor(t){var r,n,a,i,s;if(Au.set(this,{}),Er.set(this,{}),Fa.set(this,{}),Ci.set(this,{}),za.set(this,{}),Oi.set(this,[]),sa.set(this,[]),Ai.set(this,void 0),Ps.set(this,void 0),Tu.set(this,void 0),xs.set(this,void 0),Yc.set(this,It(dk)),Xc.set(this,It(gk)),Vc.set(this,It(_k)),Zc.set(this,It(mk)),Jc.set(this,It(wk)),He(this,Au,(r=t.initial)!==null&&r!==void 0?r:{},"f"),He(this,Er,(n=t.subduxes)!==null&&n!==void 0?n:{},"f"),t.subduxes&&He(this,Er,qn(t.subduxes,u=>u instanceof Ke?u:new Ke(u)),"f"),t.actions)for(const[u,f]of Object.entries(t.actions))if(typeof f=="function"&&f.type)te(this,Fa,"f")[u]=f;else{const c=Array.isArray(f)?f:[f];te(this,Fa,"f")[u]=q1(u,...c)}He(this,Ci,(a=t.selectors)!==null&&a!==void 0?a:{},"f"),He(this,Ai,t.mappedSelectors,"f"),He(this,za,(i=t.mutations)!==null&&i!==void 0?i:{},"f"),Object.keys(te(this,za,"f")).filter(u=>u!=="+").filter(u=>!this.actions.hasOwnProperty(u)).forEach(u=>{throw new Error(`action '${u}' is not defined`)}),t.effects&&He(this,Oi,Object.entries(t.effects),"f"),He(this,sa,(s=t.reactions)!==null&&s!==void 0?s:[],"f"),He(this,Ps,t.mappedReaction,"f"),He(this,Tu,t.upreducerWrapper,"f"),He(this,xs,t.middlewareWrapper,"f")}setMappedSelector(t,r){He(this,Ai,Object.assign(Object.assign({},te(this,Ai,"f")),{[t]:r}),"f")}get middleware(){return te(this,Jc,"f").call(this,te(this,Oi,"f"),this.actions,this.selectors,te(this,Er,"f"),te(this,xs,"f"),this)}setMiddlewareWrapper(t){He(this,xs,t,"f")}get initial(){return te(this,Yc,"f").call(this,te(this,Au,"f"),te(this,Er,"f"))}get actions(){return te(this,Xc,"f").call(this,te(this,Fa,"f"),te(this,Er,"f"))}get selectors(){return te(this,Vc,"f").call(this,te(this,Ci,"f"),te(this,Ai,"f"),te(this,Er,"f"))}get subduxes(){return te(this,Er,"f")}get upreducer(){return te(this,Zc,"f").call(this,this.initial,te(this,za,"f"),te(this,Er,"f"),te(this,Tu,"f"))}get reducer(){return(t,r)=>this.upreducer(r)(t)}addSubscription(t){He(this,sa,[...te(this,sa,"f"),t],"f")}addReaction(t){He(this,sa,[...te(this,sa,"f"),t],"f")}setAction(t,r){const n=q1(t,r);return He(this,Fa,Object.assign(Object.assign({},te(this,Fa,"f")),{[t]:n}),"f"),n}setSelector(t,r){return He(this,Ci,Object.assign(Object.assign({},te(this,Ci,"f")),{[t]:r}),"f"),r}setMutation(t,r){return typeof t=="function"&&(t=t.type),He(this,za,Object.assign(Object.assign({},te(this,za,"f")),{[t]:r}),"f"),r}addEffect(t,r){return He(this,Oi,[...te(this,Oi,"f"),[t,r]],"f"),r}augmentMiddlewareApi(t){return Kc(t,this.actions,this.selectors)}splatSubscriber(t,r,n){const a={};return()=>(i,s,u)=>{const f=Object.keys(a),c=Z0(Object.keys(i),f);for(const p of c){let v=Object.assign(Object.assign({},t),{getState:()=>t.getState()[p]});a[p]=[],typeof n=="function"&&(v=Object.assign(Object.assign({},v),n(v,p)));const{unsub:g,subscriber:_,subscriberRaw:m}=r.subscribeAll(v);a[p].push({unsub:g,subscriber:_,subscriberRaw:m}),_()}const h=Z0(f,Object.keys(i));for(const p of h){for(const v of a[p])v.subscriber(),v.unsub();delete a[p]}}}subscribeTo(t,r,n=[]){const a=Kc(Object.assign(Object.assign({},t),{subscribe:h=>this.subscribeTo(t,()=>h)}),this.actions,this.selectors),i=r(a,...n);let s;const u=()=>{const h=t.getState();if(h===s)return;let p=s;s=h,i(h,p,c)};let f=t.subscribe(u);const c=typeof f=="function"?f:f.unsub;return{unsub:c,subscriber:u,subscriberRaw:i}}subscribeAll(t){let r=te(this,sa,"f").map(n=>this.subscribeTo(t,n));for(const n in te(this,Er,"f"))if(n!=="*"){const a=Object.assign(Object.assign({},t),{getState:()=>tp(t.getState(),n)});r.push(te(this,Er,"f")[n].subscribeAll(a))}return te(this,Ps,"f")&&r.push(this.subscribeTo(t,this.splatSubscriber(t,te(this,Er,"f")["*"],te(this,Ps,"f")))),{unsub:()=>r.forEach(({unsub:n})=>n()),subscriber:()=>r.forEach(({subscriber:n})=>n()),subscriberRaw:(...n)=>r.forEach(({subscriberRaw:a})=>a(...n))}}createStore(t,r){const n=(r!=null?r:FP)(this.middleware),a=y$(this.reducer,t!=null?t:this.initial,n);a.actions=this.actions,a.selectors=this.selectors,Gc(a.getState,qn(this.selectors,i=>(...s)=>{let u=i(a.getState());return typeof u=="function"?u(...s):u}));for(const i in this.actions)a.dispatch[i]=(...s)=>a.dispatch(this.actions[i](...s));return this.subscribeAll(a),a}effectToMiddleware(t){return Rb(t,this.actions,this.selectors)}}Au=new WeakMap,Er=new WeakMap,Fa=new WeakMap,Ci=new WeakMap,za=new WeakMap,Oi=new WeakMap,sa=new WeakMap,Ai=new WeakMap,Ps=new WeakMap,Tu=new WeakMap,xs=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Vc=new WeakMap,Zc=new WeakMap,Jc=new WeakMap;function Sk(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var Bb=Sk;function Ek(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),u=s.length;u--;){var f=s[e?u:++a];if(r(i[f],f,i)===!1)break}return t}}var Ck=Ek,Ok=Ck,Ak=Ok(),Tk=Ak;function Mk(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Pk=Mk,xk=typeof Cr=="object"&&Cr&&Cr.Object===Object&&Cr,Lb=xk,Ik=Lb,Dk=typeof self=="object"&&self&&self.Object===Object&&self,Rk=Ik||Dk||Function("return this")(),En=Rk,Bk=En,Lk=Bk.Symbol,Ji=Lk,U1=Ji,Fb=Object.prototype,Fk=Fb.hasOwnProperty,zk=Fb.toString,As=U1?U1.toStringTag:void 0;function Gk(e){var t=Fk.call(e,As),r=e[As];try{e[As]=void 0;var n=!0}catch{}var a=zk.call(e);return n&&(t?e[As]=r:delete e[As]),a}var Nk=Gk,jk=Object.prototype,qk=jk.toString;function Uk(e){return qk.call(e)}var kk=Uk,k1=Ji,Hk=Nk,Wk=kk,Kk="[object Null]",Yk="[object Undefined]",H1=k1?k1.toStringTag:void 0;function Xk(e){return e==null?e===void 0?Yk:Kk:H1&&H1 in Object(e)?Hk(e):Wk(e)}var Qi=Xk;function Vk(e){return e!=null&&typeof e=="object"}var wa=Vk,Zk=Qi,Jk=wa,Qk="[object Arguments]";function tH(e){return Jk(e)&&Zk(e)==Qk}var eH=tH,W1=eH,rH=wa,zb=Object.prototype,nH=zb.hasOwnProperty,aH=zb.propertyIsEnumerable,iH=W1(function(){return arguments}())?W1:function(e){return rH(e)&&nH.call(e,"callee")&&!aH.call(e,"callee")},Cp=iH,sH=Array.isArray,Ir=sH,Xs={exports:{}};function oH(){return!1}var uH=oH;(function(e,t){var r=En,n=uH,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,u=s?r.Buffer:void 0,f=u?u.isBuffer:void 0,c=f||n;e.exports=c})(Xs,Xs.exports);var fH=9007199254740991,lH=/^(?:0|[1-9]\d*)$/;function cH(e,t){var r=typeof e;return t=t==null?fH:t,!!t&&(r=="number"||r!="symbol"&&lH.test(e))&&e>-1&&e%1==0&&e<t}var Op=cH,hH=9007199254740991;function pH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=hH}var Ap=pH,vH=Qi,dH=Ap,gH=wa,_H="[object Arguments]",mH="[object Array]",$H="[object Boolean]",bH="[object Date]",yH="[object Error]",wH="[object Function]",SH="[object Map]",EH="[object Number]",CH="[object Object]",OH="[object RegExp]",AH="[object Set]",TH="[object String]",MH="[object WeakMap]",PH="[object ArrayBuffer]",xH="[object DataView]",IH="[object Float32Array]",DH="[object Float64Array]",RH="[object Int8Array]",BH="[object Int16Array]",LH="[object Int32Array]",FH="[object Uint8Array]",zH="[object Uint8ClampedArray]",GH="[object Uint16Array]",NH="[object Uint32Array]",Ee={};Ee[IH]=Ee[DH]=Ee[RH]=Ee[BH]=Ee[LH]=Ee[FH]=Ee[zH]=Ee[GH]=Ee[NH]=!0;Ee[_H]=Ee[mH]=Ee[PH]=Ee[$H]=Ee[xH]=Ee[bH]=Ee[yH]=Ee[wH]=Ee[SH]=Ee[EH]=Ee[CH]=Ee[OH]=Ee[AH]=Ee[TH]=Ee[MH]=!1;function jH(e){return gH(e)&&dH(e.length)&&!!Ee[vH(e)]}var qH=jH;function UH(e){return function(t){return e(t)}}var Tp=UH,Vs={exports:{}};(function(e,t){var r=Lb,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,u=function(){try{var f=a&&a.require&&a.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}}();e.exports=u})(Vs,Vs.exports);var kH=qH,HH=Tp,K1=Vs.exports,Y1=K1&&K1.isTypedArray,WH=Y1?HH(Y1):kH,Gb=WH,KH=Pk,YH=Cp,XH=Ir,VH=Xs.exports,ZH=Op,JH=Gb,QH=Object.prototype,tW=QH.hasOwnProperty;function eW(e,t){var r=XH(e),n=!r&&YH(e),a=!r&&!n&&VH(e),i=!r&&!n&&!a&&JH(e),s=r||n||a||i,u=s?KH(e.length,String):[],f=u.length;for(var c in e)(t||tW.call(e,c))&&!(s&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ZH(c,f)))&&u.push(c);return u}var Nb=eW,rW=Object.prototype;function nW(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||rW;return e===r}var Mp=nW;function aW(e,t){return function(r){return e(t(r))}}var jb=aW,iW=jb,sW=iW(Object.keys,Object),oW=sW,uW=Mp,fW=oW,lW=Object.prototype,cW=lW.hasOwnProperty;function hW(e){if(!uW(e))return fW(e);var t=[];for(var r in Object(e))cW.call(e,r)&&r!="constructor"&&t.push(r);return t}var pW=hW;function vW(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Qa=vW,dW=Qi,gW=Qa,_W="[object AsyncFunction]",mW="[object Function]",$W="[object GeneratorFunction]",bW="[object Proxy]";function yW(e){if(!gW(e))return!1;var t=dW(e);return t==mW||t==$W||t==_W||t==bW}var qb=yW,wW=qb,SW=Ap;function EW(e){return e!=null&&SW(e.length)&&!wW(e)}var ff=EW,CW=Nb,OW=pW,AW=ff;function TW(e){return AW(e)?CW(e):OW(e)}var co=TW,MW=Tk,PW=co;function xW(e,t){return e&&MW(e,t,PW)}var Ub=xW,IW=ff;function DW(e,t){return function(r,n){if(r==null)return r;if(!IW(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var RW=DW,BW=Ub,LW=RW,FW=LW(BW),Pp=FW,zW=Pp;function GW(e,t){var r=[];return zW(e,function(n,a,i){t(n,a,i)&&r.push(n)}),r}var NW=GW;function jW(){this.__data__=[],this.size=0}var qW=jW;function UW(e,t){return e===t||e!==e&&t!==t}var xp=UW,kW=xp;function HW(e,t){for(var r=e.length;r--;)if(kW(e[r][0],t))return r;return-1}var lf=HW,WW=lf,KW=Array.prototype,YW=KW.splice;function XW(e){var t=this.__data__,r=WW(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():YW.call(t,r,1),--this.size,!0}var VW=XW,ZW=lf;function JW(e){var t=this.__data__,r=ZW(t,e);return r<0?void 0:t[r][1]}var QW=JW,t7=lf;function e7(e){return t7(this.__data__,e)>-1}var r7=e7,n7=lf;function a7(e,t){var r=this.__data__,n=n7(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var i7=a7,s7=qW,o7=VW,u7=QW,f7=r7,l7=i7;function ts(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ts.prototype.clear=s7;ts.prototype.delete=o7;ts.prototype.get=u7;ts.prototype.has=f7;ts.prototype.set=l7;var cf=ts,c7=cf;function h7(){this.__data__=new c7,this.size=0}var p7=h7;function v7(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var d7=v7;function g7(e){return this.__data__.get(e)}var _7=g7;function m7(e){return this.__data__.has(e)}var $7=m7,b7=En,y7=b7["__core-js_shared__"],w7=y7,cc=w7,X1=function(){var e=/[^.]+$/.exec(cc&&cc.keys&&cc.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function S7(e){return!!X1&&X1 in e}var E7=S7,C7=Function.prototype,O7=C7.toString;function A7(e){if(e!=null){try{return O7.call(e)}catch{}try{return e+""}catch{}}return""}var kb=A7,T7=qb,M7=E7,P7=Qa,x7=kb,I7=/[\\^$.*+?()[\]{}|]/g,D7=/^\[object .+?Constructor\]$/,R7=Function.prototype,B7=Object.prototype,L7=R7.toString,F7=B7.hasOwnProperty,z7=RegExp("^"+L7.call(F7).replace(I7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function G7(e){if(!P7(e)||M7(e))return!1;var t=T7(e)?z7:D7;return t.test(x7(e))}var N7=G7;function j7(e,t){return e==null?void 0:e[t]}var q7=j7,U7=N7,k7=q7;function H7(e,t){var r=k7(e,t);return U7(r)?r:void 0}var ti=H7,W7=ti,K7=En,Y7=W7(K7,"Map"),Ip=Y7,X7=ti,V7=X7(Object,"create"),hf=V7,V1=hf;function Z7(){this.__data__=V1?V1(null):{},this.size=0}var J7=Z7;function Q7(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var tK=Q7,eK=hf,rK="__lodash_hash_undefined__",nK=Object.prototype,aK=nK.hasOwnProperty;function iK(e){var t=this.__data__;if(eK){var r=t[e];return r===rK?void 0:r}return aK.call(t,e)?t[e]:void 0}var sK=iK,oK=hf,uK=Object.prototype,fK=uK.hasOwnProperty;function lK(e){var t=this.__data__;return oK?t[e]!==void 0:fK.call(t,e)}var cK=lK,hK=hf,pK="__lodash_hash_undefined__";function vK(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=hK&&t===void 0?pK:t,this}var dK=vK,gK=J7,_K=tK,mK=sK,$K=cK,bK=dK;function es(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}es.prototype.clear=gK;es.prototype.delete=_K;es.prototype.get=mK;es.prototype.has=$K;es.prototype.set=bK;var yK=es,Z1=yK,wK=cf,SK=Ip;function EK(){this.size=0,this.__data__={hash:new Z1,map:new(SK||wK),string:new Z1}}var CK=EK;function OK(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var AK=OK,TK=AK;function MK(e,t){var r=e.__data__;return TK(t)?r[typeof t=="string"?"string":"hash"]:r.map}var pf=MK,PK=pf;function xK(e){var t=PK(this,e).delete(e);return this.size-=t?1:0,t}var IK=xK,DK=pf;function RK(e){return DK(this,e).get(e)}var BK=RK,LK=pf;function FK(e){return LK(this,e).has(e)}var zK=FK,GK=pf;function NK(e,t){var r=GK(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var jK=NK,qK=CK,UK=IK,kK=BK,HK=zK,WK=jK;function rs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}rs.prototype.clear=qK;rs.prototype.delete=UK;rs.prototype.get=kK;rs.prototype.has=HK;rs.prototype.set=WK;var Dp=rs,KK=cf,YK=Ip,XK=Dp,VK=200;function ZK(e,t){var r=this.__data__;if(r instanceof KK){var n=r.__data__;if(!YK||n.length<VK-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new XK(n)}return r.set(e,t),this.size=r.size,this}var JK=ZK,QK=cf,tY=p7,eY=d7,rY=_7,nY=$7,aY=JK;function ns(e){var t=this.__data__=new QK(e);this.size=t.size}ns.prototype.clear=tY;ns.prototype.delete=eY;ns.prototype.get=rY;ns.prototype.has=nY;ns.prototype.set=aY;var Rp=ns,iY="__lodash_hash_undefined__";function sY(e){return this.__data__.set(e,iY),this}var oY=sY;function uY(e){return this.__data__.has(e)}var fY=uY,lY=Dp,cY=oY,hY=fY;function zu(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new lY;++t<r;)this.add(e[t])}zu.prototype.add=zu.prototype.push=cY;zu.prototype.has=hY;var pY=zu;function vY(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var dY=vY;function gY(e,t){return e.has(t)}var _Y=gY,mY=pY,$Y=dY,bY=_Y,yY=1,wY=2;function SY(e,t,r,n,a,i){var s=r&yY,u=e.length,f=t.length;if(u!=f&&!(s&&f>u))return!1;var c=i.get(e),h=i.get(t);if(c&&h)return c==t&&h==e;var p=-1,v=!0,g=r&wY?new mY:void 0;for(i.set(e,t),i.set(t,e);++p<u;){var _=e[p],m=t[p];if(n)var b=s?n(m,_,p,t,e,i):n(_,m,p,e,t,i);if(b!==void 0){if(b)continue;v=!1;break}if(g){if(!$Y(t,function(y,w){if(!bY(g,w)&&(_===y||a(_,y,r,n,i)))return g.push(w)})){v=!1;break}}else if(!(_===m||a(_,m,r,n,i))){v=!1;break}}return i.delete(e),i.delete(t),v}var Hb=SY,EY=En,CY=EY.Uint8Array,Wb=CY;function OY(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var AY=OY;function TY(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var MY=TY,J1=Ji,Q1=Wb,PY=xp,xY=Hb,IY=AY,DY=MY,RY=1,BY=2,LY="[object Boolean]",FY="[object Date]",zY="[object Error]",GY="[object Map]",NY="[object Number]",jY="[object RegExp]",qY="[object Set]",UY="[object String]",kY="[object Symbol]",HY="[object ArrayBuffer]",WY="[object DataView]",t_=J1?J1.prototype:void 0,hc=t_?t_.valueOf:void 0;function KY(e,t,r,n,a,i,s){switch(r){case WY:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case HY:return!(e.byteLength!=t.byteLength||!i(new Q1(e),new Q1(t)));case LY:case FY:case NY:return PY(+e,+t);case zY:return e.name==t.name&&e.message==t.message;case jY:case UY:return e==t+"";case GY:var u=IY;case qY:var f=n&RY;if(u||(u=DY),e.size!=t.size&&!f)return!1;var c=s.get(e);if(c)return c==t;n|=BY,s.set(e,t);var h=xY(u(e),u(t),n,a,i,s);return s.delete(e),h;case kY:if(hc)return hc.call(e)==hc.call(t)}return!1}var YY=KY;function XY(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var Bp=XY,VY=Bp,ZY=Ir;function JY(e,t,r){var n=t(e);return ZY(e)?n:VY(n,r(e))}var Kb=JY;function QY(){return[]}var Yb=QY,t9=Bb,e9=Yb,r9=Object.prototype,n9=r9.propertyIsEnumerable,e_=Object.getOwnPropertySymbols,a9=e_?function(e){return e==null?[]:(e=Object(e),t9(e_(e),function(t){return n9.call(e,t)}))}:e9,Lp=a9,i9=Kb,s9=Lp,o9=co;function u9(e){return i9(e,o9,s9)}var Xb=u9,r_=Xb,f9=1,l9=Object.prototype,c9=l9.hasOwnProperty;function h9(e,t,r,n,a,i){var s=r&f9,u=r_(e),f=u.length,c=r_(t),h=c.length;if(f!=h&&!s)return!1;for(var p=f;p--;){var v=u[p];if(!(s?v in t:c9.call(t,v)))return!1}var g=i.get(e),_=i.get(t);if(g&&_)return g==t&&_==e;var m=!0;i.set(e,t),i.set(t,e);for(var b=s;++p<f;){v=u[p];var y=e[v],w=t[v];if(n)var C=s?n(w,y,v,t,e,i):n(y,w,v,e,t,i);if(!(C===void 0?y===w||a(y,w,r,n,i):C)){m=!1;break}b||(b=v=="constructor")}if(m&&!b){var T=e.constructor,A=t.constructor;T!=A&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof A=="function"&&A instanceof A)&&(m=!1)}return i.delete(e),i.delete(t),m}var p9=h9,v9=ti,d9=En,g9=v9(d9,"DataView"),_9=g9,m9=ti,$9=En,b9=m9($9,"Promise"),y9=b9,w9=ti,S9=En,E9=w9(S9,"Set"),C9=E9,O9=ti,A9=En,T9=O9(A9,"WeakMap"),M9=T9,Qc=_9,th=Ip,eh=y9,rh=C9,nh=M9,Vb=Qi,as=kb,n_="[object Map]",P9="[object Object]",a_="[object Promise]",i_="[object Set]",s_="[object WeakMap]",o_="[object DataView]",x9=as(Qc),I9=as(th),D9=as(eh),R9=as(rh),B9=as(nh),Ga=Vb;(Qc&&Ga(new Qc(new ArrayBuffer(1)))!=o_||th&&Ga(new th)!=n_||eh&&Ga(eh.resolve())!=a_||rh&&Ga(new rh)!=i_||nh&&Ga(new nh)!=s_)&&(Ga=function(e){var t=Vb(e),r=t==P9?e.constructor:void 0,n=r?as(r):"";if(n)switch(n){case x9:return o_;case I9:return n_;case D9:return a_;case R9:return i_;case B9:return s_}return t});var vf=Ga,pc=Rp,L9=Hb,F9=YY,z9=p9,u_=vf,f_=Ir,l_=Xs.exports,G9=Gb,N9=1,c_="[object Arguments]",h_="[object Array]",du="[object Object]",j9=Object.prototype,p_=j9.hasOwnProperty;function q9(e,t,r,n,a,i){var s=f_(e),u=f_(t),f=s?h_:u_(e),c=u?h_:u_(t);f=f==c_?du:f,c=c==c_?du:c;var h=f==du,p=c==du,v=f==c;if(v&&l_(e)){if(!l_(t))return!1;s=!0,h=!1}if(v&&!h)return i||(i=new pc),s||G9(e)?L9(e,t,r,n,a,i):F9(e,t,f,r,n,a,i);if(!(r&N9)){var g=h&&p_.call(e,"__wrapped__"),_=p&&p_.call(t,"__wrapped__");if(g||_){var m=g?e.value():e,b=_?t.value():t;return i||(i=new pc),a(m,b,r,n,i)}}return v?(i||(i=new pc),z9(e,t,r,n,a,i)):!1}var U9=q9,k9=U9,v_=wa;function Zb(e,t,r,n,a){return e===t?!0:e==null||t==null||!v_(e)&&!v_(t)?e!==e&&t!==t:k9(e,t,r,n,Zb,a)}var Jb=Zb,H9=Rp,W9=Jb,K9=1,Y9=2;function X9(e,t,r,n){var a=r.length,i=a,s=!n;if(e==null)return!i;for(e=Object(e);a--;){var u=r[a];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a<i;){u=r[a];var f=u[0],c=e[f],h=u[1];if(s&&u[2]){if(c===void 0&&!(f in e))return!1}else{var p=new H9;if(n)var v=n(c,h,f,e,t,p);if(!(v===void 0?W9(h,c,K9|Y9,n,p):v))return!1}}return!0}var V9=X9,Z9=Qa;function J9(e){return e===e&&!Z9(e)}var Qb=J9,Q9=Qb,tX=co;function eX(e){for(var t=tX(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,Q9(a)]}return t}var rX=eX;function nX(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var ty=nX,aX=V9,iX=rX,sX=ty;function oX(e){var t=iX(e);return t.length==1&&t[0][2]?sX(t[0][0],t[0][1]):function(r){return r===e||aX(r,e,t)}}var uX=oX,fX=Qi,lX=wa,cX="[object Symbol]";function hX(e){return typeof e=="symbol"||lX(e)&&fX(e)==cX}var Fp=hX,pX=Ir,vX=Fp,dX=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gX=/^\w*$/;function _X(e,t){if(pX(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||vX(e)?!0:gX.test(e)||!dX.test(e)||t!=null&&e in Object(t)}var zp=_X,ey=Dp,mX="Expected a function";function Gp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(mX);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Gp.Cache||ey),r}Gp.Cache=ey;var $X=Gp,bX=$X,yX=500;function wX(e){var t=bX(e,function(n){return r.size===yX&&r.clear(),n}),r=t.cache;return t}var SX=wX,EX=SX,CX=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OX=/\\(\\)?/g,AX=EX(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(CX,function(r,n,a,i){t.push(a?i.replace(OX,"$1"):n||r)}),t}),TX=AX;function MX(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var df=MX,d_=Ji,PX=df,xX=Ir,IX=Fp,DX=1/0,g_=d_?d_.prototype:void 0,__=g_?g_.toString:void 0;function ry(e){if(typeof e=="string")return e;if(xX(e))return PX(e,ry)+"";if(IX(e))return __?__.call(e):"";var t=e+"";return t=="0"&&1/e==-DX?"-0":t}var RX=ry,BX=RX;function LX(e){return e==null?"":BX(e)}var FX=LX,zX=Ir,GX=zp,NX=TX,jX=FX;function qX(e,t){return zX(e)?e:GX(e,t)?[e]:NX(jX(e))}var is=qX,UX=Fp,kX=1/0;function HX(e){if(typeof e=="string"||UX(e))return e;var t=e+"";return t=="0"&&1/e==-kX?"-0":t}var ss=HX,WX=is,KX=ss;function YX(e,t){t=WX(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[KX(t[r++])];return r&&r==n?e:void 0}var gf=YX,XX=gf;function VX(e,t,r){var n=e==null?void 0:XX(e,t);return n===void 0?r:n}var ZX=VX;function JX(e,t){return e!=null&&t in Object(e)}var QX=JX,tV=is,eV=Cp,rV=Ir,nV=Op,aV=Ap,iV=ss;function sV(e,t,r){t=tV(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var s=iV(t[n]);if(!(i=e!=null&&r(e,s)))break;e=e[s]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&aV(a)&&nV(s,a)&&(rV(e)||eV(e)))}var oV=sV,uV=QX,fV=oV;function lV(e,t){return e!=null&&fV(e,t,uV)}var cV=lV,hV=Jb,pV=ZX,vV=cV,dV=zp,gV=Qb,_V=ty,mV=ss,$V=1,bV=2;function yV(e,t){return dV(e)&&gV(t)?_V(mV(e),t):function(r){var n=pV(r,e);return n===void 0&&n===t?vV(r,e):hV(t,n,$V|bV)}}var wV=yV;function SV(e){return e}var Np=SV;function EV(e){return function(t){return t==null?void 0:t[e]}}var CV=EV,OV=gf;function AV(e){return function(t){return OV(t,e)}}var TV=AV,MV=CV,PV=TV,xV=zp,IV=ss;function DV(e){return xV(e)?MV(IV(e)):PV(e)}var RV=DV,BV=uX,LV=wV,FV=Np,zV=Ir,GV=RV;function NV(e){return typeof e=="function"?e:e==null?FV:typeof e=="object"?zV(e)?LV(e[0],e[1]):BV(e):GV(e)}var ho=NV,jV="Expected a function";function qV(e){if(typeof e!="function")throw new TypeError(jV);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var ny=qV,UV=Bb,kV=NW,HV=ho,WV=Ir,KV=ny;function YV(e,t){var r=WV(e)?UV:kV;return r(e,KV(HV(t)))}var ay=YV,XV=jb,VV=XV(Object.getPrototypeOf,Object),jp=VV,ZV=Qi,JV=jp,QV=wa,tZ="[object Object]",eZ=Function.prototype,rZ=Object.prototype,iy=eZ.toString,nZ=rZ.hasOwnProperty,aZ=iy.call(Object);function iZ(e){if(!QV(e)||ZV(e)!=tZ)return!1;var t=JV(e);if(t===null)return!0;var r=nZ.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&iy.call(r)==aZ}var sy=iZ,sZ=ti,oZ=function(){try{var e=sZ(Object,"defineProperty");return e({},"",{}),e}catch{}}(),oy=oZ,m_=oy;function uZ(e,t,r){t=="__proto__"&&m_?m_(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var qp=uZ,fZ=qp,lZ=xp,cZ=Object.prototype,hZ=cZ.hasOwnProperty;function pZ(e,t,r){var n=e[t];(!(hZ.call(e,t)&&lZ(n,r))||r===void 0&&!(t in e))&&fZ(e,t,r)}var Up=pZ,vZ=Up,dZ=is,gZ=Op,$_=Qa,_Z=ss;function mZ(e,t,r,n){if(!$_(e))return e;t=dZ(t,e);for(var a=-1,i=t.length,s=i-1,u=e;u!=null&&++a<i;){var f=_Z(t[a]),c=r;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(a!=s){var h=u[f];c=n?n(h,f,u):void 0,c===void 0&&(c=$_(h)?h:gZ(t[a+1])?[]:{})}vZ(u,f,c),u=u[f]}return e}var $Z=mZ,bZ=gf,yZ=$Z,wZ=is;function SZ(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var s=t[n],u=bZ(e,s);r(u,s)&&yZ(i,wZ(s,e),u)}return i}var EZ=SZ,CZ=Bp,OZ=jp,AZ=Lp,TZ=Yb,MZ=Object.getOwnPropertySymbols,PZ=MZ?function(e){for(var t=[];e;)CZ(t,AZ(e)),e=OZ(e);return t}:TZ,uy=PZ;function xZ(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var IZ=xZ,DZ=Qa,RZ=Mp,BZ=IZ,LZ=Object.prototype,FZ=LZ.hasOwnProperty;function zZ(e){if(!DZ(e))return BZ(e);var t=RZ(e),r=[];for(var n in e)n=="constructor"&&(t||!FZ.call(e,n))||r.push(n);return r}var GZ=zZ,NZ=Nb,jZ=GZ,qZ=ff;function UZ(e){return qZ(e)?NZ(e,!0):jZ(e)}var kp=UZ,kZ=Kb,HZ=uy,WZ=kp;function KZ(e){return kZ(e,WZ,HZ)}var Hp=KZ,YZ=df,XZ=ho,VZ=EZ,ZZ=Hp;function JZ(e,t){if(e==null)return{};var r=YZ(ZZ(e),function(n){return[n]});return t=XZ(t),VZ(e,r,function(n,a){return t(n,a[0])})}var QZ=JZ,tJ=ho,eJ=ny,rJ=QZ;function nJ(e,t){return rJ(e,eJ(tJ(t)))}var fy=nJ;function aJ(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var ly=aJ,iJ=Np;function sJ(e){return typeof e=="function"?e:iJ}var oJ=sJ,uJ=ly,fJ=Pp,lJ=oJ,cJ=Ir;function hJ(e,t){var r=cJ(e)?uJ:fJ;return r(e,lJ(t))}var pJ=hJ,vJ=Pp,dJ=ff;function gJ(e,t){var r=-1,n=dJ(e)?Array(e.length):[];return vJ(e,function(a,i,s){n[++r]=t(a,i,s)}),n}var _J=gJ,mJ=df,$J=ho,bJ=_J,yJ=Ir;function wJ(e,t){var r=yJ(e)?mJ:bJ;return r(e,$J(t))}var SJ=wJ,EJ=qp,CJ=Ub,OJ=ho;function AJ(e,t){var r={};return t=OJ(t),CJ(e,function(n,a,i){EJ(r,a,t(n,a,i))}),r}var TJ=AJ,MJ=Up,PJ=qp;function xJ(e,t,r,n){var a=!r;r||(r={});for(var i=-1,s=t.length;++i<s;){var u=t[i],f=n?n(r[u],e[u],u,r,e):void 0;f===void 0&&(f=e[u]),a?PJ(r,u,f):MJ(r,u,f)}return r}var po=xJ,IJ=po,DJ=co;function RJ(e,t){return e&&IJ(t,DJ(t),e)}var BJ=RJ,LJ=po,FJ=kp;function zJ(e,t){return e&&LJ(t,FJ(t),e)}var GJ=zJ,ah={exports:{}};(function(e,t){var r=En,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i?r.Buffer:void 0,u=s?s.allocUnsafe:void 0;function f(c,h){if(h)return c.slice();var p=c.length,v=u?u(p):new c.constructor(p);return c.copy(v),v}e.exports=f})(ah,ah.exports);function NJ(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var jJ=NJ,qJ=po,UJ=Lp;function kJ(e,t){return qJ(e,UJ(e),t)}var HJ=kJ,WJ=po,KJ=uy;function YJ(e,t){return WJ(e,KJ(e),t)}var XJ=YJ,VJ=Object.prototype,ZJ=VJ.hasOwnProperty;function JJ(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&ZJ.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var QJ=JJ,b_=Wb;function tQ(e){var t=new e.constructor(e.byteLength);return new b_(t).set(new b_(e)),t}var Wp=tQ,eQ=Wp;function rQ(e,t){var r=t?eQ(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var nQ=rQ,aQ=/\w*$/;function iQ(e){var t=new e.constructor(e.source,aQ.exec(e));return t.lastIndex=e.lastIndex,t}var sQ=iQ,y_=Ji,w_=y_?y_.prototype:void 0,S_=w_?w_.valueOf:void 0;function oQ(e){return S_?Object(S_.call(e)):{}}var uQ=oQ,fQ=Wp;function lQ(e,t){var r=t?fQ(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var cQ=lQ,hQ=Wp,pQ=nQ,vQ=sQ,dQ=uQ,gQ=cQ,_Q="[object Boolean]",mQ="[object Date]",$Q="[object Map]",bQ="[object Number]",yQ="[object RegExp]",wQ="[object Set]",SQ="[object String]",EQ="[object Symbol]",CQ="[object ArrayBuffer]",OQ="[object DataView]",AQ="[object Float32Array]",TQ="[object Float64Array]",MQ="[object Int8Array]",PQ="[object Int16Array]",xQ="[object Int32Array]",IQ="[object Uint8Array]",DQ="[object Uint8ClampedArray]",RQ="[object Uint16Array]",BQ="[object Uint32Array]";function LQ(e,t,r){var n=e.constructor;switch(t){case CQ:return hQ(e);case _Q:case mQ:return new n(+e);case OQ:return pQ(e,r);case AQ:case TQ:case MQ:case PQ:case xQ:case IQ:case DQ:case RQ:case BQ:return gQ(e,r);case $Q:return new n;case bQ:case SQ:return new n(e);case yQ:return vQ(e);case wQ:return new n;case EQ:return dQ(e)}}var FQ=LQ,zQ=Qa,E_=Object.create,GQ=function(){function e(){}return function(t){if(!zQ(t))return{};if(E_)return E_(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),NQ=GQ,jQ=NQ,qQ=jp,UQ=Mp;function kQ(e){return typeof e.constructor=="function"&&!UQ(e)?jQ(qQ(e)):{}}var HQ=kQ,WQ=vf,KQ=wa,YQ="[object Map]";function XQ(e){return KQ(e)&&WQ(e)==YQ}var VQ=XQ,ZQ=VQ,JQ=Tp,C_=Vs.exports,O_=C_&&C_.isMap,QQ=O_?JQ(O_):ZQ,ttt=QQ,ett=vf,rtt=wa,ntt="[object Set]";function att(e){return rtt(e)&&ett(e)==ntt}var itt=att,stt=itt,ott=Tp,A_=Vs.exports,T_=A_&&A_.isSet,utt=T_?ott(T_):stt,ftt=utt,ltt=Rp,ctt=ly,htt=Up,ptt=BJ,vtt=GJ,dtt=ah.exports,gtt=jJ,_tt=HJ,mtt=XJ,$tt=Xb,btt=Hp,ytt=vf,wtt=QJ,Stt=FQ,Ett=HQ,Ctt=Ir,Ott=Xs.exports,Att=ttt,Ttt=Qa,Mtt=ftt,Ptt=co,xtt=kp,Itt=1,Dtt=2,Rtt=4,cy="[object Arguments]",Btt="[object Array]",Ltt="[object Boolean]",Ftt="[object Date]",ztt="[object Error]",hy="[object Function]",Gtt="[object GeneratorFunction]",Ntt="[object Map]",jtt="[object Number]",py="[object Object]",qtt="[object RegExp]",Utt="[object Set]",ktt="[object String]",Htt="[object Symbol]",Wtt="[object WeakMap]",Ktt="[object ArrayBuffer]",Ytt="[object DataView]",Xtt="[object Float32Array]",Vtt="[object Float64Array]",Ztt="[object Int8Array]",Jtt="[object Int16Array]",Qtt="[object Int32Array]",tet="[object Uint8Array]",eet="[object Uint8ClampedArray]",ret="[object Uint16Array]",net="[object Uint32Array]",$e={};$e[cy]=$e[Btt]=$e[Ktt]=$e[Ytt]=$e[Ltt]=$e[Ftt]=$e[Xtt]=$e[Vtt]=$e[Ztt]=$e[Jtt]=$e[Qtt]=$e[Ntt]=$e[jtt]=$e[py]=$e[qtt]=$e[Utt]=$e[ktt]=$e[Htt]=$e[tet]=$e[eet]=$e[ret]=$e[net]=!0;$e[ztt]=$e[hy]=$e[Wtt]=!1;function Mu(e,t,r,n,a,i){var s,u=t&Itt,f=t&Dtt,c=t&Rtt;if(r&&(s=a?r(e,n,a,i):r(e)),s!==void 0)return s;if(!Ttt(e))return e;var h=Ctt(e);if(h){if(s=wtt(e),!u)return gtt(e,s)}else{var p=ytt(e),v=p==hy||p==Gtt;if(Ott(e))return dtt(e,u);if(p==py||p==cy||v&&!a){if(s=f||v?{}:Ett(e),!u)return f?mtt(e,vtt(s,e)):_tt(e,ptt(s,e))}else{if(!$e[p])return a?e:{};s=Stt(e,p,u)}}i||(i=new ltt);var g=i.get(e);if(g)return g;i.set(e,s),Mtt(e)?e.forEach(function(b){s.add(Mu(b,t,r,b,e,i))}):Att(e)&&e.forEach(function(b,y){s.set(y,Mu(b,t,r,y,e,i))});var _=c?f?btt:$tt:f?xtt:Ptt,m=h?void 0:_(e);return ctt(m||e,function(b,y){m&&(y=b,b=e[y]),htt(s,y,Mu(b,t,r,y,e,i))}),s}var aet=Mu;function iet(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var set=iet;function oet(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var uet=oet,fet=gf,cet=uet;function het(e,t){return t.length<2?e:fet(e,cet(t,0,-1))}var pet=het,vet=is,det=set,get=pet,_et=ss;function met(e,t){return t=vet(t,e),e=get(e,t),e==null||delete e[_et(det(t))]}var $et=met,bet=sy;function yet(e){return bet(e)?void 0:e}var wet=yet,M_=Ji,Eet=Cp,Cet=Ir,P_=M_?M_.isConcatSpreadable:void 0;function Oet(e){return Cet(e)||Eet(e)||!!(P_&&e&&e[P_])}var Aet=Oet,Tet=Bp,Met=Aet;function vy(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=Met),a||(a=[]);++i<s;){var u=e[i];t>0&&r(u)?t>1?vy(u,t-1,r,n,a):Tet(a,u):n||(a[a.length]=u)}return a}var Pet=vy,xet=Pet;function Iet(e){var t=e==null?0:e.length;return t?xet(e,1):[]}var Det=Iet;function Ret(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Bet=Ret,Let=Bet,x_=Math.max;function Fet(e,t,r){return t=x_(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=x_(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var u=Array(t+1);++a<t;)u[a]=n[a];return u[t]=r(s),Let(e,this,u)}}var zet=Fet;function Get(e){return function(){return e}}var Net=Get,jet=Net,I_=oy,qet=Np,Uet=I_?function(e,t){return I_(e,"toString",{configurable:!0,enumerable:!1,value:jet(t),writable:!0})}:qet,ket=Uet,Het=800,Wet=16,Ket=Date.now;function Yet(e){var t=0,r=0;return function(){var n=Ket(),a=Wet-(n-r);if(r=n,a>0){if(++t>=Het)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Xet=Yet,Vet=ket,Zet=Xet,Jet=Zet(Vet),Qet=Jet,trt=Det,ert=zet,rrt=Qet;function nrt(e){return rrt(ert(e,void 0,trt),e+"")}var art=nrt,irt=df,srt=aet,ort=$et,urt=is,frt=po,lrt=wet,crt=art,hrt=Hp,prt=1,vrt=2,drt=4,grt=crt(function(e,t){var r={};if(e==null)return r;var n=!1;t=irt(t,function(i){return i=urt(i,e),n||(n=i.length>1),i}),frt(e,hrt(e),r),n&&(r=srt(r,prt|vrt|drt,lrt));for(var a=t.length;a--;)ort(r,t[a]);return r}),_rt=grt;function mrt(e){return e}function dy(e){var t=e;return function(){return t}}function gy(e){return Array.isArray(e)?e:ay((""+e).split("."),function(t){return!t})}var he="@@updeep/placeholder";function _f(e,t){var r=e.length;for(r>t&&(r=t);e[r-1]===he;)r-=1;return r}function cn(e){return function t(r){var n=[].slice.call(arguments,1),a=n[0],i=n[1],s=_f(arguments);return s>=1?e(r,a,i):t}}function fn(e){return function t(r,n){var a=[].slice.call(arguments,2),i=a[0],s=a[1],u=_f(arguments,2);if(n===he||i===he||s===he)throw new Error("Can only use placeholder on first argument of this function.");return u>=2?r===he?cn(function(f,c,h){return e(f,n,c,h)}):e(r,n,i,s):u===1?cn(function(f,c,h){return e(r,f,c,h)}):t}}function Is(e){return function t(r,n,a){var i=[].slice.call(arguments,3),s=i[0],u=i[1],f=_f(arguments,3);if(a===he||s===he||u===he)throw new Error("Can only use placeholder on first or second argument of this function.");return f>=3?r===he?n===he?fn(function(c,h,p,v){return e(c,h,a,p,v)}):cn(function(c,h,p){return e(c,n,a,h,p)}):n===he?cn(function(c,h,p){return e(r,c,a,h,p)}):e(r,n,a,s,u):f===2?r===he?fn(function(c,h,p,v){return e(c,n,h,p,v)}):cn(function(c,h,p){return e(r,n,c,h,p)}):f===1?fn(function(c,h,p,v){return e(r,c,h,p,v)}):t}}function $rt(e){return function t(r,n,a,i){var s=[].slice.call(arguments,4),u=s[0],f=s[1],c=_f(arguments,4);if(i===he||u===he||f===he)throw new Error("Can only use placeholder on first, second or third argument of this function.");return c>=4?r===he?n===he?a===he?Is(function(h,p,v,g,_){return e(h,p,v,i,g,_)}):fn(function(h,p,v,g){return e(h,p,a,i,v,g)}):a===he?fn(function(h,p,v,g){return e(h,n,p,i,v,g)}):cn(function(h,p,v){return e(h,n,a,i,p,v)}):n===he?a===he?fn(function(h,p,v,g){return e(r,h,p,i,v,g)}):cn(function(h,p,v){return e(r,h,a,i,p,v)}):a===he?cn(function(h,p,v){return e(r,n,h,i,p,v)}):e(r,n,a,i,u,f):c===3?r===he?n===he?Is(function(h,p,v,g,_){return e(h,p,a,v,g,_)}):fn(function(h,p,v,g){return e(h,n,a,p,v,g)}):n===he?fn(function(h,p,v,g){return e(r,h,a,p,v,g)}):cn(function(h,p,v){return e(r,n,a,h,p,v)}):c===2?r===he?Is(function(h,p,v,g,_){return e(h,n,p,v,g,_)}):fn(function(h,p,v,g){return e(r,n,h,p,v,g)}):c===1?Is(function(h,p,v,g,_){return e(r,h,p,v,g,_)}):t}}function vo(e,t){return t===void 0&&(t=e.length),[e,cn,fn,Is,$rt][t](e)}var brt=vo(function(e,t,r){for(var n=gy(e),a=r,i=0;i<n.length;i+=1){if(a===void 0)return!1;a=a[n[i]]}return typeof t=="function"?t(a):t===a});function _y(){return(_y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function os(e,t){return t===void 0&&(t=e.length),vo(function(){return e.apply(void 0,[].slice.call(arguments))},t)}var ih={__omitted:!0},yrt=dy(ih);function wrt(e){return!Object.keys(e).length}function Srt(e,t){return function(r,n,a){return Object.keys(r).reduce(function(i,s){return n(i,r[s],s)},{})}(e,function(r,n,a){var i=n;return Array.isArray(n)||n===null||typeof n!="object"?typeof n=="function"&&(i=n(t[a])):i=my(n,t[a]),t[a]!==i&&(r[a]=i),r})}function Ert(e,t){var r=[].concat(t);return Object.keys(e).forEach(function(n){r[n]=e[n]}),r}function my(e,t){if(typeof e=="function")return e.apply(void 0,[t].concat([].slice.call(arguments,2)));if(!sy(e))return e;var r=t==null?{}:t,n=Srt(e,r);return wrt(n)?r:Array.isArray(r)?Ert(n,r).filter(function(a){return a!==ih}):fy(_y({},r,n),function(a){return a===ih})}var ei=os(my,2),$y=os(function(e,t,r,n){var a=typeof e=="function"?e(n):e;return ei(a?t:r,n)}),Crt=vo(function(e,t,r){return $y(e,t,function(n){return n},r)}),by=os(function(e,t){var r=typeof e=="function"?e:ei(e),n=(Array.isArray(t)?SJ:TJ)(t,r);return function(a,i){var s=!0;return pJ(i,function(u,f){if(u!==a[f])return s=!1,!1}),s}(t,n)?t:n}),Ort=os(function(e,t){return _rt(t,e)}),Art=os(function(e,t){return fy(t,e)}),Trt=os(function(e,t){var r=ay(t,e);return t.length===r.length?t:r});function Mrt(e,t){var r;return t==="*"?function(n){var a;return Object.prototype.hasOwnProperty.call(n,"*")?ei(((a={})["*"]=e,a),n):by(e,n)}:((r={})[t]=e,r)}var Prt=vo(function(e,t,r){var n=gy(e).reduceRight(Mrt,t);return ei(n,r)}),xrt=vo(function(e,t,r){return ei(t,r===void 0?e:r)}),ee=ei;ee._=he,ee.constant=dy,ee.if=Crt,ee.ifElse=$y,ee.is=brt,ee.freeze=mrt,ee.map=by,ee.omit=Ort,ee.omitBy=Art,ee.reject=Trt,ee.update=ei,ee.updateIn=Prt,ee.omitted=yrt,ee.withDefault=xrt;var Gu="NOT_FOUND";function Irt(e){var t;return{get:function(n){return t&&e(t.key,n)?t.value:Gu},put:function(n,a){t={key:n,value:a}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function Drt(e,t){var r=[];function n(u){var f=r.findIndex(function(h){return t(u,h.key)});if(f>-1){var c=r[f];return f>0&&(r.splice(f,1),r.unshift(c)),c.value}return Gu}function a(u,f){n(u)===Gu&&(r.unshift({key:u,value:f}),r.length>e&&r.pop())}function i(){return r}function s(){r=[]}return{get:n,put:a,getEntries:i,clear:s}}var Rrt=function(t,r){return t===r};function Brt(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;for(var a=r.length,i=0;i<a;i++)if(!e(r[i],n[i]))return!1;return!0}}function Lrt(e,t){var r=typeof t=="object"?t:{equalityCheck:t},n=r.equalityCheck,a=n===void 0?Rrt:n,i=r.maxSize,s=i===void 0?1:i,u=r.resultEqualityCheck,f=Brt(a),c=s===1?Irt(f):Drt(s,f);function h(){var p=c.get(arguments);if(p===Gu){if(p=e.apply(null,arguments),u){var v=c.getEntries(),g=v.find(function(_){return u(_.value,p)});g&&(p=g.value)}c.put(arguments,p)}return p}return h.clearCache=function(){return c.clear()},h}function Frt(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(n){return typeof n=="function"})){var r=t.map(function(n){return typeof n=="function"?"function "+(n.name||"unnamed")+"()":typeof n}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+r+"]")}return t}function zrt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var a=function(){for(var s=arguments.length,u=new Array(s),f=0;f<s;f++)u[f]=arguments[f];var c=0,h,p={memoizeOptions:void 0},v=u.pop();if(typeof v=="object"&&(p=v,v=u.pop()),typeof v!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof v+"]");var g=p,_=g.memoizeOptions,m=_===void 0?r:_,b=Array.isArray(m)?m:[m],y=Frt(u),w=e.apply(void 0,[function(){return c++,v.apply(null,arguments)}].concat(b)),C=e(function(){for(var T=[],A=y.length,x=0;x<A;x++)T.push(y[x].apply(null,arguments));return h=w.apply(null,T),h});return Object.assign(C,{resultFunc:v,memoizedResultFunc:w,dependencies:y,lastResult:function(){return h},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),C};return a}var Kp=zrt(Lrt);const Sa=new Ke({initial:{cost:0,mass:0}}),Yp=new Ke({subduxes:{reqs:Sa},initial:{rating:1,advanced:!1},actions:{setDrive:null,setDriveReqs:null}});Yp.setMutation("setDrive",e=>ee(e));Yp.setMutation("setDriveReqs",e=>ee({reqs:e}));const Grt=e=>Kp([t=>t.reqs.mass,t=>t.propulsion.drive.rating,t=>t.propulsion.drive.advanced],(t,r,n)=>e.dispatch.setDriveReqs(Nrt(t,r,n)));function Nrt(e,t,r=!1){const n=Math.ceil(t*.05*e),a=n*(r?3:2);return{mass:n,cost:a}}const Xp=new Ke({subduxes:{reqs:Sa},initial:{type:"none"},actions:{setFtl:null,setFtlReqs:null}});Xp.setMutation("setFtl",e=>ee({type:e}));Xp.setMutation("setFtlReqs",e=>ee({reqs:e}));function jrt(e,t){if(e==="none")return{cost:0,mass:0};const r=Math.ceil(t/10);return{mass:r,cost:r*(e==="advanced"?3:2)}}const qrt=e=>Kp([t=>t.propulsion.ftl.type,t=>t.reqs.mass],(t,r)=>e.dispatch.setFtlReqs(jrt(t,r))),Urt=new Ke({subduxes:{drive:Yp,ftl:Xp}});var sh={exports:{}};/**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*/(function(e,t){(function(){var r,n="4.17.21",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",u="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",p=1,v=2,g=4,_=1,m=2,b=1,y=2,w=4,C=8,T=16,A=32,x=64,I=128,B=256,P=512,L=30,G="...",K=800,at=16,et=1,rt=2,gt=3,Z=1/0,it=9007199254740991,ct=17976931348623157e292,lt=0/0,dt=4294967295,Ut=dt-1,Lt=dt>>>1,ve=[["ary",I],["bind",b],["bindKey",y],["curry",C],["curryRight",T],["flip",P],["partial",A],["partialRight",x],["rearg",B]],bt="[object Arguments]",Nt="[object Array]",de="[object AsyncFunction]",Jt="[object Boolean]",Tt="[object Date]",Ie="[object DOMException]",Oe="[object Error]",ge="[object Function]",Kt="[object GeneratorFunction]",wt="[object Map]",St="[object Number]",Ae="[object Null]",be="[object Object]",jt="[object Promise]",Ft="[object Proxy]",Le="[object RegExp]",Fe="[object Set]",Kr="[object String]",Dr="[object Symbol]",Kn="[object Undefined]",gr="[object WeakMap]",Ea="[object WeakSet]",Ca="[object ArrayBuffer]",Yn="[object DataView]",Xn="[object Float32Array]",si="[object Float64Array]",fs="[object Int8Array]",oi="[object Int16Array]",Ff="[object Int32Array]",zf="[object Uint8Array]",Gf="[object Uint8ClampedArray]",Nf="[object Uint16Array]",jf="[object Uint32Array]",kw=/\b__p \+= '';/g,Hw=/\b(__p \+=) '' \+/g,Ww=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mv=/&(?:amp|lt|gt|quot|#39);/g,Pv=/[&<>"']/g,Kw=RegExp(Mv.source),Yw=RegExp(Pv.source),Xw=/<%-([\s\S]+?)%>/g,Vw=/<%([\s\S]+?)%>/g,xv=/<%=([\s\S]+?)%>/g,Zw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jw=/^\w*$/,Qw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qf=/[\\^$.*+?()[\]{}|]/g,tS=RegExp(qf.source),Uf=/^\s+/,eS=/\s/,rS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nS=/\{\n\/\* \[wrapped with (.+)\] \*/,aS=/,? & /,iS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,sS=/[()=,{}\[\]\/\s]/,oS=/\\(\\)?/g,uS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Iv=/\w*$/,fS=/^[-+]0x[0-9a-f]+$/i,lS=/^0b[01]+$/i,cS=/^\[object .+?Constructor\]$/,hS=/^0o[0-7]+$/i,pS=/^(?:0|[1-9]\d*)$/,vS=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Eo=/($^)/,dS=/['\n\r\u2028\u2029\\]/g,Co="\\ud800-\\udfff",gS="\\u0300-\\u036f",_S="\\ufe20-\\ufe2f",mS="\\u20d0-\\u20ff",Dv=gS+_S+mS,Rv="\\u2700-\\u27bf",Bv="a-z\\xdf-\\xf6\\xf8-\\xff",$S="\\xac\\xb1\\xd7\\xf7",bS="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yS="\\u2000-\\u206f",wS=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lv="A-Z\\xc0-\\xd6\\xd8-\\xde",Fv="\\ufe0e\\ufe0f",zv=$S+bS+yS+wS,kf="['\u2019]",SS="["+Co+"]",Gv="["+zv+"]",Oo="["+Dv+"]",Nv="\\d+",ES="["+Rv+"]",jv="["+Bv+"]",qv="[^"+Co+zv+Nv+Rv+Bv+Lv+"]",Hf="\\ud83c[\\udffb-\\udfff]",CS="(?:"+Oo+"|"+Hf+")",Uv="[^"+Co+"]",Wf="(?:\\ud83c[\\udde6-\\uddff]){2}",Kf="[\\ud800-\\udbff][\\udc00-\\udfff]",ui="["+Lv+"]",kv="\\u200d",Hv="(?:"+jv+"|"+qv+")",OS="(?:"+ui+"|"+qv+")",Wv="(?:"+kf+"(?:d|ll|m|re|s|t|ve))?",Kv="(?:"+kf+"(?:D|LL|M|RE|S|T|VE))?",Yv=CS+"?",Xv="["+Fv+"]?",AS="(?:"+kv+"(?:"+[Uv,Wf,Kf].join("|")+")"+Xv+Yv+")*",TS="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MS="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vv=Xv+Yv+AS,PS="(?:"+[ES,Wf,Kf].join("|")+")"+Vv,xS="(?:"+[Uv+Oo+"?",Oo,Wf,Kf,SS].join("|")+")",IS=RegExp(kf,"g"),DS=RegExp(Oo,"g"),Yf=RegExp(Hf+"(?="+Hf+")|"+xS+Vv,"g"),RS=RegExp([ui+"?"+jv+"+"+Wv+"(?="+[Gv,ui,"$"].join("|")+")",OS+"+"+Kv+"(?="+[Gv,ui+Hv,"$"].join("|")+")",ui+"?"+Hv+"+"+Wv,ui+"+"+Kv,MS,TS,Nv,PS].join("|"),"g"),BS=RegExp("["+kv+Co+Dv+Fv+"]"),LS=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,FS=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],zS=-1,ye={};ye[Xn]=ye[si]=ye[fs]=ye[oi]=ye[Ff]=ye[zf]=ye[Gf]=ye[Nf]=ye[jf]=!0,ye[bt]=ye[Nt]=ye[Ca]=ye[Jt]=ye[Yn]=ye[Tt]=ye[Oe]=ye[ge]=ye[wt]=ye[St]=ye[be]=ye[Le]=ye[Fe]=ye[Kr]=ye[gr]=!1;var _e={};_e[bt]=_e[Nt]=_e[Ca]=_e[Yn]=_e[Jt]=_e[Tt]=_e[Xn]=_e[si]=_e[fs]=_e[oi]=_e[Ff]=_e[wt]=_e[St]=_e[be]=_e[Le]=_e[Fe]=_e[Kr]=_e[Dr]=_e[zf]=_e[Gf]=_e[Nf]=_e[jf]=!0,_e[Oe]=_e[ge]=_e[gr]=!1;var GS={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},NS={"&":"&","<":"<",">":">",'"':""","'":"'"},jS={"&":"&","<":"<",">":">",""":'"',"'":"'"},qS={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},US=parseFloat,kS=parseInt,Zv=typeof Cr=="object"&&Cr&&Cr.Object===Object&&Cr,HS=typeof self=="object"&&self&&self.Object===Object&&self,Ye=Zv||HS||Function("return this")(),Xf=t&&!t.nodeType&&t,Oa=Xf&&!0&&e&&!e.nodeType&&e,Jv=Oa&&Oa.exports===Xf,Vf=Jv&&Zv.process,Rr=function(){try{var z=Oa&&Oa.require&&Oa.require("util").types;return z||Vf&&Vf.binding&&Vf.binding("util")}catch{}}(),Qv=Rr&&Rr.isArrayBuffer,td=Rr&&Rr.isDate,ed=Rr&&Rr.isMap,rd=Rr&&Rr.isRegExp,nd=Rr&&Rr.isSet,ad=Rr&&Rr.isTypedArray;function _r(z,Y,U){switch(U.length){case 0:return z.call(Y);case 1:return z.call(Y,U[0]);case 2:return z.call(Y,U[0],U[1]);case 3:return z.call(Y,U[0],U[1],U[2])}return z.apply(Y,U)}function WS(z,Y,U,_t){for(var Dt=-1,ie=z==null?0:z.length;++Dt<ie;){var Ue=z[Dt];Y(_t,Ue,U(Ue),z)}return _t}function Br(z,Y){for(var U=-1,_t=z==null?0:z.length;++U<_t&&Y(z[U],U,z)!==!1;);return z}function KS(z,Y){for(var U=z==null?0:z.length;U--&&Y(z[U],U,z)!==!1;);return z}function id(z,Y){for(var U=-1,_t=z==null?0:z.length;++U<_t;)if(!Y(z[U],U,z))return!1;return!0}function Vn(z,Y){for(var U=-1,_t=z==null?0:z.length,Dt=0,ie=[];++U<_t;){var Ue=z[U];Y(Ue,U,z)&&(ie[Dt++]=Ue)}return ie}function Ao(z,Y){var U=z==null?0:z.length;return!!U&&fi(z,Y,0)>-1}function Zf(z,Y,U){for(var _t=-1,Dt=z==null?0:z.length;++_t<Dt;)if(U(Y,z[_t]))return!0;return!1}function Te(z,Y){for(var U=-1,_t=z==null?0:z.length,Dt=Array(_t);++U<_t;)Dt[U]=Y(z[U],U,z);return Dt}function Zn(z,Y){for(var U=-1,_t=Y.length,Dt=z.length;++U<_t;)z[Dt+U]=Y[U];return z}function Jf(z,Y,U,_t){var Dt=-1,ie=z==null?0:z.length;for(_t&&ie&&(U=z[++Dt]);++Dt<ie;)U=Y(U,z[Dt],Dt,z);return U}function YS(z,Y,U,_t){var Dt=z==null?0:z.length;for(_t&&Dt&&(U=z[--Dt]);Dt--;)U=Y(U,z[Dt],Dt,z);return U}function Qf(z,Y){for(var U=-1,_t=z==null?0:z.length;++U<_t;)if(Y(z[U],U,z))return!0;return!1}var XS=tl("length");function VS(z){return z.split("")}function ZS(z){return z.match(iS)||[]}function sd(z,Y,U){var _t;return U(z,function(Dt,ie,Ue){if(Y(Dt,ie,Ue))return _t=ie,!1}),_t}function To(z,Y,U,_t){for(var Dt=z.length,ie=U+(_t?1:-1);_t?ie--:++ie<Dt;)if(Y(z[ie],ie,z))return ie;return-1}function fi(z,Y,U){return Y===Y?fE(z,Y,U):To(z,od,U)}function JS(z,Y,U,_t){for(var Dt=U-1,ie=z.length;++Dt<ie;)if(_t(z[Dt],Y))return Dt;return-1}function od(z){return z!==z}function ud(z,Y){var U=z==null?0:z.length;return U?rl(z,Y)/U:lt}function tl(z){return function(Y){return Y==null?r:Y[z]}}function el(z){return function(Y){return z==null?r:z[Y]}}function fd(z,Y,U,_t,Dt){return Dt(z,function(ie,Ue,le){U=_t?(_t=!1,ie):Y(U,ie,Ue,le)}),U}function QS(z,Y){var U=z.length;for(z.sort(Y);U--;)z[U]=z[U].value;return z}function rl(z,Y){for(var U,_t=-1,Dt=z.length;++_t<Dt;){var ie=Y(z[_t]);ie!==r&&(U=U===r?ie:U+ie)}return U}function nl(z,Y){for(var U=-1,_t=Array(z);++U<z;)_t[U]=Y(U);return _t}function tE(z,Y){return Te(Y,function(U){return[U,z[U]]})}function ld(z){return z&&z.slice(0,vd(z)+1).replace(Uf,"")}function mr(z){return function(Y){return z(Y)}}function al(z,Y){return Te(Y,function(U){return z[U]})}function ls(z,Y){return z.has(Y)}function cd(z,Y){for(var U=-1,_t=z.length;++U<_t&&fi(Y,z[U],0)>-1;);return U}function hd(z,Y){for(var U=z.length;U--&&fi(Y,z[U],0)>-1;);return U}function eE(z,Y){for(var U=z.length,_t=0;U--;)z[U]===Y&&++_t;return _t}var rE=el(GS),nE=el(NS);function aE(z){return"\\"+qS[z]}function iE(z,Y){return z==null?r:z[Y]}function li(z){return BS.test(z)}function sE(z){return LS.test(z)}function oE(z){for(var Y,U=[];!(Y=z.next()).done;)U.push(Y.value);return U}function il(z){var Y=-1,U=Array(z.size);return z.forEach(function(_t,Dt){U[++Y]=[Dt,_t]}),U}function pd(z,Y){return function(U){return z(Y(U))}}function Jn(z,Y){for(var U=-1,_t=z.length,Dt=0,ie=[];++U<_t;){var Ue=z[U];(Ue===Y||Ue===h)&&(z[U]=h,ie[Dt++]=U)}return ie}function Mo(z){var Y=-1,U=Array(z.size);return z.forEach(function(_t){U[++Y]=_t}),U}function uE(z){var Y=-1,U=Array(z.size);return z.forEach(function(_t){U[++Y]=[_t,_t]}),U}function fE(z,Y,U){for(var _t=U-1,Dt=z.length;++_t<Dt;)if(z[_t]===Y)return _t;return-1}function lE(z,Y,U){for(var _t=U+1;_t--;)if(z[_t]===Y)return _t;return _t}function ci(z){return li(z)?hE(z):XS(z)}function Yr(z){return li(z)?pE(z):VS(z)}function vd(z){for(var Y=z.length;Y--&&eS.test(z.charAt(Y)););return Y}var cE=el(jS);function hE(z){for(var Y=Yf.lastIndex=0;Yf.test(z);)++Y;return Y}function pE(z){return z.match(Yf)||[]}function vE(z){return z.match(RS)||[]}var dE=function z(Y){Y=Y==null?Ye:hi.defaults(Ye.Object(),Y,hi.pick(Ye,FS));var U=Y.Array,_t=Y.Date,Dt=Y.Error,ie=Y.Function,Ue=Y.Math,le=Y.Object,sl=Y.RegExp,gE=Y.String,Lr=Y.TypeError,Po=U.prototype,_E=ie.prototype,pi=le.prototype,xo=Y["__core-js_shared__"],Io=_E.toString,fe=pi.hasOwnProperty,mE=0,dd=function(){var o=/[^.]+$/.exec(xo&&xo.keys&&xo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Do=pi.toString,$E=Io.call(le),bE=Ye._,yE=sl("^"+Io.call(fe).replace(qf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ro=Jv?Y.Buffer:r,Qn=Y.Symbol,Bo=Y.Uint8Array,gd=Ro?Ro.allocUnsafe:r,Lo=pd(le.getPrototypeOf,le),_d=le.create,md=pi.propertyIsEnumerable,Fo=Po.splice,$d=Qn?Qn.isConcatSpreadable:r,cs=Qn?Qn.iterator:r,Aa=Qn?Qn.toStringTag:r,zo=function(){try{var o=Ia(le,"defineProperty");return o({},"",{}),o}catch{}}(),wE=Y.clearTimeout!==Ye.clearTimeout&&Y.clearTimeout,SE=_t&&_t.now!==Ye.Date.now&&_t.now,EE=Y.setTimeout!==Ye.setTimeout&&Y.setTimeout,Go=Ue.ceil,No=Ue.floor,ol=le.getOwnPropertySymbols,CE=Ro?Ro.isBuffer:r,bd=Y.isFinite,OE=Po.join,AE=pd(le.keys,le),ke=Ue.max,Qe=Ue.min,TE=_t.now,ME=Y.parseInt,yd=Ue.random,PE=Po.reverse,ul=Ia(Y,"DataView"),hs=Ia(Y,"Map"),fl=Ia(Y,"Promise"),vi=Ia(Y,"Set"),ps=Ia(Y,"WeakMap"),vs=Ia(le,"create"),jo=ps&&new ps,di={},xE=Da(ul),IE=Da(hs),DE=Da(fl),RE=Da(vi),BE=Da(ps),qo=Qn?Qn.prototype:r,ds=qo?qo.valueOf:r,wd=qo?qo.toString:r;function E(o){if(Re(o)&&!zt(o)&&!(o instanceof Xt)){if(o instanceof Fr)return o;if(fe.call(o,"__wrapped__"))return Sg(o)}return new Fr(o)}var gi=function(){function o(){}return function(l){if(!De(l))return{};if(_d)return _d(l);o.prototype=l;var d=new o;return o.prototype=r,d}}();function Uo(){}function Fr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=r}E.templateSettings={escape:Xw,evaluate:Vw,interpolate:xv,variable:"",imports:{_:E}},E.prototype=Uo.prototype,E.prototype.constructor=E,Fr.prototype=gi(Uo.prototype),Fr.prototype.constructor=Fr;function Xt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=dt,this.__views__=[]}function LE(){var o=new Xt(this.__wrapped__);return o.__actions__=ur(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=ur(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=ur(this.__views__),o}function FE(){if(this.__filtered__){var o=new Xt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function zE(){var o=this.__wrapped__.value(),l=this.__dir__,d=zt(o),$=l<0,S=d?o.length:0,O=VC(0,S,this.__views__),D=O.start,R=O.end,N=R-D,J=$?R:D-1,tt=this.__iteratees__,nt=tt.length,vt=0,yt=Qe(N,this.__takeCount__);if(!d||!$&&S==N&&yt==N)return Wd(o,this.__actions__);var Pt=[];t:for(;N--&&vt<yt;){J+=l;for(var kt=-1,xt=o[J];++kt<nt;){var Yt=tt[kt],Qt=Yt.iteratee,yr=Yt.type,ar=Qt(xt);if(yr==rt)xt=ar;else if(!ar){if(yr==et)continue t;break t}}Pt[vt++]=xt}return Pt}Xt.prototype=gi(Uo.prototype),Xt.prototype.constructor=Xt;function Ta(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var $=o[l];this.set($[0],$[1])}}function GE(){this.__data__=vs?vs(null):{},this.size=0}function NE(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function jE(o){var l=this.__data__;if(vs){var d=l[o];return d===f?r:d}return fe.call(l,o)?l[o]:r}function qE(o){var l=this.__data__;return vs?l[o]!==r:fe.call(l,o)}function UE(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=vs&&l===r?f:l,this}Ta.prototype.clear=GE,Ta.prototype.delete=NE,Ta.prototype.get=jE,Ta.prototype.has=qE,Ta.prototype.set=UE;function An(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var $=o[l];this.set($[0],$[1])}}function kE(){this.__data__=[],this.size=0}function HE(o){var l=this.__data__,d=ko(l,o);if(d<0)return!1;var $=l.length-1;return d==$?l.pop():Fo.call(l,d,1),--this.size,!0}function WE(o){var l=this.__data__,d=ko(l,o);return d<0?r:l[d][1]}function KE(o){return ko(this.__data__,o)>-1}function YE(o,l){var d=this.__data__,$=ko(d,o);return $<0?(++this.size,d.push([o,l])):d[$][1]=l,this}An.prototype.clear=kE,An.prototype.delete=HE,An.prototype.get=WE,An.prototype.has=KE,An.prototype.set=YE;function Tn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var $=o[l];this.set($[0],$[1])}}function XE(){this.size=0,this.__data__={hash:new Ta,map:new(hs||An),string:new Ta}}function VE(o){var l=ru(this,o).delete(o);return this.size-=l?1:0,l}function ZE(o){return ru(this,o).get(o)}function JE(o){return ru(this,o).has(o)}function QE(o,l){var d=ru(this,o),$=d.size;return d.set(o,l),this.size+=d.size==$?0:1,this}Tn.prototype.clear=XE,Tn.prototype.delete=VE,Tn.prototype.get=ZE,Tn.prototype.has=JE,Tn.prototype.set=QE;function Ma(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new Tn;++l<d;)this.add(o[l])}function tC(o){return this.__data__.set(o,f),this}function eC(o){return this.__data__.has(o)}Ma.prototype.add=Ma.prototype.push=tC,Ma.prototype.has=eC;function Xr(o){var l=this.__data__=new An(o);this.size=l.size}function rC(){this.__data__=new An,this.size=0}function nC(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function aC(o){return this.__data__.get(o)}function iC(o){return this.__data__.has(o)}function sC(o,l){var d=this.__data__;if(d instanceof An){var $=d.__data__;if(!hs||$.length<a-1)return $.push([o,l]),this.size=++d.size,this;d=this.__data__=new Tn($)}return d.set(o,l),this.size=d.size,this}Xr.prototype.clear=rC,Xr.prototype.delete=nC,Xr.prototype.get=aC,Xr.prototype.has=iC,Xr.prototype.set=sC;function Sd(o,l){var d=zt(o),$=!d&&Ra(o),S=!d&&!$&&aa(o),O=!d&&!$&&!S&&bi(o),D=d||$||S||O,R=D?nl(o.length,gE):[],N=R.length;for(var J in o)(l||fe.call(o,J))&&!(D&&(J=="length"||S&&(J=="offset"||J=="parent")||O&&(J=="buffer"||J=="byteLength"||J=="byteOffset")||In(J,N)))&&R.push(J);return R}function Ed(o){var l=o.length;return l?o[bl(0,l-1)]:r}function oC(o,l){return nu(ur(o),Pa(l,0,o.length))}function uC(o){return nu(ur(o))}function ll(o,l,d){(d!==r&&!Vr(o[l],d)||d===r&&!(l in o))&&Mn(o,l,d)}function gs(o,l,d){var $=o[l];(!(fe.call(o,l)&&Vr($,d))||d===r&&!(l in o))&&Mn(o,l,d)}function ko(o,l){for(var d=o.length;d--;)if(Vr(o[d][0],l))return d;return-1}function fC(o,l,d,$){return ta(o,function(S,O,D){l($,S,d(S),D)}),$}function Cd(o,l){return o&&sn(l,We(l),o)}function lC(o,l){return o&&sn(l,lr(l),o)}function Mn(o,l,d){l=="__proto__"&&zo?zo(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function cl(o,l){for(var d=-1,$=l.length,S=U($),O=o==null;++d<$;)S[d]=O?r:Hl(o,l[d]);return S}function Pa(o,l,d){return o===o&&(d!==r&&(o=o<=d?o:d),l!==r&&(o=o>=l?o:l)),o}function zr(o,l,d,$,S,O){var D,R=l&p,N=l&v,J=l&g;if(d&&(D=S?d(o,$,S,O):d(o)),D!==r)return D;if(!De(o))return o;var tt=zt(o);if(tt){if(D=JC(o),!R)return ur(o,D)}else{var nt=tr(o),vt=nt==ge||nt==Kt;if(aa(o))return Xd(o,R);if(nt==be||nt==bt||vt&&!S){if(D=N||vt?{}:vg(o),!R)return N?jC(o,lC(D,o)):NC(o,Cd(D,o))}else{if(!_e[nt])return S?o:{};D=QC(o,nt,R)}}O||(O=new Xr);var yt=O.get(o);if(yt)return yt;O.set(o,D),Ug(o)?o.forEach(function(xt){D.add(zr(xt,l,d,xt,o,O))}):jg(o)&&o.forEach(function(xt,Yt){D.set(Yt,zr(xt,l,d,Yt,o,O))});var Pt=J?N?xl:Pl:N?lr:We,kt=tt?r:Pt(o);return Br(kt||o,function(xt,Yt){kt&&(Yt=xt,xt=o[Yt]),gs(D,Yt,zr(xt,l,d,Yt,o,O))}),D}function cC(o){var l=We(o);return function(d){return Od(d,o,l)}}function Od(o,l,d){var $=d.length;if(o==null)return!$;for(o=le(o);$--;){var S=d[$],O=l[S],D=o[S];if(D===r&&!(S in o)||!O(D))return!1}return!0}function Ad(o,l,d){if(typeof o!="function")throw new Lr(s);return Ss(function(){o.apply(r,d)},l)}function _s(o,l,d,$){var S=-1,O=Ao,D=!0,R=o.length,N=[],J=l.length;if(!R)return N;d&&(l=Te(l,mr(d))),$?(O=Zf,D=!1):l.length>=a&&(O=ls,D=!1,l=new Ma(l));t:for(;++S<R;){var tt=o[S],nt=d==null?tt:d(tt);if(tt=$||tt!==0?tt:0,D&&nt===nt){for(var vt=J;vt--;)if(l[vt]===nt)continue t;N.push(tt)}else O(l,nt,$)||N.push(tt)}return N}var ta=tg(an),Td=tg(pl,!0);function hC(o,l){var d=!0;return ta(o,function($,S,O){return d=!!l($,S,O),d}),d}function Ho(o,l,d){for(var $=-1,S=o.length;++$<S;){var O=o[$],D=l(O);if(D!=null&&(R===r?D===D&&!br(D):d(D,R)))var R=D,N=O}return N}function pC(o,l,d,$){var S=o.length;for(d=qt(d),d<0&&(d=-d>S?0:S+d),$=$===r||$>S?S:qt($),$<0&&($+=S),$=d>$?0:Hg($);d<$;)o[d++]=l;return o}function Md(o,l){var d=[];return ta(o,function($,S,O){l($,S,O)&&d.push($)}),d}function Xe(o,l,d,$,S){var O=-1,D=o.length;for(d||(d=eO),S||(S=[]);++O<D;){var R=o[O];l>0&&d(R)?l>1?Xe(R,l-1,d,$,S):Zn(S,R):$||(S[S.length]=R)}return S}var hl=eg(),Pd=eg(!0);function an(o,l){return o&&hl(o,l,We)}function pl(o,l){return o&&Pd(o,l,We)}function Wo(o,l){return Vn(l,function(d){return Dn(o[d])})}function xa(o,l){l=ra(l,o);for(var d=0,$=l.length;o!=null&&d<$;)o=o[on(l[d++])];return d&&d==$?o:r}function xd(o,l,d){var $=l(o);return zt(o)?$:Zn($,d(o))}function rr(o){return o==null?o===r?Kn:Ae:Aa&&Aa in le(o)?XC(o):uO(o)}function vl(o,l){return o>l}function vC(o,l){return o!=null&&fe.call(o,l)}function dC(o,l){return o!=null&&l in le(o)}function gC(o,l,d){return o>=Qe(l,d)&&o<ke(l,d)}function dl(o,l,d){for(var $=d?Zf:Ao,S=o[0].length,O=o.length,D=O,R=U(O),N=1/0,J=[];D--;){var tt=o[D];D&&l&&(tt=Te(tt,mr(l))),N=Qe(tt.length,N),R[D]=!d&&(l||S>=120&&tt.length>=120)?new Ma(D&&tt):r}tt=o[0];var nt=-1,vt=R[0];t:for(;++nt<S&&J.length<N;){var yt=tt[nt],Pt=l?l(yt):yt;if(yt=d||yt!==0?yt:0,!(vt?ls(vt,Pt):$(J,Pt,d))){for(D=O;--D;){var kt=R[D];if(!(kt?ls(kt,Pt):$(o[D],Pt,d)))continue t}vt&&vt.push(Pt),J.push(yt)}}return J}function _C(o,l,d,$){return an(o,function(S,O,D){l($,d(S),O,D)}),$}function ms(o,l,d){l=ra(l,o),o=mg(o,l);var $=o==null?o:o[on(Nr(l))];return $==null?r:_r($,o,d)}function Id(o){return Re(o)&&rr(o)==bt}function mC(o){return Re(o)&&rr(o)==Ca}function $C(o){return Re(o)&&rr(o)==Tt}function $s(o,l,d,$,S){return o===l?!0:o==null||l==null||!Re(o)&&!Re(l)?o!==o&&l!==l:bC(o,l,d,$,$s,S)}function bC(o,l,d,$,S,O){var D=zt(o),R=zt(l),N=D?Nt:tr(o),J=R?Nt:tr(l);N=N==bt?be:N,J=J==bt?be:J;var tt=N==be,nt=J==be,vt=N==J;if(vt&&aa(o)){if(!aa(l))return!1;D=!0,tt=!1}if(vt&&!tt)return O||(O=new Xr),D||bi(o)?cg(o,l,d,$,S,O):KC(o,l,N,d,$,S,O);if(!(d&_)){var yt=tt&&fe.call(o,"__wrapped__"),Pt=nt&&fe.call(l,"__wrapped__");if(yt||Pt){var kt=yt?o.value():o,xt=Pt?l.value():l;return O||(O=new Xr),S(kt,xt,d,$,O)}}return vt?(O||(O=new Xr),YC(o,l,d,$,S,O)):!1}function yC(o){return Re(o)&&tr(o)==wt}function gl(o,l,d,$){var S=d.length,O=S,D=!$;if(o==null)return!O;for(o=le(o);S--;){var R=d[S];if(D&&R[2]?R[1]!==o[R[0]]:!(R[0]in o))return!1}for(;++S<O;){R=d[S];var N=R[0],J=o[N],tt=R[1];if(D&&R[2]){if(J===r&&!(N in o))return!1}else{var nt=new Xr;if($)var vt=$(J,tt,N,o,l,nt);if(!(vt===r?$s(tt,J,_|m,$,nt):vt))return!1}}return!0}function Dd(o){if(!De(o)||nO(o))return!1;var l=Dn(o)?yE:cS;return l.test(Da(o))}function wC(o){return Re(o)&&rr(o)==Le}function SC(o){return Re(o)&&tr(o)==Fe}function EC(o){return Re(o)&&fu(o.length)&&!!ye[rr(o)]}function Rd(o){return typeof o=="function"?o:o==null?cr:typeof o=="object"?zt(o)?Fd(o[0],o[1]):Ld(o):r0(o)}function _l(o){if(!ws(o))return AE(o);var l=[];for(var d in le(o))fe.call(o,d)&&d!="constructor"&&l.push(d);return l}function CC(o){if(!De(o))return oO(o);var l=ws(o),d=[];for(var $ in o)$=="constructor"&&(l||!fe.call(o,$))||d.push($);return d}function ml(o,l){return o<l}function Bd(o,l){var d=-1,$=fr(o)?U(o.length):[];return ta(o,function(S,O,D){$[++d]=l(S,O,D)}),$}function Ld(o){var l=Dl(o);return l.length==1&&l[0][2]?gg(l[0][0],l[0][1]):function(d){return d===o||gl(d,o,l)}}function Fd(o,l){return Bl(o)&&dg(l)?gg(on(o),l):function(d){var $=Hl(d,o);return $===r&&$===l?Wl(d,o):$s(l,$,_|m)}}function Ko(o,l,d,$,S){o!==l&&hl(l,function(O,D){if(S||(S=new Xr),De(O))OC(o,l,D,d,Ko,$,S);else{var R=$?$(Fl(o,D),O,D+"",o,l,S):r;R===r&&(R=O),ll(o,D,R)}},lr)}function OC(o,l,d,$,S,O,D){var R=Fl(o,d),N=Fl(l,d),J=D.get(N);if(J){ll(o,d,J);return}var tt=O?O(R,N,d+"",o,l,D):r,nt=tt===r;if(nt){var vt=zt(N),yt=!vt&&aa(N),Pt=!vt&&!yt&&bi(N);tt=N,vt||yt||Pt?zt(R)?tt=R:ze(R)?tt=ur(R):yt?(nt=!1,tt=Xd(N,!0)):Pt?(nt=!1,tt=Vd(N,!0)):tt=[]:Es(N)||Ra(N)?(tt=R,Ra(R)?tt=Wg(R):(!De(R)||Dn(R))&&(tt=vg(N))):nt=!1}nt&&(D.set(N,tt),S(tt,N,$,O,D),D.delete(N)),ll(o,d,tt)}function zd(o,l){var d=o.length;if(!!d)return l+=l<0?d:0,In(l,d)?o[l]:r}function Gd(o,l,d){l.length?l=Te(l,function(O){return zt(O)?function(D){return xa(D,O.length===1?O[0]:O)}:O}):l=[cr];var $=-1;l=Te(l,mr(Mt()));var S=Bd(o,function(O,D,R){var N=Te(l,function(J){return J(O)});return{criteria:N,index:++$,value:O}});return QS(S,function(O,D){return GC(O,D,d)})}function AC(o,l){return Nd(o,l,function(d,$){return Wl(o,$)})}function Nd(o,l,d){for(var $=-1,S=l.length,O={};++$<S;){var D=l[$],R=xa(o,D);d(R,D)&&bs(O,ra(D,o),R)}return O}function TC(o){return function(l){return xa(l,o)}}function $l(o,l,d,$){var S=$?JS:fi,O=-1,D=l.length,R=o;for(o===l&&(l=ur(l)),d&&(R=Te(o,mr(d)));++O<D;)for(var N=0,J=l[O],tt=d?d(J):J;(N=S(R,tt,N,$))>-1;)R!==o&&Fo.call(R,N,1),Fo.call(o,N,1);return o}function jd(o,l){for(var d=o?l.length:0,$=d-1;d--;){var S=l[d];if(d==$||S!==O){var O=S;In(S)?Fo.call(o,S,1):Sl(o,S)}}return o}function bl(o,l){return o+No(yd()*(l-o+1))}function MC(o,l,d,$){for(var S=-1,O=ke(Go((l-o)/(d||1)),0),D=U(O);O--;)D[$?O:++S]=o,o+=d;return D}function yl(o,l){var d="";if(!o||l<1||l>it)return d;do l%2&&(d+=o),l=No(l/2),l&&(o+=o);while(l);return d}function Wt(o,l){return zl(_g(o,l,cr),o+"")}function PC(o){return Ed(yi(o))}function xC(o,l){var d=yi(o);return nu(d,Pa(l,0,d.length))}function bs(o,l,d,$){if(!De(o))return o;l=ra(l,o);for(var S=-1,O=l.length,D=O-1,R=o;R!=null&&++S<O;){var N=on(l[S]),J=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return o;if(S!=D){var tt=R[N];J=$?$(tt,N,R):r,J===r&&(J=De(tt)?tt:In(l[S+1])?[]:{})}gs(R,N,J),R=R[N]}return o}var qd=jo?function(o,l){return jo.set(o,l),o}:cr,IC=zo?function(o,l){return zo(o,"toString",{configurable:!0,enumerable:!1,value:Yl(l),writable:!0})}:cr;function DC(o){return nu(yi(o))}function Gr(o,l,d){var $=-1,S=o.length;l<0&&(l=-l>S?0:S+l),d=d>S?S:d,d<0&&(d+=S),S=l>d?0:d-l>>>0,l>>>=0;for(var O=U(S);++$<S;)O[$]=o[$+l];return O}function RC(o,l){var d;return ta(o,function($,S,O){return d=l($,S,O),!d}),!!d}function Yo(o,l,d){var $=0,S=o==null?$:o.length;if(typeof l=="number"&&l===l&&S<=Lt){for(;$<S;){var O=$+S>>>1,D=o[O];D!==null&&!br(D)&&(d?D<=l:D<l)?$=O+1:S=O}return S}return wl(o,l,cr,d)}function wl(o,l,d,$){var S=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var D=l!==l,R=l===null,N=br(l),J=l===r;S<O;){var tt=No((S+O)/2),nt=d(o[tt]),vt=nt!==r,yt=nt===null,Pt=nt===nt,kt=br(nt);if(D)var xt=$||Pt;else J?xt=Pt&&($||vt):R?xt=Pt&&vt&&($||!yt):N?xt=Pt&&vt&&!yt&&($||!kt):yt||kt?xt=!1:xt=$?nt<=l:nt<l;xt?S=tt+1:O=tt}return Qe(O,Ut)}function Ud(o,l){for(var d=-1,$=o.length,S=0,O=[];++d<$;){var D=o[d],R=l?l(D):D;if(!d||!Vr(R,N)){var N=R;O[S++]=D===0?0:D}}return O}function kd(o){return typeof o=="number"?o:br(o)?lt:+o}function $r(o){if(typeof o=="string")return o;if(zt(o))return Te(o,$r)+"";if(br(o))return wd?wd.call(o):"";var l=o+"";return l=="0"&&1/o==-Z?"-0":l}function ea(o,l,d){var $=-1,S=Ao,O=o.length,D=!0,R=[],N=R;if(d)D=!1,S=Zf;else if(O>=a){var J=l?null:HC(o);if(J)return Mo(J);D=!1,S=ls,N=new Ma}else N=l?[]:R;t:for(;++$<O;){var tt=o[$],nt=l?l(tt):tt;if(tt=d||tt!==0?tt:0,D&&nt===nt){for(var vt=N.length;vt--;)if(N[vt]===nt)continue t;l&&N.push(nt),R.push(tt)}else S(N,nt,d)||(N!==R&&N.push(nt),R.push(tt))}return R}function Sl(o,l){return l=ra(l,o),o=mg(o,l),o==null||delete o[on(Nr(l))]}function Hd(o,l,d,$){return bs(o,l,d(xa(o,l)),$)}function Xo(o,l,d,$){for(var S=o.length,O=$?S:-1;($?O--:++O<S)&&l(o[O],O,o););return d?Gr(o,$?0:O,$?O+1:S):Gr(o,$?O+1:0,$?S:O)}function Wd(o,l){var d=o;return d instanceof Xt&&(d=d.value()),Jf(l,function($,S){return S.func.apply(S.thisArg,Zn([$],S.args))},d)}function El(o,l,d){var $=o.length;if($<2)return $?ea(o[0]):[];for(var S=-1,O=U($);++S<$;)for(var D=o[S],R=-1;++R<$;)R!=S&&(O[S]=_s(O[S]||D,o[R],l,d));return ea(Xe(O,1),l,d)}function Kd(o,l,d){for(var $=-1,S=o.length,O=l.length,D={};++$<S;){var R=$<O?l[$]:r;d(D,o[$],R)}return D}function Cl(o){return ze(o)?o:[]}function Ol(o){return typeof o=="function"?o:cr}function ra(o,l){return zt(o)?o:Bl(o,l)?[o]:wg(oe(o))}var BC=Wt;function na(o,l,d){var $=o.length;return d=d===r?$:d,!l&&d>=$?o:Gr(o,l,d)}var Yd=wE||function(o){return Ye.clearTimeout(o)};function Xd(o,l){if(l)return o.slice();var d=o.length,$=gd?gd(d):new o.constructor(d);return o.copy($),$}function Al(o){var l=new o.constructor(o.byteLength);return new Bo(l).set(new Bo(o)),l}function LC(o,l){var d=l?Al(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function FC(o){var l=new o.constructor(o.source,Iv.exec(o));return l.lastIndex=o.lastIndex,l}function zC(o){return ds?le(ds.call(o)):{}}function Vd(o,l){var d=l?Al(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Zd(o,l){if(o!==l){var d=o!==r,$=o===null,S=o===o,O=br(o),D=l!==r,R=l===null,N=l===l,J=br(l);if(!R&&!J&&!O&&o>l||O&&D&&N&&!R&&!J||$&&D&&N||!d&&N||!S)return 1;if(!$&&!O&&!J&&o<l||J&&d&&S&&!$&&!O||R&&d&&S||!D&&S||!N)return-1}return 0}function GC(o,l,d){for(var $=-1,S=o.criteria,O=l.criteria,D=S.length,R=d.length;++$<D;){var N=Zd(S[$],O[$]);if(N){if($>=R)return N;var J=d[$];return N*(J=="desc"?-1:1)}}return o.index-l.index}function Jd(o,l,d,$){for(var S=-1,O=o.length,D=d.length,R=-1,N=l.length,J=ke(O-D,0),tt=U(N+J),nt=!$;++R<N;)tt[R]=l[R];for(;++S<D;)(nt||S<O)&&(tt[d[S]]=o[S]);for(;J--;)tt[R++]=o[S++];return tt}function Qd(o,l,d,$){for(var S=-1,O=o.length,D=-1,R=d.length,N=-1,J=l.length,tt=ke(O-R,0),nt=U(tt+J),vt=!$;++S<tt;)nt[S]=o[S];for(var yt=S;++N<J;)nt[yt+N]=l[N];for(;++D<R;)(vt||S<O)&&(nt[yt+d[D]]=o[S++]);return nt}function ur(o,l){var d=-1,$=o.length;for(l||(l=U($));++d<$;)l[d]=o[d];return l}function sn(o,l,d,$){var S=!d;d||(d={});for(var O=-1,D=l.length;++O<D;){var R=l[O],N=$?$(d[R],o[R],R,d,o):r;N===r&&(N=o[R]),S?Mn(d,R,N):gs(d,R,N)}return d}function NC(o,l){return sn(o,Rl(o),l)}function jC(o,l){return sn(o,hg(o),l)}function Vo(o,l){return function(d,$){var S=zt(d)?WS:fC,O=l?l():{};return S(d,o,Mt($,2),O)}}function _i(o){return Wt(function(l,d){var $=-1,S=d.length,O=S>1?d[S-1]:r,D=S>2?d[2]:r;for(O=o.length>3&&typeof O=="function"?(S--,O):r,D&&nr(d[0],d[1],D)&&(O=S<3?r:O,S=1),l=le(l);++$<S;){var R=d[$];R&&o(l,R,$,O)}return l})}function tg(o,l){return function(d,$){if(d==null)return d;if(!fr(d))return o(d,$);for(var S=d.length,O=l?S:-1,D=le(d);(l?O--:++O<S)&&$(D[O],O,D)!==!1;);return d}}function eg(o){return function(l,d,$){for(var S=-1,O=le(l),D=$(l),R=D.length;R--;){var N=D[o?R:++S];if(d(O[N],N,O)===!1)break}return l}}function qC(o,l,d){var $=l&b,S=ys(o);function O(){var D=this&&this!==Ye&&this instanceof O?S:o;return D.apply($?d:this,arguments)}return O}function rg(o){return function(l){l=oe(l);var d=li(l)?Yr(l):r,$=d?d[0]:l.charAt(0),S=d?na(d,1).join(""):l.slice(1);return $[o]()+S}}function mi(o){return function(l){return Jf(t0(Qg(l).replace(IS,"")),o,"")}}function ys(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=gi(o.prototype),$=o.apply(d,l);return De($)?$:d}}function UC(o,l,d){var $=ys(o);function S(){for(var O=arguments.length,D=U(O),R=O,N=$i(S);R--;)D[R]=arguments[R];var J=O<3&&D[0]!==N&&D[O-1]!==N?[]:Jn(D,N);if(O-=J.length,O<d)return og(o,l,Zo,S.placeholder,r,D,J,r,r,d-O);var tt=this&&this!==Ye&&this instanceof S?$:o;return _r(tt,this,D)}return S}function ng(o){return function(l,d,$){var S=le(l);if(!fr(l)){var O=Mt(d,3);l=We(l),d=function(R){return O(S[R],R,S)}}var D=o(l,d,$);return D>-1?S[O?l[D]:D]:r}}function ag(o){return xn(function(l){var d=l.length,$=d,S=Fr.prototype.thru;for(o&&l.reverse();$--;){var O=l[$];if(typeof O!="function")throw new Lr(s);if(S&&!D&&eu(O)=="wrapper")var D=new Fr([],!0)}for($=D?$:d;++$<d;){O=l[$];var R=eu(O),N=R=="wrapper"?Il(O):r;N&&Ll(N[0])&&N[1]==(I|C|A|B)&&!N[4].length&&N[9]==1?D=D[eu(N[0])].apply(D,N[3]):D=O.length==1&&Ll(O)?D[R]():D.thru(O)}return function(){var J=arguments,tt=J[0];if(D&&J.length==1&&zt(tt))return D.plant(tt).value();for(var nt=0,vt=d?l[nt].apply(this,J):tt;++nt<d;)vt=l[nt].call(this,vt);return vt}})}function Zo(o,l,d,$,S,O,D,R,N,J){var tt=l&I,nt=l&b,vt=l&y,yt=l&(C|T),Pt=l&P,kt=vt?r:ys(o);function xt(){for(var Yt=arguments.length,Qt=U(Yt),yr=Yt;yr--;)Qt[yr]=arguments[yr];if(yt)var ar=$i(xt),wr=eE(Qt,ar);if($&&(Qt=Jd(Qt,$,S,yt)),O&&(Qt=Qd(Qt,O,D,yt)),Yt-=wr,yt&&Yt<J){var Ge=Jn(Qt,ar);return og(o,l,Zo,xt.placeholder,d,Qt,Ge,R,N,J-Yt)}var Zr=nt?d:this,Bn=vt?Zr[o]:o;return Yt=Qt.length,R?Qt=fO(Qt,R):Pt&&Yt>1&&Qt.reverse(),tt&&N<Yt&&(Qt.length=N),this&&this!==Ye&&this instanceof xt&&(Bn=kt||ys(Bn)),Bn.apply(Zr,Qt)}return xt}function ig(o,l){return function(d,$){return _C(d,o,l($),{})}}function Jo(o,l){return function(d,$){var S;if(d===r&&$===r)return l;if(d!==r&&(S=d),$!==r){if(S===r)return $;typeof d=="string"||typeof $=="string"?(d=$r(d),$=$r($)):(d=kd(d),$=kd($)),S=o(d,$)}return S}}function Tl(o){return xn(function(l){return l=Te(l,mr(Mt())),Wt(function(d){var $=this;return o(l,function(S){return _r(S,$,d)})})})}function Qo(o,l){l=l===r?" ":$r(l);var d=l.length;if(d<2)return d?yl(l,o):l;var $=yl(l,Go(o/ci(l)));return li(l)?na(Yr($),0,o).join(""):$.slice(0,o)}function kC(o,l,d,$){var S=l&b,O=ys(o);function D(){for(var R=-1,N=arguments.length,J=-1,tt=$.length,nt=U(tt+N),vt=this&&this!==Ye&&this instanceof D?O:o;++J<tt;)nt[J]=$[J];for(;N--;)nt[J++]=arguments[++R];return _r(vt,S?d:this,nt)}return D}function sg(o){return function(l,d,$){return $&&typeof $!="number"&&nr(l,d,$)&&(d=$=r),l=Rn(l),d===r?(d=l,l=0):d=Rn(d),$=$===r?l<d?1:-1:Rn($),MC(l,d,$,o)}}function tu(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=jr(l),d=jr(d)),o(l,d)}}function og(o,l,d,$,S,O,D,R,N,J){var tt=l&C,nt=tt?D:r,vt=tt?r:D,yt=tt?O:r,Pt=tt?r:O;l|=tt?A:x,l&=~(tt?x:A),l&w||(l&=~(b|y));var kt=[o,l,S,yt,nt,Pt,vt,R,N,J],xt=d.apply(r,kt);return Ll(o)&&$g(xt,kt),xt.placeholder=$,bg(xt,o,l)}function Ml(o){var l=Ue[o];return function(d,$){if(d=jr(d),$=$==null?0:Qe(qt($),292),$&&bd(d)){var S=(oe(d)+"e").split("e"),O=l(S[0]+"e"+(+S[1]+$));return S=(oe(O)+"e").split("e"),+(S[0]+"e"+(+S[1]-$))}return l(d)}}var HC=vi&&1/Mo(new vi([,-0]))[1]==Z?function(o){return new vi(o)}:Zl;function ug(o){return function(l){var d=tr(l);return d==wt?il(l):d==Fe?uE(l):tE(l,o(l))}}function Pn(o,l,d,$,S,O,D,R){var N=l&y;if(!N&&typeof o!="function")throw new Lr(s);var J=$?$.length:0;if(J||(l&=~(A|x),$=S=r),D=D===r?D:ke(qt(D),0),R=R===r?R:qt(R),J-=S?S.length:0,l&x){var tt=$,nt=S;$=S=r}var vt=N?r:Il(o),yt=[o,l,d,$,S,tt,nt,O,D,R];if(vt&&sO(yt,vt),o=yt[0],l=yt[1],d=yt[2],$=yt[3],S=yt[4],R=yt[9]=yt[9]===r?N?0:o.length:ke(yt[9]-J,0),!R&&l&(C|T)&&(l&=~(C|T)),!l||l==b)var Pt=qC(o,l,d);else l==C||l==T?Pt=UC(o,l,R):(l==A||l==(b|A))&&!S.length?Pt=kC(o,l,d,$):Pt=Zo.apply(r,yt);var kt=vt?qd:$g;return bg(kt(Pt,yt),o,l)}function fg(o,l,d,$){return o===r||Vr(o,pi[d])&&!fe.call($,d)?l:o}function lg(o,l,d,$,S,O){return De(o)&&De(l)&&(O.set(l,o),Ko(o,l,r,lg,O),O.delete(l)),o}function WC(o){return Es(o)?r:o}function cg(o,l,d,$,S,O){var D=d&_,R=o.length,N=l.length;if(R!=N&&!(D&&N>R))return!1;var J=O.get(o),tt=O.get(l);if(J&&tt)return J==l&&tt==o;var nt=-1,vt=!0,yt=d&m?new Ma:r;for(O.set(o,l),O.set(l,o);++nt<R;){var Pt=o[nt],kt=l[nt];if($)var xt=D?$(kt,Pt,nt,l,o,O):$(Pt,kt,nt,o,l,O);if(xt!==r){if(xt)continue;vt=!1;break}if(yt){if(!Qf(l,function(Yt,Qt){if(!ls(yt,Qt)&&(Pt===Yt||S(Pt,Yt,d,$,O)))return yt.push(Qt)})){vt=!1;break}}else if(!(Pt===kt||S(Pt,kt,d,$,O))){vt=!1;break}}return O.delete(o),O.delete(l),vt}function KC(o,l,d,$,S,O,D){switch(d){case Yn:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Ca:return!(o.byteLength!=l.byteLength||!O(new Bo(o),new Bo(l)));case Jt:case Tt:case St:return Vr(+o,+l);case Oe:return o.name==l.name&&o.message==l.message;case Le:case Kr:return o==l+"";case wt:var R=il;case Fe:var N=$&_;if(R||(R=Mo),o.size!=l.size&&!N)return!1;var J=D.get(o);if(J)return J==l;$|=m,D.set(o,l);var tt=cg(R(o),R(l),$,S,O,D);return D.delete(o),tt;case Dr:if(ds)return ds.call(o)==ds.call(l)}return!1}function YC(o,l,d,$,S,O){var D=d&_,R=Pl(o),N=R.length,J=Pl(l),tt=J.length;if(N!=tt&&!D)return!1;for(var nt=N;nt--;){var vt=R[nt];if(!(D?vt in l:fe.call(l,vt)))return!1}var yt=O.get(o),Pt=O.get(l);if(yt&&Pt)return yt==l&&Pt==o;var kt=!0;O.set(o,l),O.set(l,o);for(var xt=D;++nt<N;){vt=R[nt];var Yt=o[vt],Qt=l[vt];if($)var yr=D?$(Qt,Yt,vt,l,o,O):$(Yt,Qt,vt,o,l,O);if(!(yr===r?Yt===Qt||S(Yt,Qt,d,$,O):yr)){kt=!1;break}xt||(xt=vt=="constructor")}if(kt&&!xt){var ar=o.constructor,wr=l.constructor;ar!=wr&&"constructor"in o&&"constructor"in l&&!(typeof ar=="function"&&ar instanceof ar&&typeof wr=="function"&&wr instanceof wr)&&(kt=!1)}return O.delete(o),O.delete(l),kt}function xn(o){return zl(_g(o,r,Og),o+"")}function Pl(o){return xd(o,We,Rl)}function xl(o){return xd(o,lr,hg)}var Il=jo?function(o){return jo.get(o)}:Zl;function eu(o){for(var l=o.name+"",d=di[l],$=fe.call(di,l)?d.length:0;$--;){var S=d[$],O=S.func;if(O==null||O==o)return S.name}return l}function $i(o){var l=fe.call(E,"placeholder")?E:o;return l.placeholder}function Mt(){var o=E.iteratee||Xl;return o=o===Xl?Rd:o,arguments.length?o(arguments[0],arguments[1]):o}function ru(o,l){var d=o.__data__;return rO(l)?d[typeof l=="string"?"string":"hash"]:d.map}function Dl(o){for(var l=We(o),d=l.length;d--;){var $=l[d],S=o[$];l[d]=[$,S,dg(S)]}return l}function Ia(o,l){var d=iE(o,l);return Dd(d)?d:r}function XC(o){var l=fe.call(o,Aa),d=o[Aa];try{o[Aa]=r;var $=!0}catch{}var S=Do.call(o);return $&&(l?o[Aa]=d:delete o[Aa]),S}var Rl=ol?function(o){return o==null?[]:(o=le(o),Vn(ol(o),function(l){return md.call(o,l)}))}:Jl,hg=ol?function(o){for(var l=[];o;)Zn(l,Rl(o)),o=Lo(o);return l}:Jl,tr=rr;(ul&&tr(new ul(new ArrayBuffer(1)))!=Yn||hs&&tr(new hs)!=wt||fl&&tr(fl.resolve())!=jt||vi&&tr(new vi)!=Fe||ps&&tr(new ps)!=gr)&&(tr=function(o){var l=rr(o),d=l==be?o.constructor:r,$=d?Da(d):"";if($)switch($){case xE:return Yn;case IE:return wt;case DE:return jt;case RE:return Fe;case BE:return gr}return l});function VC(o,l,d){for(var $=-1,S=d.length;++$<S;){var O=d[$],D=O.size;switch(O.type){case"drop":o+=D;break;case"dropRight":l-=D;break;case"take":l=Qe(l,o+D);break;case"takeRight":o=ke(o,l-D);break}}return{start:o,end:l}}function ZC(o){var l=o.match(nS);return l?l[1].split(aS):[]}function pg(o,l,d){l=ra(l,o);for(var $=-1,S=l.length,O=!1;++$<S;){var D=on(l[$]);if(!(O=o!=null&&d(o,D)))break;o=o[D]}return O||++$!=S?O:(S=o==null?0:o.length,!!S&&fu(S)&&In(D,S)&&(zt(o)||Ra(o)))}function JC(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&fe.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function vg(o){return typeof o.constructor=="function"&&!ws(o)?gi(Lo(o)):{}}function QC(o,l,d){var $=o.constructor;switch(l){case Ca:return Al(o);case Jt:case Tt:return new $(+o);case Yn:return LC(o,d);case Xn:case si:case fs:case oi:case Ff:case zf:case Gf:case Nf:case jf:return Vd(o,d);case wt:return new $;case St:case Kr:return new $(o);case Le:return FC(o);case Fe:return new $;case Dr:return zC(o)}}function tO(o,l){var d=l.length;if(!d)return o;var $=d-1;return l[$]=(d>1?"& ":"")+l[$],l=l.join(d>2?", ":" "),o.replace(rS,`{
|
|
/* [wrapped with `+l+`] */
|
|
`)}function eO(o){return zt(o)||Ra(o)||!!($d&&o&&o[$d])}function In(o,l){var d=typeof o;return l=l==null?it:l,!!l&&(d=="number"||d!="symbol"&&pS.test(o))&&o>-1&&o%1==0&&o<l}function nr(o,l,d){if(!De(d))return!1;var $=typeof l;return($=="number"?fr(d)&&In(l,d.length):$=="string"&&l in d)?Vr(d[l],o):!1}function Bl(o,l){if(zt(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||br(o)?!0:Jw.test(o)||!Zw.test(o)||l!=null&&o in le(l)}function rO(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Ll(o){var l=eu(o),d=E[l];if(typeof d!="function"||!(l in Xt.prototype))return!1;if(o===d)return!0;var $=Il(d);return!!$&&o===$[0]}function nO(o){return!!dd&&dd in o}var aO=xo?Dn:Ql;function ws(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||pi;return o===d}function dg(o){return o===o&&!De(o)}function gg(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==r||o in le(d))}}function iO(o){var l=ou(o,function($){return d.size===c&&d.clear(),$}),d=l.cache;return l}function sO(o,l){var d=o[1],$=l[1],S=d|$,O=S<(b|y|I),D=$==I&&d==C||$==I&&d==B&&o[7].length<=l[8]||$==(I|B)&&l[7].length<=l[8]&&d==C;if(!(O||D))return o;$&b&&(o[2]=l[2],S|=d&b?0:w);var R=l[3];if(R){var N=o[3];o[3]=N?Jd(N,R,l[4]):R,o[4]=N?Jn(o[3],h):l[4]}return R=l[5],R&&(N=o[5],o[5]=N?Qd(N,R,l[6]):R,o[6]=N?Jn(o[5],h):l[6]),R=l[7],R&&(o[7]=R),$&I&&(o[8]=o[8]==null?l[8]:Qe(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=S,o}function oO(o){var l=[];if(o!=null)for(var d in le(o))l.push(d);return l}function uO(o){return Do.call(o)}function _g(o,l,d){return l=ke(l===r?o.length-1:l,0),function(){for(var $=arguments,S=-1,O=ke($.length-l,0),D=U(O);++S<O;)D[S]=$[l+S];S=-1;for(var R=U(l+1);++S<l;)R[S]=$[S];return R[l]=d(D),_r(o,this,R)}}function mg(o,l){return l.length<2?o:xa(o,Gr(l,0,-1))}function fO(o,l){for(var d=o.length,$=Qe(l.length,d),S=ur(o);$--;){var O=l[$];o[$]=In(O,d)?S[O]:r}return o}function Fl(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var $g=yg(qd),Ss=EE||function(o,l){return Ye.setTimeout(o,l)},zl=yg(IC);function bg(o,l,d){var $=l+"";return zl(o,tO($,lO(ZC($),d)))}function yg(o){var l=0,d=0;return function(){var $=TE(),S=at-($-d);if(d=$,S>0){if(++l>=K)return arguments[0]}else l=0;return o.apply(r,arguments)}}function nu(o,l){var d=-1,$=o.length,S=$-1;for(l=l===r?$:l;++d<l;){var O=bl(d,S),D=o[O];o[O]=o[d],o[d]=D}return o.length=l,o}var wg=iO(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(Qw,function(d,$,S,O){l.push(S?O.replace(oS,"$1"):$||d)}),l});function on(o){if(typeof o=="string"||br(o))return o;var l=o+"";return l=="0"&&1/o==-Z?"-0":l}function Da(o){if(o!=null){try{return Io.call(o)}catch{}try{return o+""}catch{}}return""}function lO(o,l){return Br(ve,function(d){var $="_."+d[0];l&d[1]&&!Ao(o,$)&&o.push($)}),o.sort()}function Sg(o){if(o instanceof Xt)return o.clone();var l=new Fr(o.__wrapped__,o.__chain__);return l.__actions__=ur(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function cO(o,l,d){(d?nr(o,l,d):l===r)?l=1:l=ke(qt(l),0);var $=o==null?0:o.length;if(!$||l<1)return[];for(var S=0,O=0,D=U(Go($/l));S<$;)D[O++]=Gr(o,S,S+=l);return D}function hO(o){for(var l=-1,d=o==null?0:o.length,$=0,S=[];++l<d;){var O=o[l];O&&(S[$++]=O)}return S}function pO(){var o=arguments.length;if(!o)return[];for(var l=U(o-1),d=arguments[0],$=o;$--;)l[$-1]=arguments[$];return Zn(zt(d)?ur(d):[d],Xe(l,1))}var vO=Wt(function(o,l){return ze(o)?_s(o,Xe(l,1,ze,!0)):[]}),dO=Wt(function(o,l){var d=Nr(l);return ze(d)&&(d=r),ze(o)?_s(o,Xe(l,1,ze,!0),Mt(d,2)):[]}),gO=Wt(function(o,l){var d=Nr(l);return ze(d)&&(d=r),ze(o)?_s(o,Xe(l,1,ze,!0),r,d):[]});function _O(o,l,d){var $=o==null?0:o.length;return $?(l=d||l===r?1:qt(l),Gr(o,l<0?0:l,$)):[]}function mO(o,l,d){var $=o==null?0:o.length;return $?(l=d||l===r?1:qt(l),l=$-l,Gr(o,0,l<0?0:l)):[]}function $O(o,l){return o&&o.length?Xo(o,Mt(l,3),!0,!0):[]}function bO(o,l){return o&&o.length?Xo(o,Mt(l,3),!0):[]}function yO(o,l,d,$){var S=o==null?0:o.length;return S?(d&&typeof d!="number"&&nr(o,l,d)&&(d=0,$=S),pC(o,l,d,$)):[]}function Eg(o,l,d){var $=o==null?0:o.length;if(!$)return-1;var S=d==null?0:qt(d);return S<0&&(S=ke($+S,0)),To(o,Mt(l,3),S)}function Cg(o,l,d){var $=o==null?0:o.length;if(!$)return-1;var S=$-1;return d!==r&&(S=qt(d),S=d<0?ke($+S,0):Qe(S,$-1)),To(o,Mt(l,3),S,!0)}function Og(o){var l=o==null?0:o.length;return l?Xe(o,1):[]}function wO(o){var l=o==null?0:o.length;return l?Xe(o,Z):[]}function SO(o,l){var d=o==null?0:o.length;return d?(l=l===r?1:qt(l),Xe(o,l)):[]}function EO(o){for(var l=-1,d=o==null?0:o.length,$={};++l<d;){var S=o[l];$[S[0]]=S[1]}return $}function Ag(o){return o&&o.length?o[0]:r}function CO(o,l,d){var $=o==null?0:o.length;if(!$)return-1;var S=d==null?0:qt(d);return S<0&&(S=ke($+S,0)),fi(o,l,S)}function OO(o){var l=o==null?0:o.length;return l?Gr(o,0,-1):[]}var AO=Wt(function(o){var l=Te(o,Cl);return l.length&&l[0]===o[0]?dl(l):[]}),TO=Wt(function(o){var l=Nr(o),d=Te(o,Cl);return l===Nr(d)?l=r:d.pop(),d.length&&d[0]===o[0]?dl(d,Mt(l,2)):[]}),MO=Wt(function(o){var l=Nr(o),d=Te(o,Cl);return l=typeof l=="function"?l:r,l&&d.pop(),d.length&&d[0]===o[0]?dl(d,r,l):[]});function PO(o,l){return o==null?"":OE.call(o,l)}function Nr(o){var l=o==null?0:o.length;return l?o[l-1]:r}function xO(o,l,d){var $=o==null?0:o.length;if(!$)return-1;var S=$;return d!==r&&(S=qt(d),S=S<0?ke($+S,0):Qe(S,$-1)),l===l?lE(o,l,S):To(o,od,S,!0)}function IO(o,l){return o&&o.length?zd(o,qt(l)):r}var DO=Wt(Tg);function Tg(o,l){return o&&o.length&&l&&l.length?$l(o,l):o}function RO(o,l,d){return o&&o.length&&l&&l.length?$l(o,l,Mt(d,2)):o}function BO(o,l,d){return o&&o.length&&l&&l.length?$l(o,l,r,d):o}var LO=xn(function(o,l){var d=o==null?0:o.length,$=cl(o,l);return jd(o,Te(l,function(S){return In(S,d)?+S:S}).sort(Zd)),$});function FO(o,l){var d=[];if(!(o&&o.length))return d;var $=-1,S=[],O=o.length;for(l=Mt(l,3);++$<O;){var D=o[$];l(D,$,o)&&(d.push(D),S.push($))}return jd(o,S),d}function Gl(o){return o==null?o:PE.call(o)}function zO(o,l,d){var $=o==null?0:o.length;return $?(d&&typeof d!="number"&&nr(o,l,d)?(l=0,d=$):(l=l==null?0:qt(l),d=d===r?$:qt(d)),Gr(o,l,d)):[]}function GO(o,l){return Yo(o,l)}function NO(o,l,d){return wl(o,l,Mt(d,2))}function jO(o,l){var d=o==null?0:o.length;if(d){var $=Yo(o,l);if($<d&&Vr(o[$],l))return $}return-1}function qO(o,l){return Yo(o,l,!0)}function UO(o,l,d){return wl(o,l,Mt(d,2),!0)}function kO(o,l){var d=o==null?0:o.length;if(d){var $=Yo(o,l,!0)-1;if(Vr(o[$],l))return $}return-1}function HO(o){return o&&o.length?Ud(o):[]}function WO(o,l){return o&&o.length?Ud(o,Mt(l,2)):[]}function KO(o){var l=o==null?0:o.length;return l?Gr(o,1,l):[]}function YO(o,l,d){return o&&o.length?(l=d||l===r?1:qt(l),Gr(o,0,l<0?0:l)):[]}function XO(o,l,d){var $=o==null?0:o.length;return $?(l=d||l===r?1:qt(l),l=$-l,Gr(o,l<0?0:l,$)):[]}function VO(o,l){return o&&o.length?Xo(o,Mt(l,3),!1,!0):[]}function ZO(o,l){return o&&o.length?Xo(o,Mt(l,3)):[]}var JO=Wt(function(o){return ea(Xe(o,1,ze,!0))}),QO=Wt(function(o){var l=Nr(o);return ze(l)&&(l=r),ea(Xe(o,1,ze,!0),Mt(l,2))}),tA=Wt(function(o){var l=Nr(o);return l=typeof l=="function"?l:r,ea(Xe(o,1,ze,!0),r,l)});function eA(o){return o&&o.length?ea(o):[]}function rA(o,l){return o&&o.length?ea(o,Mt(l,2)):[]}function nA(o,l){return l=typeof l=="function"?l:r,o&&o.length?ea(o,r,l):[]}function Nl(o){if(!(o&&o.length))return[];var l=0;return o=Vn(o,function(d){if(ze(d))return l=ke(d.length,l),!0}),nl(l,function(d){return Te(o,tl(d))})}function Mg(o,l){if(!(o&&o.length))return[];var d=Nl(o);return l==null?d:Te(d,function($){return _r(l,r,$)})}var aA=Wt(function(o,l){return ze(o)?_s(o,l):[]}),iA=Wt(function(o){return El(Vn(o,ze))}),sA=Wt(function(o){var l=Nr(o);return ze(l)&&(l=r),El(Vn(o,ze),Mt(l,2))}),oA=Wt(function(o){var l=Nr(o);return l=typeof l=="function"?l:r,El(Vn(o,ze),r,l)}),uA=Wt(Nl);function fA(o,l){return Kd(o||[],l||[],gs)}function lA(o,l){return Kd(o||[],l||[],bs)}var cA=Wt(function(o){var l=o.length,d=l>1?o[l-1]:r;return d=typeof d=="function"?(o.pop(),d):r,Mg(o,d)});function Pg(o){var l=E(o);return l.__chain__=!0,l}function hA(o,l){return l(o),o}function au(o,l){return l(o)}var pA=xn(function(o){var l=o.length,d=l?o[0]:0,$=this.__wrapped__,S=function(O){return cl(O,o)};return l>1||this.__actions__.length||!($ instanceof Xt)||!In(d)?this.thru(S):($=$.slice(d,+d+(l?1:0)),$.__actions__.push({func:au,args:[S],thisArg:r}),new Fr($,this.__chain__).thru(function(O){return l&&!O.length&&O.push(r),O}))});function vA(){return Pg(this)}function dA(){return new Fr(this.value(),this.__chain__)}function gA(){this.__values__===r&&(this.__values__=kg(this.value()));var o=this.__index__>=this.__values__.length,l=o?r:this.__values__[this.__index__++];return{done:o,value:l}}function _A(){return this}function mA(o){for(var l,d=this;d instanceof Uo;){var $=Sg(d);$.__index__=0,$.__values__=r,l?S.__wrapped__=$:l=$;var S=$;d=d.__wrapped__}return S.__wrapped__=o,l}function $A(){var o=this.__wrapped__;if(o instanceof Xt){var l=o;return this.__actions__.length&&(l=new Xt(this)),l=l.reverse(),l.__actions__.push({func:au,args:[Gl],thisArg:r}),new Fr(l,this.__chain__)}return this.thru(Gl)}function bA(){return Wd(this.__wrapped__,this.__actions__)}var yA=Vo(function(o,l,d){fe.call(o,d)?++o[d]:Mn(o,d,1)});function wA(o,l,d){var $=zt(o)?id:hC;return d&&nr(o,l,d)&&(l=r),$(o,Mt(l,3))}function SA(o,l){var d=zt(o)?Vn:Md;return d(o,Mt(l,3))}var EA=ng(Eg),CA=ng(Cg);function OA(o,l){return Xe(iu(o,l),1)}function AA(o,l){return Xe(iu(o,l),Z)}function TA(o,l,d){return d=d===r?1:qt(d),Xe(iu(o,l),d)}function xg(o,l){var d=zt(o)?Br:ta;return d(o,Mt(l,3))}function Ig(o,l){var d=zt(o)?KS:Td;return d(o,Mt(l,3))}var MA=Vo(function(o,l,d){fe.call(o,d)?o[d].push(l):Mn(o,d,[l])});function PA(o,l,d,$){o=fr(o)?o:yi(o),d=d&&!$?qt(d):0;var S=o.length;return d<0&&(d=ke(S+d,0)),lu(o)?d<=S&&o.indexOf(l,d)>-1:!!S&&fi(o,l,d)>-1}var xA=Wt(function(o,l,d){var $=-1,S=typeof l=="function",O=fr(o)?U(o.length):[];return ta(o,function(D){O[++$]=S?_r(l,D,d):ms(D,l,d)}),O}),IA=Vo(function(o,l,d){Mn(o,d,l)});function iu(o,l){var d=zt(o)?Te:Bd;return d(o,Mt(l,3))}function DA(o,l,d,$){return o==null?[]:(zt(l)||(l=l==null?[]:[l]),d=$?r:d,zt(d)||(d=d==null?[]:[d]),Gd(o,l,d))}var RA=Vo(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function BA(o,l,d){var $=zt(o)?Jf:fd,S=arguments.length<3;return $(o,Mt(l,4),d,S,ta)}function LA(o,l,d){var $=zt(o)?YS:fd,S=arguments.length<3;return $(o,Mt(l,4),d,S,Td)}function FA(o,l){var d=zt(o)?Vn:Md;return d(o,uu(Mt(l,3)))}function zA(o){var l=zt(o)?Ed:PC;return l(o)}function GA(o,l,d){(d?nr(o,l,d):l===r)?l=1:l=qt(l);var $=zt(o)?oC:xC;return $(o,l)}function NA(o){var l=zt(o)?uC:DC;return l(o)}function jA(o){if(o==null)return 0;if(fr(o))return lu(o)?ci(o):o.length;var l=tr(o);return l==wt||l==Fe?o.size:_l(o).length}function qA(o,l,d){var $=zt(o)?Qf:RC;return d&&nr(o,l,d)&&(l=r),$(o,Mt(l,3))}var UA=Wt(function(o,l){if(o==null)return[];var d=l.length;return d>1&&nr(o,l[0],l[1])?l=[]:d>2&&nr(l[0],l[1],l[2])&&(l=[l[0]]),Gd(o,Xe(l,1),[])}),su=SE||function(){return Ye.Date.now()};function kA(o,l){if(typeof l!="function")throw new Lr(s);return o=qt(o),function(){if(--o<1)return l.apply(this,arguments)}}function Dg(o,l,d){return l=d?r:l,l=o&&l==null?o.length:l,Pn(o,I,r,r,r,r,l)}function Rg(o,l){var d;if(typeof l!="function")throw new Lr(s);return o=qt(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=r),d}}var jl=Wt(function(o,l,d){var $=b;if(d.length){var S=Jn(d,$i(jl));$|=A}return Pn(o,$,l,d,S)}),Bg=Wt(function(o,l,d){var $=b|y;if(d.length){var S=Jn(d,$i(Bg));$|=A}return Pn(l,$,o,d,S)});function Lg(o,l,d){l=d?r:l;var $=Pn(o,C,r,r,r,r,r,l);return $.placeholder=Lg.placeholder,$}function Fg(o,l,d){l=d?r:l;var $=Pn(o,T,r,r,r,r,r,l);return $.placeholder=Fg.placeholder,$}function zg(o,l,d){var $,S,O,D,R,N,J=0,tt=!1,nt=!1,vt=!0;if(typeof o!="function")throw new Lr(s);l=jr(l)||0,De(d)&&(tt=!!d.leading,nt="maxWait"in d,O=nt?ke(jr(d.maxWait)||0,l):O,vt="trailing"in d?!!d.trailing:vt);function yt(Ge){var Zr=$,Bn=S;return $=S=r,J=Ge,D=o.apply(Bn,Zr),D}function Pt(Ge){return J=Ge,R=Ss(Yt,l),tt?yt(Ge):D}function kt(Ge){var Zr=Ge-N,Bn=Ge-J,n0=l-Zr;return nt?Qe(n0,O-Bn):n0}function xt(Ge){var Zr=Ge-N,Bn=Ge-J;return N===r||Zr>=l||Zr<0||nt&&Bn>=O}function Yt(){var Ge=su();if(xt(Ge))return Qt(Ge);R=Ss(Yt,kt(Ge))}function Qt(Ge){return R=r,vt&&$?yt(Ge):($=S=r,D)}function yr(){R!==r&&Yd(R),J=0,$=N=S=R=r}function ar(){return R===r?D:Qt(su())}function wr(){var Ge=su(),Zr=xt(Ge);if($=arguments,S=this,N=Ge,Zr){if(R===r)return Pt(N);if(nt)return Yd(R),R=Ss(Yt,l),yt(N)}return R===r&&(R=Ss(Yt,l)),D}return wr.cancel=yr,wr.flush=ar,wr}var HA=Wt(function(o,l){return Ad(o,1,l)}),WA=Wt(function(o,l,d){return Ad(o,jr(l)||0,d)});function KA(o){return Pn(o,P)}function ou(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new Lr(s);var d=function(){var $=arguments,S=l?l.apply(this,$):$[0],O=d.cache;if(O.has(S))return O.get(S);var D=o.apply(this,$);return d.cache=O.set(S,D)||O,D};return d.cache=new(ou.Cache||Tn),d}ou.Cache=Tn;function uu(o){if(typeof o!="function")throw new Lr(s);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function YA(o){return Rg(2,o)}var XA=BC(function(o,l){l=l.length==1&&zt(l[0])?Te(l[0],mr(Mt())):Te(Xe(l,1),mr(Mt()));var d=l.length;return Wt(function($){for(var S=-1,O=Qe($.length,d);++S<O;)$[S]=l[S].call(this,$[S]);return _r(o,this,$)})}),ql=Wt(function(o,l){var d=Jn(l,$i(ql));return Pn(o,A,r,l,d)}),Gg=Wt(function(o,l){var d=Jn(l,$i(Gg));return Pn(o,x,r,l,d)}),VA=xn(function(o,l){return Pn(o,B,r,r,r,l)});function ZA(o,l){if(typeof o!="function")throw new Lr(s);return l=l===r?l:qt(l),Wt(o,l)}function JA(o,l){if(typeof o!="function")throw new Lr(s);return l=l==null?0:ke(qt(l),0),Wt(function(d){var $=d[l],S=na(d,0,l);return $&&Zn(S,$),_r(o,this,S)})}function QA(o,l,d){var $=!0,S=!0;if(typeof o!="function")throw new Lr(s);return De(d)&&($="leading"in d?!!d.leading:$,S="trailing"in d?!!d.trailing:S),zg(o,l,{leading:$,maxWait:l,trailing:S})}function t2(o){return Dg(o,1)}function e2(o,l){return ql(Ol(l),o)}function r2(){if(!arguments.length)return[];var o=arguments[0];return zt(o)?o:[o]}function n2(o){return zr(o,g)}function a2(o,l){return l=typeof l=="function"?l:r,zr(o,g,l)}function i2(o){return zr(o,p|g)}function s2(o,l){return l=typeof l=="function"?l:r,zr(o,p|g,l)}function o2(o,l){return l==null||Od(o,l,We(l))}function Vr(o,l){return o===l||o!==o&&l!==l}var u2=tu(vl),f2=tu(function(o,l){return o>=l}),Ra=Id(function(){return arguments}())?Id:function(o){return Re(o)&&fe.call(o,"callee")&&!md.call(o,"callee")},zt=U.isArray,l2=Qv?mr(Qv):mC;function fr(o){return o!=null&&fu(o.length)&&!Dn(o)}function ze(o){return Re(o)&&fr(o)}function c2(o){return o===!0||o===!1||Re(o)&&rr(o)==Jt}var aa=CE||Ql,h2=td?mr(td):$C;function p2(o){return Re(o)&&o.nodeType===1&&!Es(o)}function v2(o){if(o==null)return!0;if(fr(o)&&(zt(o)||typeof o=="string"||typeof o.splice=="function"||aa(o)||bi(o)||Ra(o)))return!o.length;var l=tr(o);if(l==wt||l==Fe)return!o.size;if(ws(o))return!_l(o).length;for(var d in o)if(fe.call(o,d))return!1;return!0}function d2(o,l){return $s(o,l)}function g2(o,l,d){d=typeof d=="function"?d:r;var $=d?d(o,l):r;return $===r?$s(o,l,r,d):!!$}function Ul(o){if(!Re(o))return!1;var l=rr(o);return l==Oe||l==Ie||typeof o.message=="string"&&typeof o.name=="string"&&!Es(o)}function _2(o){return typeof o=="number"&&bd(o)}function Dn(o){if(!De(o))return!1;var l=rr(o);return l==ge||l==Kt||l==de||l==Ft}function Ng(o){return typeof o=="number"&&o==qt(o)}function fu(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=it}function De(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Re(o){return o!=null&&typeof o=="object"}var jg=ed?mr(ed):yC;function m2(o,l){return o===l||gl(o,l,Dl(l))}function $2(o,l,d){return d=typeof d=="function"?d:r,gl(o,l,Dl(l),d)}function b2(o){return qg(o)&&o!=+o}function y2(o){if(aO(o))throw new Dt(i);return Dd(o)}function w2(o){return o===null}function S2(o){return o==null}function qg(o){return typeof o=="number"||Re(o)&&rr(o)==St}function Es(o){if(!Re(o)||rr(o)!=be)return!1;var l=Lo(o);if(l===null)return!0;var d=fe.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Io.call(d)==$E}var kl=rd?mr(rd):wC;function E2(o){return Ng(o)&&o>=-it&&o<=it}var Ug=nd?mr(nd):SC;function lu(o){return typeof o=="string"||!zt(o)&&Re(o)&&rr(o)==Kr}function br(o){return typeof o=="symbol"||Re(o)&&rr(o)==Dr}var bi=ad?mr(ad):EC;function C2(o){return o===r}function O2(o){return Re(o)&&tr(o)==gr}function A2(o){return Re(o)&&rr(o)==Ea}var T2=tu(ml),M2=tu(function(o,l){return o<=l});function kg(o){if(!o)return[];if(fr(o))return lu(o)?Yr(o):ur(o);if(cs&&o[cs])return oE(o[cs]());var l=tr(o),d=l==wt?il:l==Fe?Mo:yi;return d(o)}function Rn(o){if(!o)return o===0?o:0;if(o=jr(o),o===Z||o===-Z){var l=o<0?-1:1;return l*ct}return o===o?o:0}function qt(o){var l=Rn(o),d=l%1;return l===l?d?l-d:l:0}function Hg(o){return o?Pa(qt(o),0,dt):0}function jr(o){if(typeof o=="number")return o;if(br(o))return lt;if(De(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=De(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=ld(o);var d=lS.test(o);return d||hS.test(o)?kS(o.slice(2),d?2:8):fS.test(o)?lt:+o}function Wg(o){return sn(o,lr(o))}function P2(o){return o?Pa(qt(o),-it,it):o===0?o:0}function oe(o){return o==null?"":$r(o)}var x2=_i(function(o,l){if(ws(l)||fr(l)){sn(l,We(l),o);return}for(var d in l)fe.call(l,d)&&gs(o,d,l[d])}),Kg=_i(function(o,l){sn(l,lr(l),o)}),cu=_i(function(o,l,d,$){sn(l,lr(l),o,$)}),I2=_i(function(o,l,d,$){sn(l,We(l),o,$)}),D2=xn(cl);function R2(o,l){var d=gi(o);return l==null?d:Cd(d,l)}var B2=Wt(function(o,l){o=le(o);var d=-1,$=l.length,S=$>2?l[2]:r;for(S&&nr(l[0],l[1],S)&&($=1);++d<$;)for(var O=l[d],D=lr(O),R=-1,N=D.length;++R<N;){var J=D[R],tt=o[J];(tt===r||Vr(tt,pi[J])&&!fe.call(o,J))&&(o[J]=O[J])}return o}),L2=Wt(function(o){return o.push(r,lg),_r(Yg,r,o)});function F2(o,l){return sd(o,Mt(l,3),an)}function z2(o,l){return sd(o,Mt(l,3),pl)}function G2(o,l){return o==null?o:hl(o,Mt(l,3),lr)}function N2(o,l){return o==null?o:Pd(o,Mt(l,3),lr)}function j2(o,l){return o&&an(o,Mt(l,3))}function q2(o,l){return o&&pl(o,Mt(l,3))}function U2(o){return o==null?[]:Wo(o,We(o))}function k2(o){return o==null?[]:Wo(o,lr(o))}function Hl(o,l,d){var $=o==null?r:xa(o,l);return $===r?d:$}function H2(o,l){return o!=null&&pg(o,l,vC)}function Wl(o,l){return o!=null&&pg(o,l,dC)}var W2=ig(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Do.call(l)),o[l]=d},Yl(cr)),K2=ig(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Do.call(l)),fe.call(o,l)?o[l].push(d):o[l]=[d]},Mt),Y2=Wt(ms);function We(o){return fr(o)?Sd(o):_l(o)}function lr(o){return fr(o)?Sd(o,!0):CC(o)}function X2(o,l){var d={};return l=Mt(l,3),an(o,function($,S,O){Mn(d,l($,S,O),$)}),d}function V2(o,l){var d={};return l=Mt(l,3),an(o,function($,S,O){Mn(d,S,l($,S,O))}),d}var Z2=_i(function(o,l,d){Ko(o,l,d)}),Yg=_i(function(o,l,d,$){Ko(o,l,d,$)}),J2=xn(function(o,l){var d={};if(o==null)return d;var $=!1;l=Te(l,function(O){return O=ra(O,o),$||($=O.length>1),O}),sn(o,xl(o),d),$&&(d=zr(d,p|v|g,WC));for(var S=l.length;S--;)Sl(d,l[S]);return d});function Q2(o,l){return Xg(o,uu(Mt(l)))}var tT=xn(function(o,l){return o==null?{}:AC(o,l)});function Xg(o,l){if(o==null)return{};var d=Te(xl(o),function($){return[$]});return l=Mt(l),Nd(o,d,function($,S){return l($,S[0])})}function eT(o,l,d){l=ra(l,o);var $=-1,S=l.length;for(S||(S=1,o=r);++$<S;){var O=o==null?r:o[on(l[$])];O===r&&($=S,O=d),o=Dn(O)?O.call(o):O}return o}function rT(o,l,d){return o==null?o:bs(o,l,d)}function nT(o,l,d,$){return $=typeof $=="function"?$:r,o==null?o:bs(o,l,d,$)}var Vg=ug(We),Zg=ug(lr);function aT(o,l,d){var $=zt(o),S=$||aa(o)||bi(o);if(l=Mt(l,4),d==null){var O=o&&o.constructor;S?d=$?new O:[]:De(o)?d=Dn(O)?gi(Lo(o)):{}:d={}}return(S?Br:an)(o,function(D,R,N){return l(d,D,R,N)}),d}function iT(o,l){return o==null?!0:Sl(o,l)}function sT(o,l,d){return o==null?o:Hd(o,l,Ol(d))}function oT(o,l,d,$){return $=typeof $=="function"?$:r,o==null?o:Hd(o,l,Ol(d),$)}function yi(o){return o==null?[]:al(o,We(o))}function uT(o){return o==null?[]:al(o,lr(o))}function fT(o,l,d){return d===r&&(d=l,l=r),d!==r&&(d=jr(d),d=d===d?d:0),l!==r&&(l=jr(l),l=l===l?l:0),Pa(jr(o),l,d)}function lT(o,l,d){return l=Rn(l),d===r?(d=l,l=0):d=Rn(d),o=jr(o),gC(o,l,d)}function cT(o,l,d){if(d&&typeof d!="boolean"&&nr(o,l,d)&&(l=d=r),d===r&&(typeof l=="boolean"?(d=l,l=r):typeof o=="boolean"&&(d=o,o=r)),o===r&&l===r?(o=0,l=1):(o=Rn(o),l===r?(l=o,o=0):l=Rn(l)),o>l){var $=o;o=l,l=$}if(d||o%1||l%1){var S=yd();return Qe(o+S*(l-o+US("1e-"+((S+"").length-1))),l)}return bl(o,l)}var hT=mi(function(o,l,d){return l=l.toLowerCase(),o+(d?Jg(l):l)});function Jg(o){return Kl(oe(o).toLowerCase())}function Qg(o){return o=oe(o),o&&o.replace(vS,rE).replace(DS,"")}function pT(o,l,d){o=oe(o),l=$r(l);var $=o.length;d=d===r?$:Pa(qt(d),0,$);var S=d;return d-=l.length,d>=0&&o.slice(d,S)==l}function vT(o){return o=oe(o),o&&Yw.test(o)?o.replace(Pv,nE):o}function dT(o){return o=oe(o),o&&tS.test(o)?o.replace(qf,"\\$&"):o}var gT=mi(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),_T=mi(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),mT=rg("toLowerCase");function $T(o,l,d){o=oe(o),l=qt(l);var $=l?ci(o):0;if(!l||$>=l)return o;var S=(l-$)/2;return Qo(No(S),d)+o+Qo(Go(S),d)}function bT(o,l,d){o=oe(o),l=qt(l);var $=l?ci(o):0;return l&&$<l?o+Qo(l-$,d):o}function yT(o,l,d){o=oe(o),l=qt(l);var $=l?ci(o):0;return l&&$<l?Qo(l-$,d)+o:o}function wT(o,l,d){return d||l==null?l=0:l&&(l=+l),ME(oe(o).replace(Uf,""),l||0)}function ST(o,l,d){return(d?nr(o,l,d):l===r)?l=1:l=qt(l),yl(oe(o),l)}function ET(){var o=arguments,l=oe(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var CT=mi(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function OT(o,l,d){return d&&typeof d!="number"&&nr(o,l,d)&&(l=d=r),d=d===r?dt:d>>>0,d?(o=oe(o),o&&(typeof l=="string"||l!=null&&!kl(l))&&(l=$r(l),!l&&li(o))?na(Yr(o),0,d):o.split(l,d)):[]}var AT=mi(function(o,l,d){return o+(d?" ":"")+Kl(l)});function TT(o,l,d){return o=oe(o),d=d==null?0:Pa(qt(d),0,o.length),l=$r(l),o.slice(d,d+l.length)==l}function MT(o,l,d){var $=E.templateSettings;d&&nr(o,l,d)&&(l=r),o=oe(o),l=cu({},l,$,fg);var S=cu({},l.imports,$.imports,fg),O=We(S),D=al(S,O),R,N,J=0,tt=l.interpolate||Eo,nt="__p += '",vt=sl((l.escape||Eo).source+"|"+tt.source+"|"+(tt===xv?uS:Eo).source+"|"+(l.evaluate||Eo).source+"|$","g"),yt="//# sourceURL="+(fe.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zS+"]")+`
|
|
`;o.replace(vt,function(xt,Yt,Qt,yr,ar,wr){return Qt||(Qt=yr),nt+=o.slice(J,wr).replace(dS,aE),Yt&&(R=!0,nt+=`' +
|
|
__e(`+Yt+`) +
|
|
'`),ar&&(N=!0,nt+=`';
|
|
`+ar+`;
|
|
__p += '`),Qt&&(nt+=`' +
|
|
((__t = (`+Qt+`)) == null ? '' : __t) +
|
|
'`),J=wr+xt.length,xt}),nt+=`';
|
|
`;var Pt=fe.call(l,"variable")&&l.variable;if(!Pt)nt=`with (obj) {
|
|
`+nt+`
|
|
}
|
|
`;else if(sS.test(Pt))throw new Dt(u);nt=(N?nt.replace(kw,""):nt).replace(Hw,"$1").replace(Ww,"$1;"),nt="function("+(Pt||"obj")+`) {
|
|
`+(Pt?"":`obj || (obj = {});
|
|
`)+"var __t, __p = ''"+(R?", __e = _.escape":"")+(N?`, __j = Array.prototype.join;
|
|
function print() { __p += __j.call(arguments, '') }
|
|
`:`;
|
|
`)+nt+`return __p
|
|
}`;var kt=e0(function(){return ie(O,yt+"return "+nt).apply(r,D)});if(kt.source=nt,Ul(kt))throw kt;return kt}function PT(o){return oe(o).toLowerCase()}function xT(o){return oe(o).toUpperCase()}function IT(o,l,d){if(o=oe(o),o&&(d||l===r))return ld(o);if(!o||!(l=$r(l)))return o;var $=Yr(o),S=Yr(l),O=cd($,S),D=hd($,S)+1;return na($,O,D).join("")}function DT(o,l,d){if(o=oe(o),o&&(d||l===r))return o.slice(0,vd(o)+1);if(!o||!(l=$r(l)))return o;var $=Yr(o),S=hd($,Yr(l))+1;return na($,0,S).join("")}function RT(o,l,d){if(o=oe(o),o&&(d||l===r))return o.replace(Uf,"");if(!o||!(l=$r(l)))return o;var $=Yr(o),S=cd($,Yr(l));return na($,S).join("")}function BT(o,l){var d=L,$=G;if(De(l)){var S="separator"in l?l.separator:S;d="length"in l?qt(l.length):d,$="omission"in l?$r(l.omission):$}o=oe(o);var O=o.length;if(li(o)){var D=Yr(o);O=D.length}if(d>=O)return o;var R=d-ci($);if(R<1)return $;var N=D?na(D,0,R).join(""):o.slice(0,R);if(S===r)return N+$;if(D&&(R+=N.length-R),kl(S)){if(o.slice(R).search(S)){var J,tt=N;for(S.global||(S=sl(S.source,oe(Iv.exec(S))+"g")),S.lastIndex=0;J=S.exec(tt);)var nt=J.index;N=N.slice(0,nt===r?R:nt)}}else if(o.indexOf($r(S),R)!=R){var vt=N.lastIndexOf(S);vt>-1&&(N=N.slice(0,vt))}return N+$}function LT(o){return o=oe(o),o&&Kw.test(o)?o.replace(Mv,cE):o}var FT=mi(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),Kl=rg("toUpperCase");function t0(o,l,d){return o=oe(o),l=d?r:l,l===r?sE(o)?vE(o):ZS(o):o.match(l)||[]}var e0=Wt(function(o,l){try{return _r(o,r,l)}catch(d){return Ul(d)?d:new Dt(d)}}),zT=xn(function(o,l){return Br(l,function(d){d=on(d),Mn(o,d,jl(o[d],o))}),o});function GT(o){var l=o==null?0:o.length,d=Mt();return o=l?Te(o,function($){if(typeof $[1]!="function")throw new Lr(s);return[d($[0]),$[1]]}):[],Wt(function($){for(var S=-1;++S<l;){var O=o[S];if(_r(O[0],this,$))return _r(O[1],this,$)}})}function NT(o){return cC(zr(o,p))}function Yl(o){return function(){return o}}function jT(o,l){return o==null||o!==o?l:o}var qT=ag(),UT=ag(!0);function cr(o){return o}function Xl(o){return Rd(typeof o=="function"?o:zr(o,p))}function kT(o){return Ld(zr(o,p))}function HT(o,l){return Fd(o,zr(l,p))}var WT=Wt(function(o,l){return function(d){return ms(d,o,l)}}),KT=Wt(function(o,l){return function(d){return ms(o,d,l)}});function Vl(o,l,d){var $=We(l),S=Wo(l,$);d==null&&!(De(l)&&(S.length||!$.length))&&(d=l,l=o,o=this,S=Wo(l,We(l)));var O=!(De(d)&&"chain"in d)||!!d.chain,D=Dn(o);return Br(S,function(R){var N=l[R];o[R]=N,D&&(o.prototype[R]=function(){var J=this.__chain__;if(O||J){var tt=o(this.__wrapped__),nt=tt.__actions__=ur(this.__actions__);return nt.push({func:N,args:arguments,thisArg:o}),tt.__chain__=J,tt}return N.apply(o,Zn([this.value()],arguments))})}),o}function YT(){return Ye._===this&&(Ye._=bE),this}function Zl(){}function XT(o){return o=qt(o),Wt(function(l){return zd(l,o)})}var VT=Tl(Te),ZT=Tl(id),JT=Tl(Qf);function r0(o){return Bl(o)?tl(on(o)):TC(o)}function QT(o){return function(l){return o==null?r:xa(o,l)}}var tM=sg(),eM=sg(!0);function Jl(){return[]}function Ql(){return!1}function rM(){return{}}function nM(){return""}function aM(){return!0}function iM(o,l){if(o=qt(o),o<1||o>it)return[];var d=dt,$=Qe(o,dt);l=Mt(l),o-=dt;for(var S=nl($,l);++d<o;)l(d);return S}function sM(o){return zt(o)?Te(o,on):br(o)?[o]:ur(wg(oe(o)))}function oM(o){var l=++mE;return oe(o)+l}var uM=Jo(function(o,l){return o+l},0),fM=Ml("ceil"),lM=Jo(function(o,l){return o/l},1),cM=Ml("floor");function hM(o){return o&&o.length?Ho(o,cr,vl):r}function pM(o,l){return o&&o.length?Ho(o,Mt(l,2),vl):r}function vM(o){return ud(o,cr)}function dM(o,l){return ud(o,Mt(l,2))}function gM(o){return o&&o.length?Ho(o,cr,ml):r}function _M(o,l){return o&&o.length?Ho(o,Mt(l,2),ml):r}var mM=Jo(function(o,l){return o*l},1),$M=Ml("round"),bM=Jo(function(o,l){return o-l},0);function yM(o){return o&&o.length?rl(o,cr):0}function wM(o,l){return o&&o.length?rl(o,Mt(l,2)):0}return E.after=kA,E.ary=Dg,E.assign=x2,E.assignIn=Kg,E.assignInWith=cu,E.assignWith=I2,E.at=D2,E.before=Rg,E.bind=jl,E.bindAll=zT,E.bindKey=Bg,E.castArray=r2,E.chain=Pg,E.chunk=cO,E.compact=hO,E.concat=pO,E.cond=GT,E.conforms=NT,E.constant=Yl,E.countBy=yA,E.create=R2,E.curry=Lg,E.curryRight=Fg,E.debounce=zg,E.defaults=B2,E.defaultsDeep=L2,E.defer=HA,E.delay=WA,E.difference=vO,E.differenceBy=dO,E.differenceWith=gO,E.drop=_O,E.dropRight=mO,E.dropRightWhile=$O,E.dropWhile=bO,E.fill=yO,E.filter=SA,E.flatMap=OA,E.flatMapDeep=AA,E.flatMapDepth=TA,E.flatten=Og,E.flattenDeep=wO,E.flattenDepth=SO,E.flip=KA,E.flow=qT,E.flowRight=UT,E.fromPairs=EO,E.functions=U2,E.functionsIn=k2,E.groupBy=MA,E.initial=OO,E.intersection=AO,E.intersectionBy=TO,E.intersectionWith=MO,E.invert=W2,E.invertBy=K2,E.invokeMap=xA,E.iteratee=Xl,E.keyBy=IA,E.keys=We,E.keysIn=lr,E.map=iu,E.mapKeys=X2,E.mapValues=V2,E.matches=kT,E.matchesProperty=HT,E.memoize=ou,E.merge=Z2,E.mergeWith=Yg,E.method=WT,E.methodOf=KT,E.mixin=Vl,E.negate=uu,E.nthArg=XT,E.omit=J2,E.omitBy=Q2,E.once=YA,E.orderBy=DA,E.over=VT,E.overArgs=XA,E.overEvery=ZT,E.overSome=JT,E.partial=ql,E.partialRight=Gg,E.partition=RA,E.pick=tT,E.pickBy=Xg,E.property=r0,E.propertyOf=QT,E.pull=DO,E.pullAll=Tg,E.pullAllBy=RO,E.pullAllWith=BO,E.pullAt=LO,E.range=tM,E.rangeRight=eM,E.rearg=VA,E.reject=FA,E.remove=FO,E.rest=ZA,E.reverse=Gl,E.sampleSize=GA,E.set=rT,E.setWith=nT,E.shuffle=NA,E.slice=zO,E.sortBy=UA,E.sortedUniq=HO,E.sortedUniqBy=WO,E.split=OT,E.spread=JA,E.tail=KO,E.take=YO,E.takeRight=XO,E.takeRightWhile=VO,E.takeWhile=ZO,E.tap=hA,E.throttle=QA,E.thru=au,E.toArray=kg,E.toPairs=Vg,E.toPairsIn=Zg,E.toPath=sM,E.toPlainObject=Wg,E.transform=aT,E.unary=t2,E.union=JO,E.unionBy=QO,E.unionWith=tA,E.uniq=eA,E.uniqBy=rA,E.uniqWith=nA,E.unset=iT,E.unzip=Nl,E.unzipWith=Mg,E.update=sT,E.updateWith=oT,E.values=yi,E.valuesIn=uT,E.without=aA,E.words=t0,E.wrap=e2,E.xor=iA,E.xorBy=sA,E.xorWith=oA,E.zip=uA,E.zipObject=fA,E.zipObjectDeep=lA,E.zipWith=cA,E.entries=Vg,E.entriesIn=Zg,E.extend=Kg,E.extendWith=cu,Vl(E,E),E.add=uM,E.attempt=e0,E.camelCase=hT,E.capitalize=Jg,E.ceil=fM,E.clamp=fT,E.clone=n2,E.cloneDeep=i2,E.cloneDeepWith=s2,E.cloneWith=a2,E.conformsTo=o2,E.deburr=Qg,E.defaultTo=jT,E.divide=lM,E.endsWith=pT,E.eq=Vr,E.escape=vT,E.escapeRegExp=dT,E.every=wA,E.find=EA,E.findIndex=Eg,E.findKey=F2,E.findLast=CA,E.findLastIndex=Cg,E.findLastKey=z2,E.floor=cM,E.forEach=xg,E.forEachRight=Ig,E.forIn=G2,E.forInRight=N2,E.forOwn=j2,E.forOwnRight=q2,E.get=Hl,E.gt=u2,E.gte=f2,E.has=H2,E.hasIn=Wl,E.head=Ag,E.identity=cr,E.includes=PA,E.indexOf=CO,E.inRange=lT,E.invoke=Y2,E.isArguments=Ra,E.isArray=zt,E.isArrayBuffer=l2,E.isArrayLike=fr,E.isArrayLikeObject=ze,E.isBoolean=c2,E.isBuffer=aa,E.isDate=h2,E.isElement=p2,E.isEmpty=v2,E.isEqual=d2,E.isEqualWith=g2,E.isError=Ul,E.isFinite=_2,E.isFunction=Dn,E.isInteger=Ng,E.isLength=fu,E.isMap=jg,E.isMatch=m2,E.isMatchWith=$2,E.isNaN=b2,E.isNative=y2,E.isNil=S2,E.isNull=w2,E.isNumber=qg,E.isObject=De,E.isObjectLike=Re,E.isPlainObject=Es,E.isRegExp=kl,E.isSafeInteger=E2,E.isSet=Ug,E.isString=lu,E.isSymbol=br,E.isTypedArray=bi,E.isUndefined=C2,E.isWeakMap=O2,E.isWeakSet=A2,E.join=PO,E.kebabCase=gT,E.last=Nr,E.lastIndexOf=xO,E.lowerCase=_T,E.lowerFirst=mT,E.lt=T2,E.lte=M2,E.max=hM,E.maxBy=pM,E.mean=vM,E.meanBy=dM,E.min=gM,E.minBy=_M,E.stubArray=Jl,E.stubFalse=Ql,E.stubObject=rM,E.stubString=nM,E.stubTrue=aM,E.multiply=mM,E.nth=IO,E.noConflict=YT,E.noop=Zl,E.now=su,E.pad=$T,E.padEnd=bT,E.padStart=yT,E.parseInt=wT,E.random=cT,E.reduce=BA,E.reduceRight=LA,E.repeat=ST,E.replace=ET,E.result=eT,E.round=$M,E.runInContext=z,E.sample=zA,E.size=jA,E.snakeCase=CT,E.some=qA,E.sortedIndex=GO,E.sortedIndexBy=NO,E.sortedIndexOf=jO,E.sortedLastIndex=qO,E.sortedLastIndexBy=UO,E.sortedLastIndexOf=kO,E.startCase=AT,E.startsWith=TT,E.subtract=bM,E.sum=yM,E.sumBy=wM,E.template=MT,E.times=iM,E.toFinite=Rn,E.toInteger=qt,E.toLength=Hg,E.toLower=PT,E.toNumber=jr,E.toSafeInteger=P2,E.toString=oe,E.toUpper=xT,E.trim=IT,E.trimEnd=DT,E.trimStart=RT,E.truncate=BT,E.unescape=LT,E.uniqueId=oM,E.upperCase=FT,E.upperFirst=Kl,E.each=xg,E.eachRight=Ig,E.first=Ag,Vl(E,function(){var o={};return an(E,function(l,d){fe.call(E.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),E.VERSION=n,Br(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){E[o].placeholder=E}),Br(["drop","take"],function(o,l){Xt.prototype[o]=function(d){d=d===r?1:ke(qt(d),0);var $=this.__filtered__&&!l?new Xt(this):this.clone();return $.__filtered__?$.__takeCount__=Qe(d,$.__takeCount__):$.__views__.push({size:Qe(d,dt),type:o+($.__dir__<0?"Right":"")}),$},Xt.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Br(["filter","map","takeWhile"],function(o,l){var d=l+1,$=d==et||d==gt;Xt.prototype[o]=function(S){var O=this.clone();return O.__iteratees__.push({iteratee:Mt(S,3),type:d}),O.__filtered__=O.__filtered__||$,O}}),Br(["head","last"],function(o,l){var d="take"+(l?"Right":"");Xt.prototype[o]=function(){return this[d](1).value()[0]}}),Br(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");Xt.prototype[o]=function(){return this.__filtered__?new Xt(this):this[d](1)}}),Xt.prototype.compact=function(){return this.filter(cr)},Xt.prototype.find=function(o){return this.filter(o).head()},Xt.prototype.findLast=function(o){return this.reverse().find(o)},Xt.prototype.invokeMap=Wt(function(o,l){return typeof o=="function"?new Xt(this):this.map(function(d){return ms(d,o,l)})}),Xt.prototype.reject=function(o){return this.filter(uu(Mt(o)))},Xt.prototype.slice=function(o,l){o=qt(o);var d=this;return d.__filtered__&&(o>0||l<0)?new Xt(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==r&&(l=qt(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},Xt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Xt.prototype.toArray=function(){return this.take(dt)},an(Xt.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),$=/^(?:head|last)$/.test(l),S=E[$?"take"+(l=="last"?"Right":""):l],O=$||/^find/.test(l);!S||(E.prototype[l]=function(){var D=this.__wrapped__,R=$?[1]:arguments,N=D instanceof Xt,J=R[0],tt=N||zt(D),nt=function(Yt){var Qt=S.apply(E,Zn([Yt],R));return $&&vt?Qt[0]:Qt};tt&&d&&typeof J=="function"&&J.length!=1&&(N=tt=!1);var vt=this.__chain__,yt=!!this.__actions__.length,Pt=O&&!vt,kt=N&&!yt;if(!O&&tt){D=kt?D:new Xt(this);var xt=o.apply(D,R);return xt.__actions__.push({func:au,args:[nt],thisArg:r}),new Fr(xt,vt)}return Pt&&kt?o.apply(this,R):(xt=this.thru(nt),Pt?$?xt.value()[0]:xt.value():xt)})}),Br(["pop","push","shift","sort","splice","unshift"],function(o){var l=Po[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",$=/^(?:pop|shift)$/.test(o);E.prototype[o]=function(){var S=arguments;if($&&!this.__chain__){var O=this.value();return l.apply(zt(O)?O:[],S)}return this[d](function(D){return l.apply(zt(D)?D:[],S)})}}),an(Xt.prototype,function(o,l){var d=E[l];if(d){var $=d.name+"";fe.call(di,$)||(di[$]=[]),di[$].push({name:l,func:d})}}),di[Zo(r,y).name]=[{name:"wrapper",func:r}],Xt.prototype.clone=LE,Xt.prototype.reverse=FE,Xt.prototype.value=zE,E.prototype.at=pA,E.prototype.chain=vA,E.prototype.commit=dA,E.prototype.next=gA,E.prototype.plant=mA,E.prototype.reverse=$A,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=bA,E.prototype.first=E.prototype.head,cs&&(E.prototype[cs]=_A),E},hi=dE();Oa?((Oa.exports=hi)._=hi,Xf._=hi):Ye._=hi}).call(Cr)})(sh,sh.exports);var krt=sh.exports;const mf=new Ke({subduxes:{reqs:Sa},initial:{bays:0,squadrons:[]},actions:{setCarrierBays:null,setSquadronType:null}});mf.setMutation("setCarrierBays",e=>ee({bays:e,reqs:Krt(e),squadrons:Wrt(e)}));mf.setMutation("setSquadronType",({type:e,id:t})=>r=>ee.updateIn(["squadrons",t-1],{type:e,reqs:Hrt(e)},r));const Nu=[{type:"standard",cost:3},{type:"fast",cost:4},{type:"heavy",cost:5},{type:"interceptor",cost:3},{type:"attack",cost:4},{type:"long range",cost:4},{type:"torpedo",cost:6}];function Hrt(e){var t;return{mass:6,cost:6*((t=Nu.find(r=>r.type===e))==null?void 0:t.cost)}}const Wrt=e=>t=>(t.length>e&&(t=t.slice(0,e)),t.length<e&&(t=[...t,...krt.times(e-t.length,()=>({type:Nu[0].type,reqs:{cost:6*Nu[0].cost,mass:6}}))]),t);function Krt(e){return{mass:9*e,cost:18*e}}const $f=new Ke({actions:{setShipType:null,setShipClass:null,setCarrierBays:mf.actions.setCarrierBays},initial:{shipType:"",shipClass:"",isCarrier:!1,mass:10}});$f.setMutation("setShipType",e=>ee({shipType:e}));$f.setMutation("setShipClass",e=>ee({shipClass:e}));$f.setMutation("setCarrierBays",e=>ee({isCarrier:e>0}));const Vp=new Ke({subduxes:{reqs:Sa},initial:{rating:0,min:0,max:0},actions:{setShipMass:null,setHull:null}});Vp.setMutation("setHull",e=>ee({rating:e,reqs:{mass:e,cost:2*e}}));Vp.setMutation("setShipMass",e=>t=>{let{rating:r}=t;r>e&&(r=e);const n=Math.ceil(e/10);return r<n&&(r=n),ee({max:e,min:n,rating:r},t)});const Zp=new Ke({subduxes:{reqs:Sa},initial:{standard:0,advanced:0},actions:{setScreens:null,setScreensReqs:null}});Zp.setMutation("setScreens",e=>ee(e));Zp.setMutation("setScreensReqs",e=>ee({reqs:e}));const Yrt=e=>Kp(t=>t.reqs.mass,t=>t.structure.screens.standard,t=>t.structure.screens.advanced,(...t)=>e.dispatch.setScreensReqs(Xrt(...t)));function Xrt(e,t,r){const n=t*Math.max(3,Math.ceil(.05*e)),a=r*Math.max(4,Math.ceil(.075*e));return{mass:n+a,cost:3*n+4*a}}const yy=new Ke({subduxes:{reqs:Sa},initial:{space:0},actions:{setCargo:null}});yy.setMutation("setCargo",e=>ee({space:e,reqs:{mass:e}}));const Jp=new Ke({subduxes:{reqs:Sa},initial:{layers:[]},actions:{setArmorLayers:null,setArmorRating:null}});Jp.setMutation("setArmorRating",({layer:e,rating:t})=>r=>{let n=[...r.layers].map((a,i)=>i===e-1?t:a);return{layers:n,reqs:wy(n)}});Jp.setMutation("setArmorLayers",e=>t=>{let r=[...t.layers];for(e<t.layers.length&&(r=[...t.layers].slice(0,e));r.length<e;)r.push(0);return{layers:r,reqs:wy(r)}});function wy(e){const t=2*e.reduce((n,a)=>n+a,0),r=2*e.map((n,a)=>n*(a+1)).reduce((n,a)=>n+a,0);return{mass:t,cost:r}}const Sy=new Ke({subduxes:{reqs:Sa},initial:{type:"none"},actions:{setStreamlining:null}});Sy.setMutation("setStreamlining",({shipMass:e,type:t})=>ee({type:t,reqs:Vrt({shipMass:e,type:t})}));function Vrt({shipMass:e,type:t}){const r=Math.ceil(e*(t==="none"?0:t==="partial"?5:10)/100);return{mass:r,cost:2*r}}const Zrt=new Ke({subduxes:{hull:Vp,screens:Zp,cargo:yy,streamlining:Sy,armor:Jp}}),Zs=[{name:"beam",type:"beam",reqs:Jrt,initial:{weaponClass:1}},{name:"submunition pack",type:"submunition",reqs:{mass:1,cost:3},initial:{arc:"F"}},{name:"point defence system",type:"pds",reqs:{mass:1,cost:3},initial:{}},{name:"scattergun",type:"scattergun",reqs:{mass:1,cost:4},initial:{}},{name:"needle weapon",type:"needle",reqs:{mass:2,cost:6},initial:{arc:"F"}}],bf=new Ke({initial:[],actions:{addWeapon:null,removeWeapon:null,setWeapon:null}});bf.setMutation("setWeapon",r=>{var n=r,{id:e}=n,t=o0(n,["id"]);return a=>(console.log(e,t,a),a=ee.map(ee.if(i=>i.id===e,i=>tc(wi({id:e},t),{reqs:Ey(t)})),a),console.log(a),a)});bf.setMutation("removeWeapon",e=>t=>[...t.filter(r=>r.id!==e)]);bf.setMutation("addWeapon",e=>t=>{const r=Zs.find(n=>n.type===e).initial;return[...t,wi({id:t.length===0?1:t[t.length-1]+1,type:e,reqs:Ey(wi({type:e},r))},r)]});function Ey(e){const{reqs:t}=Zs.find(r=>r.type===e.type)||{};return t?typeof t=="function"?t(e):t:{}}const D_=e=>e.length!==4?!1:!e.some(t=>t.length===1);function Jrt({weaponClass:e,arcs:t}){console.log({weaponClass:e,arcs:t});let r;return e===1&&(r=1),e===2&&(r=2+(t.length>3?1:0)),e==3&&(r=4,D_(t)?r+=2:r+=t.length-1),e==4&&(r=8,D_(t)?r+=4:r+=2*(t.length-1)),{mass:r,cost:3*r}}const R_={cost:0,mass:0},Qp=new Ke({subduxes:{weapons:bf},initial:{firecons:{stations:0,reqs:R_},adfc:{rating:0,reqs:R_}},actions:{setADFC:null,setFirecons:null}});Qp.setMutation("setFirecons",e=>ee({firecons:{stations:e,reqs:{cost:4*e,mass:e}}}));Qp.setMutation("setADFC",e=>ee({adfc:{rating:e,reqs:{cost:8*e,mass:2*e}}}));const ri=new Ke({subduxes:{identification:$f,propulsion:Urt,structure:Zrt,carrier:mf,weaponry:Qp},initial:{reqs:{cost:0,mass:10,usedMass:0}},actions:{setShipReqs:null}});ri.setMutation("setShipMass",e=>ee({reqs:{mass:e}}));ri.setMutation("setShipReqs",e=>ee({reqs:e}));ri.addReaction(Grt);ri.addReaction(qrt);ri.addReaction(Yrt);ri.addReaction(e=>t=>{let r=0,n=0,a=Object.values(t);for(;a.length>0;){const i=a.shift();typeof i=="object"&&(i.reqs&&(r+=i.reqs.cost,n+=i.reqs.mass),a.push(...Object.values(i)))}e.dispatch.setShipReqs({cost:r,usedMass:n})});let Qrt=v$;var tnt=()=>{let e;localStorage.getItem("ship")&&(e=JSON.parse(localStorage.getItem("ship")));const t=ri.createStore(e,a=>Qrt(NM(a)));let r;const n=BM(t.getState(),a=>{t.subscribe(()=>{r!==t.getState()&&(r=t.getState(),a(r),localStorage.setItem("ship",JSON.stringify(r)))})});return{dispatch:t.dispatch,state:n,shipMass:LM(n,a=>a.reqs.mass)}};function yf(){const e=OM();return t=>{const r=Object.keys(e.$$.callbacks),n=[];return r.forEach(a=>n.push(ae(t,a,i=>Fh(e,i)))),{destroy:()=>{n.forEach(a=>a())}}}}const ent=e=>({}),B_=e=>({}),rnt=e=>({}),L_=e=>({});function F_(e){let t,r;const n=e[4].header,a=bn(n,e,e[3],L_);return{c(){t=k("header"),a&&a.c()},l(i){t=H(i,"HEADER",{});var s=V(t);a&&a.l(s),s.forEach(M)},m(i,s){q(i,t,s),a&&a.m(t,null),r=!0},p(i,s){a&&a.p&&(!r||s&8)&&_n(a,n,i,i[3],r?$n(n,i[3],s,rnt):mn(i[3]),L_)},i(i){r||(W(a,i),r=!0)},o(i){X(a,i),r=!1},d(i){i&&M(t),a&&a.d(i)}}}function z_(e){let t,r;const n=e[4].footer,a=bn(n,e,e[3],B_);return{c(){t=k("footer"),a&&a.c()},l(i){t=H(i,"FOOTER",{});var s=V(t);a&&a.l(s),s.forEach(M)},m(i,s){q(i,t,s),a&&a.m(t,null),r=!0},p(i,s){a&&a.p&&(!r||s&8)&&_n(a,n,i,i[3],r?$n(n,i[3],s,ent):mn(i[3]),B_)},i(i){r||(W(a,i),r=!0)},o(i){X(a,i),r=!1},d(i){i&&M(t),a&&a.d(i)}}}function nnt(e){let t,r,n,a,i,s,u=e[2].header&&F_(e);const f=e[4].default,c=bn(f,e,e[3],null);let h=e[2].footer&&z_(e),p=[e[1]],v={};for(let g=0;g<p.length;g+=1)v=Bt(v,p[g]);return{c(){t=k("div"),u&&u.c(),r=ht(),c&&c.c(),n=ht(),h&&h.c(),this.h()},l(g){t=H(g,"DIV",{});var _=V(t);u&&u.l(_),r=pt(_),c&&c.l(_),n=pt(_),h&&h.l(_),_.forEach(M),this.h()},h(){la(t,v),Me(t,"card",1)},m(g,_){q(g,t,_),u&&u.m(t,null),j(t,r),c&&c.m(t,null),j(t,n),h&&h.m(t,null),a=!0,i||(s=Hu(e[0].call(null,t)),i=!0)},p(g,[_]){g[2].header?u?(u.p(g,_),_&4&&W(u,1)):(u=F_(g),u.c(),W(u,1),u.m(t,r)):u&&(pr(),X(u,1,1,()=>{u=null}),vr()),c&&c.p&&(!a||_&8)&&_n(c,f,g,g[3],a?$n(f,g[3],_,null):mn(g[3]),null),g[2].footer?h?(h.p(g,_),_&4&&W(h,1)):(h=z_(g),h.c(),W(h,1),h.m(t,null)):h&&(pr(),X(h,1,1,()=>{h=null}),vr()),la(t,v=ne(p,[_&2&&g[1]])),Me(t,"card",1)},i(g){a||(W(u),W(c,g),W(h),a=!0)},o(g){X(u),X(c,g),X(h),a=!1},d(g){g&&M(t),u&&u.d(),c&&c.d(g),h&&h.d(),i=!1,s()}}}function ant(e,t,r){const n=[];let a=ca(t,n),{$$slots:i={},$$scope:s}=t;const u=AM(i),f=yf();return e.$$set=c=>{t=Bt(Bt({},t),Li(c)),r(1,a=ca(t,n)),"$$scope"in c&&r(3,s=c.$$scope)},[f,a,u,s,i]}class int extends Ct{constructor(t){super();Ot(this,t,ant,nnt,At,{})}}function snt(e){let t,r,n,a;const i=e[7].default,s=bn(i,e,e[6],null);let u=[e[3]],f={};for(let c=0;c<u.length;c+=1)f=Bt(f,u[c]);return{c(){t=k("nav"),s&&s.c(),this.h()},l(c){t=H(c,"NAV",{});var h=V(t);s&&s.l(h),h.forEach(M),this.h()},h(){la(t,f),Me(t,"tabs",1),Me(t,"is-full",e[0])},m(c,h){q(c,t,h),s&&s.m(t,null),r=!0,n||(a=Hu(e[1].call(null,t)),n=!0)},p(c,[h]){s&&s.p&&(!r||h&64)&&_n(s,i,c,c[6],r?$n(i,c[6],h,null):mn(c[6]),null),la(t,f=ne(u,[h&8&&c[3]])),Me(t,"tabs",1),Me(t,"is-full",c[0])},i(c){r||(W(s,c),r=!0)},o(c){X(s,c),r=!1},d(c){c&&M(t),s&&s.d(c),n=!1,a()}}}function ont(e,t,r){const n=["active","full"];let a=ca(t,n),i,{$$slots:s={},$$scope:u}=t,{active:f=0}=t,{full:c=!1}=t;const h=yf(),p=FM(f);ao(e,p,g=>r(5,i=g));let v=0;return Mc("tabs:getid",()=>v++),Mc("tabs:active",p),e.$$set=g=>{t=Bt(Bt({},t),Li(g)),r(3,a=ca(t,n)),"active"in g&&r(4,f=g.active),"full"in g&&r(0,c=g.full),"$$scope"in g&&r(6,u=g.$$scope)},e.$$.update=()=>{e.$$.dirty&32&&r(4,f=i)},[c,h,p,a,f,i,u,s]}class unt extends Ct{constructor(t){super();Ot(this,t,ont,snt,At,{active:4,full:0})}}function fnt(e){let t,r,n,a;const i=e[8].default,s=bn(i,e,e[7],null);let u=[e[5]],f={};for(let c=0;c<u.length;c+=1)f=Bt(f,u[c]);return{c(){t=k("span"),s&&s.c(),this.h()},l(c){t=H(c,"SPAN",{});var h=V(t);s&&s.l(h),h.forEach(M),this.h()},h(){la(t,f),Me(t,"active",e[1]),Me(t,"svelte-3bldsl",!0)},m(c,h){q(c,t,h),s&&s.m(t,null),r=!0,n||(a=[Hu(e[2].call(null,t)),ae(t,"click",p$(e[9]))],n=!0)},p(c,[h]){s&&s.p&&(!r||h&128)&&_n(s,i,c,c[7],r?$n(i,c[7],h,null):mn(c[7]),null),la(t,f=ne(u,[h&32&&c[5]])),Me(t,"active",c[1]),Me(t,"svelte-3bldsl",!0)},i(c){r||(W(s,c),r=!0)},o(c){X(s,c),r=!1},d(c){c&&M(t),s&&s.d(c),n=!1,io(a)}}}function lnt(e,t,r){let n;const a=["tabid"];let i=ca(t,a),s,{$$slots:u={},$$scope:f}=t,{tabid:c=!1}=t;const h=yf(),p=Ne("tabs:active");ao(e,p,_=>r(6,s=_));const v=Ne("tabs:getid")(),g=()=>p.set(c===!1?v:c);return e.$$set=_=>{t=Bt(Bt({},t),Li(_)),r(5,i=ca(t,a)),"tabid"in _&&r(0,c=_.tabid),"$$scope"in _&&r(7,f=_.$$scope)},e.$$.update=()=>{e.$$.dirty&65&&r(1,n=s===c||s===v)},[c,n,h,p,v,i,s,f,u,g]}class vc extends Ct{constructor(t){super();Ot(this,t,lnt,fnt,At,{tabid:0})}}function G_(e,{delay:t=0,duration:r=400,easing:n=TM}={}){const a=+getComputedStyle(e).opacity;return{delay:t,duration:r,easing:n,css:i=>`opacity: ${i*a}`}}function N_(e){let t,r,n,a,i,s,u,f,c;const h=e[4].default,p=bn(h,e,e[3],null);let v=[e[2]],g={};for(let _=0;_<v.length;_+=1)g=Bt(g,v[_]);return{c(){t=k("div"),r=k("div"),n=ht(),a=k("div"),p&&p.c(),this.h()},l(_){t=H(_,"DIV",{class:!0});var m=V(t);r=H(m,"DIV",{class:!0}),V(r).forEach(M),n=pt(m),a=H(m,"DIV",{});var b=V(a);p&&p.l(b),b.forEach(M),m.forEach(M),this.h()},h(){F(r,"class","background svelte-4lwi8h"),la(a,g),Me(a,"modal",1),Me(a,"svelte-4lwi8h",!0),F(t,"class","container svelte-4lwi8h")},m(_,m){q(_,t,m),j(t,r),j(t,n),j(t,a),p&&p.m(a,null),u=!0,f||(c=[ae(r,"click",e[5]),Hu(i=e[1].call(null,a))],f=!0)},p(_,m){p&&p.p&&(!u||m&8)&&_n(p,h,_,_[3],u?$n(h,_[3],m,null):mn(_[3]),null),la(a,g=ne(v,[m&4&&_[2]])),Me(a,"modal",1),Me(a,"svelte-4lwi8h",!0)},i(_){u||(W(p,_),Ni(()=>{s||(s=u0(t,G_,{duration:200},!0)),s.run(1)}),u=!0)},o(_){X(p,_),s||(s=u0(t,G_,{duration:200},!1)),s.run(0),u=!1},d(_){_&&M(t),p&&p.d(_),_&&s&&s.end(),f=!1,io(c)}}}function cnt(e){let t,r,n=e[0]&&N_(e);return{c(){n&&n.c(),t=je()},l(a){n&&n.l(a),t=je()},m(a,i){n&&n.m(a,i),q(a,t,i),r=!0},p(a,[i]){a[0]?n?(n.p(a,i),i&1&&W(n,1)):(n=N_(a),n.c(),W(n,1),n.m(t.parentNode,t)):n&&(pr(),X(n,1,1,()=>{n=null}),vr())},i(a){r||(W(n),r=!0)},o(a){X(n),r=!1},d(a){n&&n.d(a),a&&M(t)}}}function hnt(e,t,r){const n=["open"];let a=ca(t,n),{$$slots:i={},$$scope:s}=t,{open:u=!1}=t;const f=yf(),c=h=>r(0,u=!1);return e.$$set=h=>{t=Bt(Bt({},t),Li(h)),r(2,a=ca(t,n)),"open"in h&&r(0,u=h.open),"$$scope"in h&&r(3,s=h.$$scope)},[u,f,a,s,i,c]}class pnt extends Ct{constructor(t){super();Ot(this,t,hnt,cnt,At,{open:0})}}function vnt(e){let t,r,n,a,i;return{c(){t=k("a"),r=Fn("svg"),n=Fn("path"),a=Fn("path"),i=Fn("path"),this.h()},l(s){t=H(s,"A",{href:!0,class:!0,"aria-label":!0});var u=V(t);r=zn(u,"svg",{width:!0,height:!0,viewBox:!0,style:!0,"aria-hidden":!0});var f=V(r);n=zn(f,"path",{d:!0}),V(n).forEach(M),a=zn(f,"path",{d:!0,fill:!0,style:!0,class:!0}),V(a).forEach(M),i=zn(f,"path",{d:!0,fill:!0,class:!0}),V(i).forEach(M),f.forEach(M),u.forEach(M),this.h()},h(){F(n,"d","M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"),F(a,"d","M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"),F(a,"fill","currentColor"),Ln(a,"transform-origin","130px 106px"),F(a,"class","octo-arm"),F(i,"d","M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"),F(i,"fill","currentColor"),F(i,"class","octo-body"),F(r,"width","80"),F(r,"height","80"),F(r,"viewBox","0 0 250 250"),Ln(r,"fill","#151513"),Ln(r,"color","#fff"),Ln(r,"position","absolute"),Ln(r,"top","0"),Ln(r,"border","0"),Ln(r,"right","0"),F(r,"aria-hidden","true"),F(t,"href",dnt),F(t,"class","github-corner"),F(t,"aria-label","View source on GitHub")},m(s,u){q(s,t,u),j(t,r),j(r,n),j(r,a),j(r,i)},p:se,i:se,o:se,d(s){s&&M(t)}}}const dnt="https://github.com/aotds/aotds-docks";class gnt extends Ct{constructor(t){super();Ot(this,t,null,vnt,At,{})}}function _nt(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_,m,b,y,w,C,T,A,x;return{c(){t=k("p"),r=mt(`This app is a ship builder for the game
|
|
`),n=k("a"),a=mt("Full Thrust"),i=mt(`
|
|
.`),s=ht(),u=k("p"),f=mt(`The contruction rules are following the
|
|
`),c=k("a"),h=mt("Cross Dimensions rules"),p=mt(`
|
|
as closely as possible.`),v=ht(),g=k("p"),_=mt(`The app is mostly developed for Firefox. I also check as much as I can that
|
|
I don't mess things too badly on Chrome. For the other browsers... caveat
|
|
emptor.`),m=ht(),b=k("p"),y=mt(`Written by
|
|
`),w=k("a"),C=mt("Yanick Champoux"),T=mt(`
|
|
. Code available on
|
|
`),A=k("a"),x=mt("Github"),this.h()},l(I){t=H(I,"P",{class:!0});var B=V(t);r=$t(B,`This app is a ship builder for the game
|
|
`),n=H(B,"A",{href:!0});var P=V(n);a=$t(P,"Full Thrust"),P.forEach(M),i=$t(B,`
|
|
.`),B.forEach(M),s=pt(I),u=H(I,"P",{class:!0});var L=V(u);f=$t(L,`The contruction rules are following the
|
|
`),c=H(L,"A",{href:!0});var G=V(c);h=$t(G,"Cross Dimensions rules"),G.forEach(M),p=$t(L,`
|
|
as closely as possible.`),L.forEach(M),v=pt(I),g=H(I,"P",{class:!0});var K=V(g);_=$t(K,`The app is mostly developed for Firefox. I also check as much as I can that
|
|
I don't mess things too badly on Chrome. For the other browsers... caveat
|
|
emptor.`),K.forEach(M),m=pt(I),b=H(I,"P",{class:!0});var at=V(b);y=$t(at,`Written by
|
|
`),w=H(at,"A",{href:!0});var et=V(w);C=$t(et,"Yanick Champoux"),et.forEach(M),T=$t(at,`
|
|
. Code available on
|
|
`),A=H(at,"A",{href:!0});var rt=V(A);x=$t(rt,"Github"),rt.forEach(M),at.forEach(M),this.h()},h(){F(n,"href","https://shop.groundzerogames.co.uk/rules.html"),F(t,"class","svelte-1mk8yef"),F(c,"href","http://members.ozemail.com.au/~laranzu/fullthrust/rules/"),F(u,"class","svelte-1mk8yef"),F(g,"class","svelte-1mk8yef"),F(w,"href","https://twitter.com/yenzie"),F(A,"href","https://github.com/aotds/aotds-shipyard"),F(b,"class","svelte-1mk8yef")},m(I,B){q(I,t,B),j(t,r),j(t,n),j(n,a),j(t,i),q(I,s,B),q(I,u,B),j(u,f),j(u,c),j(c,h),j(u,p),q(I,v,B),q(I,g,B),j(g,_),q(I,m,B),q(I,b,B),j(b,y),j(b,w),j(w,C),j(b,T),j(b,A),j(A,x)},d(I){I&&M(t),I&&M(s),I&&M(u),I&&M(v),I&&M(g),I&&M(m),I&&M(b)}}}function mnt(e){let t,r;return{c(){t=k("h2"),r=mt("Welcome to the docks"),this.h()},l(n){t=H(n,"H2",{slot:!0,class:!0});var a=V(t);r=$t(a,"Welcome to the docks"),a.forEach(M),this.h()},h(){F(t,"slot","header"),F(t,"class","svelte-1mk8yef")},m(n,a){q(n,t,a),j(t,r)},d(n){n&&M(t)}}}function $nt(e){let t;return{c(){t=k("div"),this.h()},l(r){t=H(r,"DIV",{slot:!0}),V(t).forEach(M),this.h()},h(){F(t,"slot","footer")},m(r,n){q(r,t,n)},d(r){r&&M(t)}}}function bnt(e){let t,r;return t=new int({props:{$$slots:{footer:[$nt],header:[mnt],default:[_nt]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&1&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}class ynt extends Ct{constructor(t){super();Ot(this,t,null,bnt,At,{})}}function wnt(e){let t;return{c(){t=mt("editor")},l(r){t=$t(r,"editor")},m(r,n){q(r,t,n)},d(r){r&&M(t)}}}function Snt(e){let t;return{c(){t=mt("json view")},l(r){t=$t(r,"json view")},m(r,n){q(r,t,n)},d(r){r&&M(t)}}}function Ent(e){let t;return{c(){t=mt("print view")},l(r){t=$t(r,"print view")},m(r,n){q(r,t,n)},d(r){r&&M(t)}}}function Cnt(e){let t,r,n,a,i,s;return t=new vc({props:{tabid:"editor",$$slots:{default:[wnt]},$$scope:{ctx:e}}}),n=new vc({props:{tabid:"json",$$slots:{default:[Snt]},$$scope:{ctx:e}}}),i=new vc({props:{tabid:"print",$$slots:{default:[Ent]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment),r=ht(),st(n.$$.fragment),a=ht(),st(i.$$.fragment)},l(u){ft(t.$$.fragment,u),r=pt(u),ft(n.$$.fragment,u),a=pt(u),ft(i.$$.fragment,u)},m(u,f){ot(t,u,f),q(u,r,f),ot(n,u,f),q(u,a,f),ot(i,u,f),s=!0},p(u,f){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),t.$set(c);const h={};f&64&&(h.$$scope={dirty:f,ctx:u}),n.$set(h);const p={};f&64&&(p.$$scope={dirty:f,ctx:u}),i.$set(p)},i(u){s||(W(t.$$.fragment,u),W(n.$$.fragment,u),W(i.$$.fragment,u),s=!0)},o(u){X(t.$$.fragment,u),X(n.$$.fragment,u),X(i.$$.fragment,u),s=!1},d(u){ut(t,u),u&&M(r),ut(n,u),u&&M(a),ut(i,u)}}}function Ont(e){let t,r;return t=new ynt({}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Ant(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_,m,b,y,w,C,T,A,x;function I(G){e[3](G)}let B={$$slots:{default:[Cnt]},$$scope:{ctx:e}};e[0]!==void 0&&(B.active=e[0]),m=new unt({props:B}),Nn.push(()=>Pc(m,"active",I));function P(G){e[4](G)}let L={$$slots:{default:[Ont]},$$scope:{ctx:e}};return e[1]!==void 0&&(L.open=e[1]),w=new pnt({props:L}),Nn.push(()=>Pc(w,"open",P)),{c(){t=k("header"),r=k("h1"),n=mt("The Docks"),a=ht(),i=k("h2"),s=mt("a "),u=k("a"),f=mt("Full Thrust"),c=mt(" ship builder"),h=ht(),p=k("a"),v=mt("about the app"),g=ht(),_=k("div"),st(m.$$.fragment),y=ht(),st(w.$$.fragment),this.h()},l(G){t=H(G,"HEADER",{class:!0});var K=V(t);r=H(K,"H1",{class:!0});var at=V(r);n=$t(at,"The Docks"),at.forEach(M),a=pt(K),i=H(K,"H2",{class:!0});var et=V(i);s=$t(et,"a "),u=H(et,"A",{href:!0});var rt=V(u);f=$t(rt,"Full Thrust"),rt.forEach(M),c=$t(et," ship builder"),et.forEach(M),h=pt(K),p=H(K,"A",{class:!0});var gt=V(p);v=$t(gt,"about the app"),gt.forEach(M),K.forEach(M),g=pt(G),_=H(G,"DIV",{class:!0});var Z=V(_);ft(m.$$.fragment,Z),Z.forEach(M),y=pt(G),ft(w.$$.fragment,G),this.h()},h(){F(r,"class","svelte-uwt8cz"),F(u,"href","https://shop.groundzerogames.co.uk/rules.html"),F(i,"class","svelte-uwt8cz"),F(p,"class","svelte-uwt8cz"),F(t,"class","svelte-uwt8cz"),F(_,"class","svelte-uwt8cz")},m(G,K){q(G,t,K),j(t,r),j(r,n),j(t,a),j(t,i),j(i,s),j(i,u),j(u,f),j(i,c),j(t,h),j(t,p),j(p,v),q(G,g,K),q(G,_,K),ot(m,_,null),q(G,y,K),ot(w,G,K),T=!0,A||(x=ae(p,"click",p$(e[2])),A=!0)},p(G,[K]){const at={};K&64&&(at.$$scope={dirty:K,ctx:G}),!b&&K&1&&(b=!0,at.active=G[0],xc(()=>b=!1)),m.$set(at);const et={};K&64&&(et.$$scope={dirty:K,ctx:G}),!C&&K&2&&(C=!0,et.open=G[1],xc(()=>C=!1)),w.$set(et)},i(G){T||(W(m.$$.fragment,G),W(w.$$.fragment,G),T=!0)},o(G){X(m.$$.fragment,G),X(w.$$.fragment,G),T=!1},d(G){G&&M(t),G&&M(g),G&&M(_),ut(m),G&&M(y),ut(w,G),A=!1,x()}}}function Tnt(e,t,r){let n=!1,a="editor";const i=Wa(),s=()=>r(1,n=!0);function u(c){a=c,r(0,a)}function f(c){n=c,r(1,n)}return e.$$.update=()=>{e.$$.dirty&1&&i("changeTab",a)},[a,n,s,u,f]}class Mnt extends Ct{constructor(t){super();Ot(this,t,Tnt,Ant,At,{})}}function j_(e){let t,r;return{c(){t=k("label"),r=mt(e[1]),this.h()},l(n){t=H(n,"LABEL",{class:!0});var a=V(t);r=$t(a,e[1]),a.forEach(M),this.h()},h(){F(t,"class","svelte-i3mp3j")},m(n,a){q(n,t,a),j(t,r)},p(n,a){a&2&&er(r,n[1])},d(n){n&&M(t)}}}function Pnt(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{type:!0,placeholder:!0}),this.h()},h(){F(t,"type","text"),F(t,"placeholder",e[2])},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=[ae(t,"input",e[6]),ae(t,"change",e[5])],r=!0)},p(a,i){i&4&&F(t,"placeholder",a[2]),i&1&&t.value!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,io(n)}}}function xnt(e){let t,r,n,a=e[1]&&j_(e);const i=e[4].default,s=bn(i,e,e[3],null),u=s||Pnt(e);return{c(){t=k("div"),a&&a.c(),r=ht(),u&&u.c(),this.h()},l(f){t=H(f,"DIV",{class:!0});var c=V(t);a&&a.l(c),r=pt(c),u&&u.l(c),c.forEach(M),this.h()},h(){F(t,"class","svelte-i3mp3j")},m(f,c){q(f,t,c),a&&a.m(t,null),j(t,r),u&&u.m(t,null),n=!0},p(f,[c]){f[1]?a?a.p(f,c):(a=j_(f),a.c(),a.m(t,r)):a&&(a.d(1),a=null),s?s.p&&(!n||c&8)&&_n(s,i,f,f[3],n?$n(i,f[3],c,null):mn(f[3]),null):u&&u.p&&(!n||c&5)&&u.p(f,n?c:-1)},i(f){n||(W(u,f),n=!0)},o(f){X(u,f),n=!1},d(f){f&&M(t),a&&a.d(),u&&u.d(f)}}}function Int(e,t,r){let{$$slots:n={},$$scope:a}=t,{label:i=""}=t,{value:s=""}=t,{placeholder:u}=t;function f(h){Fh.call(this,e,h)}function c(){s=this.value,r(0,s)}return e.$$set=h=>{"label"in h&&r(1,i=h.label),"value"in h&&r(0,s=h.value),"placeholder"in h&&r(2,u=h.placeholder),"$$scope"in h&&r(3,a=h.$$scope)},[s,i,u,a,n,f,c]}class qe extends Ct{constructor(t){super();Ot(this,t,Int,xnt,At,{label:1,value:0,placeholder:2})}}const Dnt=[{name:"Scout",mass:[0,10],abbrev:"SC"},{name:"Courier",mass:[4,10],abbrev:"SC"},{name:"Corvette",mass:[8,16],abbrev:"CT"},{name:"Frigate",mass:[14,28],abbrev:"FF"},{name:"Destroyer",mass:[24,36],abbrev:"DD"},{name:"Heavy Destroyer",mass:[30,40],abbrev:"DH"},{name:"Light Cruiser",mass:[40,60],abbrev:"CL"},{name:"Patrol",mass:[50,70],abbrev:"CE"},{name:"Escort Cruiser",mass:[50,70],abbrev:"CE"},{name:"Heavy Cruiser",mass:[60,90],abbrev:"CA"},{name:"Battlecruiser",mass:[80,110],abbrev:"BC"},{name:"Battleship",mass:[100,140],abbrev:"BB"},{name:"Heavy Battleship",mass:[120,160],abbrev:"BDN"},{name:"Dreadnought",mass:[140,180],abbrev:"DN"},{name:"Superdreadnought",mass:[160,300],abbrev:"SDN"},{name:"Escort Carrier",mass:[0,140],abbrev:"CVE",carrier:!0},{name:"Light Carrier",mass:[120,180],abbrev:"CVL",carrier:!0},{name:"Heavy Carrier",mass:[160,300],abbrev:"CVH",carrier:!0},{name:"Attack Carrier",mass:[150,300],abbrev:"CVA",carrier:!0}];function Rnt(e=0,t=!1){return Dnt.filter(r=>t==!!r.carrier).filter(r=>r.mass[0]<=e).filter(r=>r.mass[1]>=e)}function q_(e,t,r){const n=e.slice();return n[8]=t[r],n}function U_(e,t){let r,n=t[8]+"",a,i;return{key:e,first:null,c(){r=k("option"),a=mt(n),this.h()},l(s){r=H(s,"OPTION",{});var u=V(r);a=$t(u,n),u.forEach(M),this.h()},h(){r.__value=i=t[8],r.value=r.__value,this.first=r},m(s,u){q(s,r,u),j(r,a)},p(s,u){t=s,u&4&&n!==(n=t[8]+"")&&er(a,n),u&4&&i!==(i=t[8])&&(r.__value=i,r.value=r.__value)},d(s){s&&M(r)}}}function Bnt(e){let t,r=[],n=new Map,a,i,s=e[2];const u=f=>f[8];for(let f=0;f<s.length;f+=1){let c=q_(e,s,f),h=u(c);n.set(h,r[f]=U_(h,c))}return{c(){t=k("select");for(let f=0;f<r.length;f+=1)r[f].c();this.h()},l(f){t=H(f,"SELECT",{});var c=V(t);for(let h=0;h<r.length;h+=1)r[h].l(c);c.forEach(M),this.h()},h(){e[1]===void 0&&Ni(()=>e[6].call(t))},m(f,c){q(f,t,c);for(let h=0;h<r.length;h+=1)r[h].m(t,null);vn(t,e[1]),a||(i=ae(t,"change",e[6]),a=!0)},p(f,c){c&4&&(s=f[2],r=Hr(r,c,u,1,f,s,n,t,$a,U_,null,q_)),c&6&&vn(t,f[1])},d(f){f&&M(t);for(let c=0;c<r.length;c+=1)r[c].d();a=!1,i()}}}function Lnt(e){let t,r,n,a,i,s;function u(c){e[5](c)}let f={label:"ship class"};return e[0]!==void 0&&(f.value=e[0]),r=new qe({props:f}),Nn.push(()=>Pc(r,"value",u)),i=new qe({props:{label:"ship type",$$slots:{default:[Bnt]},$$scope:{ctx:e}}}),{c(){t=k("div"),st(r.$$.fragment),a=ht(),st(i.$$.fragment),this.h()},l(c){t=H(c,"DIV",{class:!0});var h=V(t);ft(r.$$.fragment,h),a=pt(h),ft(i.$$.fragment,h),h.forEach(M),this.h()},h(){F(t,"class","svelte-fc2507")},m(c,h){q(c,t,h),ot(r,t,null),j(t,a),ot(i,t,null),s=!0},p(c,[h]){const p={};!n&&h&1&&(n=!0,p.value=c[0],xc(()=>n=!1)),r.$set(p);const v={};h&2054&&(v.$$scope={dirty:h,ctx:c}),i.$set(v)},i(c){s||(W(r.$$.fragment,c),W(i.$$.fragment,c),s=!0)},o(c){X(r.$$.fragment,c),X(i.$$.fragment,c),s=!1},d(c){c&&M(t),ut(r),ut(i)}}}function Fnt(e,t,r){let n,{shipClass:a=""}=t,{shipType:i=""}=t,{mass:s=10}=t,{isCarrier:u=!1}=t;const f=Ne("ship");function c(p){a=p,r(0,a)}function h(){i=js(this),r(1,i),r(2,n),r(3,s),r(4,u),r(2,n),r(3,s),r(4,u)}return e.$$set=p=>{"shipClass"in p&&r(0,a=p.shipClass),"shipType"in p&&r(1,i=p.shipType),"mass"in p&&r(3,s=p.mass),"isCarrier"in p&&r(4,u=p.isCarrier)},e.$$.update=()=>{e.$$.dirty&24&&r(2,n=Rnt(s,u).map(({name:p})=>p)),e.$$.dirty&6&&n.length>0&&!n.includes(i)&&r(1,i=n[0]),e.$$.dirty&2&&f.dispatch.setShipType(i),e.$$.dirty&1&&f.dispatch.setShipClass(a)},[a,i,n,s,u,c,h]}class znt extends Ct{constructor(t){super();Ot(this,t,Fnt,Lnt,At,{shipClass:0,shipType:1,mass:3,isCarrier:4})}}function Gnt(e){let t,r=-e[2]+"",n;return{c(){t=mt("excessive mass: "),n=mt(r)},l(a){t=$t(a,"excessive mass: "),n=$t(a,r)},m(a,i){q(a,t,i),q(a,n,i)},p(a,i){i&4&&r!==(r=-a[2]+"")&&er(n,r)},d(a){a&&M(t),a&&M(n)}}}function Nnt(e){let t,r;return{c(){t=mt("mass unused: "),r=mt(e[2])},l(n){t=$t(n,"mass unused: "),r=$t(n,e[2])},m(n,a){q(n,t,a),q(n,r,a)},p(n,a){a&4&&er(r,n[2])},d(n){n&&M(t),n&&M(r)}}}function jnt(e){let t,r,n,a,i,s,u,f;function c(v,g){return v[3]?Nnt:Gnt}let h=c(e),p=h(e);return{c(){t=k("input"),r=ht(),n=k("img"),i=ht(),s=k("div"),p.c(),this.h()},l(v){t=H(v,"INPUT",{class:!0,type:!0,min:!0,max:!0}),r=pt(v),n=H(v,"IMG",{class:!0,src:!0,alt:!0}),i=pt(v),s=H(v,"DIV",{class:!0});var g=V(s);p.l(g),g.forEach(M),this.h()},h(){F(t,"class","short svelte-apsdjz"),F(t,"type","number"),F(t,"min","10"),F(t,"max","300"),F(n,"class","mass_symbol svelte-apsdjz"),kn(n.src,a=yn+"/mass.svg")||F(n,"src",a),F(n,"alt","mass"),F(s,"class","note svelte-apsdjz"),Me(s,"warning",!e[3])},m(v,g){q(v,t,g),xe(t,e[0]),q(v,r,g),q(v,n,g),q(v,i,g),q(v,s,g),p.m(s,null),u||(f=ae(t,"input",e[6]),u=!0)},p(v,g){g&1&&Be(t.value)!==v[0]&&xe(t,v[0]),h===(h=c(v))&&p?p.p(v,g):(p.d(1),p=h(v),p&&(p.c(),p.m(s,null))),g&8&&Me(s,"warning",!v[3])},d(v){v&&M(t),v&&M(r),v&&M(n),v&&M(i),v&&M(s),p.d(),u=!1,f()}}}function qnt(e){let t,r;return{c(){t=k("span"),r=mt(e[1]),this.h()},l(n){t=H(n,"SPAN",{class:!0});var a=V(t);r=$t(a,e[1]),a.forEach(M),this.h()},h(){F(t,"class","cost svelte-apsdjz")},m(n,a){q(n,t,a),j(t,r)},p(n,a){a&2&&er(r,n[1])},d(n){n&&M(t)}}}function Unt(e){let t,r,n,a,i,s;return r=new qe({props:{label:"ship tonnage",$$slots:{default:[jnt]},$$scope:{ctx:e}}}),i=new qe({props:{label:"cost",$$slots:{default:[qnt]},$$scope:{ctx:e}}}),{c(){t=k("div"),st(r.$$.fragment),n=ht(),a=k("div"),st(i.$$.fragment),this.h()},l(u){t=H(u,"DIV",{class:!0});var f=V(t);ft(r.$$.fragment,f),f.forEach(M),n=pt(u),a=H(u,"DIV",{class:!0});var c=V(a);ft(i.$$.fragment,c),c.forEach(M),this.h()},h(){F(t,"class","mass svelte-apsdjz"),F(a,"class","cost svelte-apsdjz")},m(u,f){q(u,t,f),ot(r,t,null),q(u,n,f),q(u,a,f),ot(i,a,null),s=!0},p(u,[f]){const c={};f&141&&(c.$$scope={dirty:f,ctx:u}),r.$set(c);const h={};f&130&&(h.$$scope={dirty:f,ctx:u}),i.$set(h)},i(u){s||(W(r.$$.fragment,u),W(i.$$.fragment,u),s=!0)},o(u){X(r.$$.fragment,u),X(i.$$.fragment,u),s=!1},d(u){u&&M(t),ut(r),u&&M(n),u&&M(a),ut(i)}}}function knt(e,t,r){let n,a,{ship:i=Ne("ship")}=t,{mass:s=10}=t,{cost:u=10}=t,{usedMass:f=5}=t;function c(){s=Be(this.value),r(0,s)}return e.$$set=h=>{"ship"in h&&r(4,i=h.ship),"mass"in h&&r(0,s=h.mass),"cost"in h&&r(1,u=h.cost),"usedMass"in h&&r(5,f=h.usedMass)},e.$$.update=()=>{e.$$.dirty&33&&r(2,n=s-f),e.$$.dirty&4&&r(3,a=n>=0),e.$$.dirty&17&&i.dispatch.setShipMass(s)},[s,u,n,a,i,f,c]}class Hnt extends Ct{constructor(t){super();Ot(this,t,knt,Unt,At,{ship:4,mass:0,cost:1,usedMass:5})}}function Wnt(e){let t,r,n,a,i,s,u;const f=e[2].default,c=bn(f,e,e[1],null);return{c(){t=k("div"),r=k("h2"),n=mt(e[0]),a=ht(),i=k("hr"),s=ht(),c&&c.c(),this.h()},l(h){t=H(h,"DIV",{class:!0});var p=V(t);r=H(p,"H2",{class:!0});var v=V(r);n=$t(v,e[0]),v.forEach(M),a=pt(p),i=H(p,"HR",{class:!0}),p.forEach(M),s=pt(h),c&&c.l(h),this.h()},h(){F(r,"class","svelte-1p2uzx8"),F(i,"class","svelte-1p2uzx8"),F(t,"class","svelte-1p2uzx8")},m(h,p){q(h,t,p),j(t,r),j(r,n),j(t,a),j(t,i),q(h,s,p),c&&c.m(h,p),u=!0},p(h,[p]){(!u||p&1)&&er(n,h[0]),c&&c.p&&(!u||p&2)&&_n(c,f,h,h[1],u?$n(f,h[1],p,null):mn(h[1]),null)},i(h){u||(W(c,h),u=!0)},o(h){X(c,h),u=!1},d(h){h&&M(t),h&&M(s),c&&c.d(h)}}}function Knt(e,t,r){let{$$slots:n={},$$scope:a}=t,{label:i}=t;return e.$$set=s=>{"label"in s&&r(0,i=s.label),"$$scope"in s&&r(1,a=s.$$scope)},[i,a,n]}class wf extends Ct{constructor(t){super();Ot(this,t,Knt,Wnt,At,{label:0})}}function Ynt(e){let t,r,n,a,i,s,u,f,c,h,p,v,g;const _=e[5].default,m=bn(_,e,e[4],null);return{c(){t=k("div"),r=k("div"),m&&m.c(),n=ht(),a=k("div"),i=k("div"),s=mt(e[0]),u=ht(),f=k("img"),h=ht(),p=k("div"),v=mt(e[1]),this.h()},l(b){t=H(b,"DIV",{class:!0});var y=V(t);r=H(y,"DIV",{class:!0});var w=V(r);m&&m.l(w),w.forEach(M),n=pt(y),a=H(y,"DIV",{class:!0});var C=V(a);i=H(C,"DIV",{class:!0});var T=V(i);s=$t(T,e[0]),u=pt(T),f=H(T,"IMG",{src:!0,alt:!0,class:!0}),T.forEach(M),h=pt(C),p=H(C,"DIV",{class:!0});var A=V(p);v=$t(A,e[1]),A.forEach(M),C.forEach(M),y.forEach(M),this.h()},h(){F(r,"class","svelte-145f253"),kn(f.src,c=yn+"/mass.svg")||F(f,"src",c),F(f,"alt","mass"),F(f,"class","svelte-145f253"),F(i,"class","mass svelte-145f253"),F(p,"class","cost svelte-145f253"),F(a,"class","reqs svelte-145f253"),F(t,"class","ship-item svelte-145f253")},m(b,y){q(b,t,y),j(t,r),m&&m.m(r,null),j(t,n),j(t,a),j(a,i),j(i,s),j(i,u),j(i,f),e[6](i),j(a,h),j(a,p),j(p,v),e[7](p),g=!0},p(b,[y]){m&&m.p&&(!g||y&16)&&_n(m,_,b,b[4],g?$n(_,b[4],y,null):mn(b[4]),null),(!g||y&1)&&er(s,b[0]),(!g||y&2)&&er(v,b[1])},i(b){g||(W(m,b),g=!0)},o(b){X(m,b),g=!1},d(b){b&&M(t),m&&m.d(b),e[6](null),e[7](null)}}}function Xnt(e,t,r){let{$$slots:n={},$$scope:a}=t,{mass:i}=t,{cost:s}=t,u,f;const c=async v=>{!v||(v.classList.remove("updated"),v.offsetWidth,v.classList.add("updated"))};function h(v){Nn[v?"unshift":"push"](()=>{u=v,r(2,u)})}function p(v){Nn[v?"unshift":"push"](()=>{f=v,r(3,f)})}return e.$$set=v=>{"mass"in v&&r(0,i=v.mass),"cost"in v&&r(1,s=v.cost),"$$scope"in v&&r(4,a=v.$$scope)},e.$$.update=()=>{e.$$.dirty&5&&c(u),e.$$.dirty&10&&c(f)},[i,s,u,f,a,n,h,p]}class Wr extends Ct{constructor(t){super();Ot(this,t,Xnt,Ynt,At,{mass:0,cost:1})}}function Vnt(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0,max:!0,step:!0}),this.h()},h(){F(t,"class","short svelte-1saxaj4"),F(t,"type","number"),F(t,"min","0"),F(t,"max","20"),F(t,"step","1")},m(a,i){q(a,t,i),xe(t,e[1]),r||(n=ae(t,"input",e[3]),r=!0)},p(a,i){i&2&&Be(t.value)!==a[1]&&xe(t,a[1])},d(a){a&&M(t),r=!1,n()}}}function Znt(e){let t,r,n,a,i,s,u,f,c;return r=new qe({props:{label:"thrust rating",$$slots:{default:[Vnt]},$$scope:{ctx:e}}}),{c(){t=k("div"),st(r.$$.fragment),n=ht(),a=k("label"),i=k("input"),s=mt(" advanced"),this.h()},l(h){t=H(h,"DIV",{class:!0});var p=V(t);ft(r.$$.fragment,p),n=pt(p),a=H(p,"LABEL",{class:!0});var v=V(a);i=H(v,"INPUT",{type:!0}),s=$t(v," advanced"),v.forEach(M),p.forEach(M),this.h()},h(){F(i,"type","checkbox"),F(a,"class","svelte-1saxaj4"),F(t,"class","svelte-1saxaj4")},m(h,p){q(h,t,p),ot(r,t,null),j(t,n),j(t,a),j(a,i),i.checked=e[0],j(a,s),u=!0,f||(c=ae(i,"change",e[4]),f=!0)},p(h,p){const v={};p&66&&(v.$$scope={dirty:p,ctx:h}),r.$set(v),p&1&&(i.checked=h[0])},i(h){u||(W(r.$$.fragment,h),u=!0)},o(h){X(r.$$.fragment,h),u=!1},d(h){h&&M(t),ut(r),f=!1,c()}}}function Jnt(e){let t,r;const n=[e[2]];let a={$$slots:{default:[Znt]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&4?ne(n,[ue(i[2])]):{};s&67&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function Qnt(e,t,r){let{reqs:n={}}=t,{advanced:a=!1}=t,{rating:i=0}=t;const s=Ne("ship");function u(){i=Be(this.value),r(1,i)}function f(){a=this.checked,r(0,a)}return e.$$set=c=>{"reqs"in c&&r(2,n=c.reqs),"advanced"in c&&r(0,a=c.advanced),"rating"in c&&r(1,i=c.rating)},e.$$.update=()=>{e.$$.dirty&3&&s.dispatch.setDrive({rating:i,advanced:a})},[a,i,n,u,f]}class tat extends Ct{constructor(t){super();Ot(this,t,Qnt,Jnt,At,{reqs:2,advanced:0,rating:1})}}function k_(e,t,r){const n=e.slice();return n[6]=t[r],n}function H_(e,t){let r,n,a,i=t[6]+"",s,u,f,c;return{key:e,first:null,c(){r=k("label"),n=k("input"),a=ht(),s=mt(i),u=ht(),this.h()},l(h){r=H(h,"LABEL",{class:!0});var p=V(r);n=H(p,"INPUT",{type:!0}),a=pt(p),s=$t(p,i),u=pt(p),p.forEach(M),this.h()},h(){F(n,"type","radio"),n.__value=t[6],n.value=n.__value,t[4][0].push(n),F(r,"class","svelte-9i3z5u"),this.first=r},m(h,p){q(h,r,p),j(r,n),n.checked=n.__value===t[0],j(r,a),j(r,s),j(r,u),f||(c=ae(n,"change",t[3]),f=!0)},p(h,p){t=h,p&1&&(n.checked=n.__value===t[0])},d(h){h&&M(r),t[4][0].splice(t[4][0].indexOf(n),1),f=!1,c()}}}function eat(e){let t=[],r=new Map,n,a=e[2];const i=s=>s[6];for(let s=0;s<a.length;s+=1){let u=k_(e,a,s),f=i(u);r.set(f,t[s]=H_(f,u))}return{c(){for(let s=0;s<t.length;s+=1)t[s].c();n=je()},l(s){for(let u=0;u<t.length;u+=1)t[u].l(s);n=je()},m(s,u){for(let f=0;f<t.length;f+=1)t[f].m(s,u);q(s,n,u)},p(s,u){u&5&&(a=s[2],t=Hr(t,u,i,1,s,a,r,n.parentNode,$a,H_,n,k_))},d(s){for(let u=0;u<t.length;u+=1)t[u].d(s);s&&M(n)}}}function rat(e){let t,r;return t=new qe({props:{label:"FTL drive",$$slots:{default:[eat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&513&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function nat(e){let t,r;const n=[e[1]];let a={$$slots:{default:[rat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&513&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function aat(e,t,r){const n=["none","standard","advanced"];let{reqs:a={}}=t,{type:i=n[0]}=t;const s=Ne("ship"),u=[[]];function f(){i=this.__value,r(0,i)}return e.$$set=c=>{"reqs"in c&&r(1,a=c.reqs),"type"in c&&r(0,i=c.type)},e.$$.update=()=>{e.$$.dirty&1&&s.dispatch.setFtl(i)},[i,a,n,f,u]}class iat extends Ct{constructor(t){super();Ot(this,t,aat,nat,At,{reqs:1,type:0})}}function sat(e){let t,r,n,a;const i=[e[0].drive];let s={};for(let c=0;c<i.length;c+=1)s=Bt(s,i[c]);t=new tat({props:s});const u=[e[0].ftl];let f={};for(let c=0;c<u.length;c+=1)f=Bt(f,u[c]);return n=new iat({props:f}),{c(){st(t.$$.fragment),r=ht(),st(n.$$.fragment)},l(c){ft(t.$$.fragment,c),r=pt(c),ft(n.$$.fragment,c)},m(c,h){ot(t,c,h),q(c,r,h),ot(n,c,h),a=!0},p(c,h){const p=h&1?ne(i,[ue(c[0].drive)]):{};t.$set(p);const v=h&1?ne(u,[ue(c[0].ftl)]):{};n.$set(v)},i(c){a||(W(t.$$.fragment,c),W(n.$$.fragment,c),a=!0)},o(c){X(t.$$.fragment,c),X(n.$$.fragment,c),a=!1},d(c){ut(t,c),c&&M(r),ut(n,c)}}}function oat(e){let t,r;return t=new wf({props:{label:"propulsion",$$slots:{default:[sat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&3&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function uat(e,t,r){let{propulsion:n={}}=t;return e.$$set=a=>{"propulsion"in a&&r(0,n=a.propulsion)},[n]}class fat extends Ct{constructor(t){super();Ot(this,t,uat,oat,At,{propulsion:0})}}function lat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0,max:!0}),this.h()},h(){F(t,"class","short svelte-ytqr7l"),F(t,"type","number"),F(t,"min",e[2]),F(t,"max",e[3])},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[4]),r=!0)},p(a,i){i&4&&F(t,"min",a[2]),i&8&&F(t,"max",a[3]),i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function cat(e){let t,r;return t=new qe({props:{label:"hull",$$slots:{default:[lat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&77&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function hat(e){let t,r;const n=[e[1]];let a={$$slots:{default:[cat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&77&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function pat(e,t,r){let{rating:n=0}=t,{reqs:a={}}=t,{min:i=0}=t,{max:s=1}=t;const u=Ne("ship");function f(){n=Be(this.value),r(0,n)}return e.$$set=c=>{"rating"in c&&r(0,n=c.rating),"reqs"in c&&r(1,a=c.reqs),"min"in c&&r(2,i=c.min),"max"in c&&r(3,s=c.max)},e.$$.update=()=>{e.$$.dirty&1&&u.dispatch.setHull(n)},[n,a,i,s,f]}class vat extends Ct{constructor(t){super();Ot(this,t,pat,hat,At,{rating:0,reqs:1,min:2,max:3})}}function dat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-1wwwskr"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[3]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function gat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-1wwwskr"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[1]),r||(n=ae(t,"input",e[4]),r=!0)},p(a,i){i&2&&Be(t.value)!==a[1]&&xe(t,a[1])},d(a){a&&M(t),r=!1,n()}}}function _at(e){let t,r,n,a,i;return r=new qe({props:{label:"screens",$$slots:{default:[dat]},$$scope:{ctx:e}}}),a=new qe({props:{label:"advanced screens",$$slots:{default:[gat]},$$scope:{ctx:e}}}),{c(){t=k("div"),st(r.$$.fragment),n=ht(),st(a.$$.fragment),this.h()},l(s){t=H(s,"DIV",{class:!0});var u=V(t);ft(r.$$.fragment,u),n=pt(u),ft(a.$$.fragment,u),u.forEach(M),this.h()},h(){F(t,"class","svelte-1wwwskr")},m(s,u){q(s,t,u),ot(r,t,null),j(t,n),ot(a,t,null),i=!0},p(s,u){const f={};u&65&&(f.$$scope={dirty:u,ctx:s}),r.$set(f);const c={};u&66&&(c.$$scope={dirty:u,ctx:s}),a.$set(c)},i(s){i||(W(r.$$.fragment,s),W(a.$$.fragment,s),i=!0)},o(s){X(r.$$.fragment,s),X(a.$$.fragment,s),i=!1},d(s){s&&M(t),ut(r),ut(a)}}}function mat(e){let t,r;const n=[e[2]];let a={$$slots:{default:[_at]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&4?ne(n,[ue(i[2])]):{};s&67&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function $at(e,t,r){let{reqs:n={}}=t,{standard:a=0}=t,{advanced:i=0}=t;const s=Ne("ship");function u(){a=Be(this.value),r(0,a)}function f(){i=Be(this.value),r(1,i)}return e.$$set=c=>{"reqs"in c&&r(2,n=c.reqs),"standard"in c&&r(0,a=c.standard),"advanced"in c&&r(1,i=c.advanced)},e.$$.update=()=>{e.$$.dirty&3&&s.dispatch.setScreens({standard:a,advanced:i})},[a,i,n,u,f]}class bat extends Ct{constructor(t){super();Ot(this,t,$at,mat,At,{reqs:2,standard:0,advanced:1})}}function yat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-ytqr7l"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[3]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function wat(e){let t,r;return t=new qe({props:{label:"cargo",$$slots:{default:[yat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&17&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Sat(e){let t,r;const n=[e[1]];let a={$$slots:{default:[wat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&17&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function Eat(e,t,r){let{ship:n=Ne("ship")}=t,{space:a=0}=t,{reqs:i={}}=t;function s(){a=Be(this.value),r(0,a)}return e.$$set=u=>{"ship"in u&&r(2,n=u.ship),"space"in u&&r(0,a=u.space),"reqs"in u&&r(1,i=u.reqs)},e.$$.update=()=>{e.$$.dirty&5&&n.dispatch.setCargo(a)},[a,i,n,s]}class Cat extends Ct{constructor(t){super();Ot(this,t,Eat,Sat,At,{ship:2,space:0,reqs:1})}}function Oat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-ytqr7l"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[2]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function Aat(e){let t,r;return t=new qe({props:{label:`layer ${e[1]}`,$$slots:{default:[Oat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&2&&(i.label=`layer ${n[1]}`),a&17&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Tat(e,t,r){let{layer:n=1}=t,{rating:a=0}=t;const i=Ne("ship");function s(){a=Be(this.value),r(0,a)}return e.$$set=u=>{"layer"in u&&r(1,n=u.layer),"rating"in u&&r(0,a=u.rating)},e.$$.update=()=>{e.$$.dirty&3&&i.dispatch.setArmorRating({layer:n,rating:a})},[a,n,s]}class Mat extends Ct{constructor(t){super();Ot(this,t,Tat,Aat,At,{layer:1,rating:0})}}function W_(e,t,r){const n=e.slice();return n[5]=t[r],n[7]=r,n}function Pat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-n2prux"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[2]),r||(n=ae(t,"input",e[3]),r=!0)},p(a,i){i&4&&Be(t.value)!==a[2]&&xe(t,a[2])},d(a){a&&M(t),r=!1,n()}}}function K_(e,t){let r,n,a;return n=new Mat({props:{rating:t[5],layer:t[7]+1}}),{key:e,first:null,c(){r=je(),st(n.$$.fragment),this.h()},l(i){r=je(),ft(n.$$.fragment,i),this.h()},h(){this.first=r},m(i,s){q(i,r,s),ot(n,i,s),a=!0},p(i,s){t=i;const u={};s&1&&(u.rating=t[5]),s&1&&(u.layer=t[7]+1),n.$set(u)},i(i){a||(W(n.$$.fragment,i),a=!0)},o(i){X(n.$$.fragment,i),a=!1},d(i){i&&M(r),ut(n,i)}}}function xat(e){let t,r,n,a,i,s=[],u=new Map,f;n=new qe({props:{label:"armour layers",$$slots:{default:[Pat]},$$scope:{ctx:e}}});let c=e[0];const h=p=>p[7];for(let p=0;p<c.length;p+=1){let v=W_(e,c,p),g=h(v);u.set(g,s[p]=K_(g,v))}return{c(){t=k("div"),r=k("div"),st(n.$$.fragment),a=ht(),i=k("div");for(let p=0;p<s.length;p+=1)s[p].c();this.h()},l(p){t=H(p,"DIV",{});var v=V(t);r=H(v,"DIV",{class:!0});var g=V(r);ft(n.$$.fragment,g),g.forEach(M),a=pt(v),i=H(v,"DIV",{class:!0});var _=V(i);for(let m=0;m<s.length;m+=1)s[m].l(_);_.forEach(M),v.forEach(M),this.h()},h(){F(r,"class","nbr_layers"),F(i,"class","layers svelte-n2prux")},m(p,v){q(p,t,v),j(t,r),ot(n,r,null),j(t,a),j(t,i);for(let g=0;g<s.length;g+=1)s[g].m(i,null);f=!0},p(p,v){const g={};v&260&&(g.$$scope={dirty:v,ctx:p}),n.$set(g),v&1&&(c=p[0],pr(),s=Hr(s,v,h,1,p,c,u,i,Wu,K_,null,W_),vr())},i(p){if(!f){W(n.$$.fragment,p);for(let v=0;v<c.length;v+=1)W(s[v]);f=!0}},o(p){X(n.$$.fragment,p);for(let v=0;v<s.length;v+=1)X(s[v]);f=!1},d(p){p&&M(t),ut(n);for(let v=0;v<s.length;v+=1)s[v].d()}}}function Iat(e){let t,r;const n=[e[1]];let a={$$slots:{default:[xat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&261&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function Dat(e,t,r){let{layers:n=[]}=t,{reqs:a={}}=t,i=n.length;const{dispatch:s}=Ne("ship");function u(){i=Be(this.value),r(2,i)}return e.$$set=f=>{"layers"in f&&r(0,n=f.layers),"reqs"in f&&r(1,a=f.reqs)},e.$$.update=()=>{e.$$.dirty&4&&s.setArmorLayers(i)},[n,a,i,u]}class Rat extends Ct{constructor(t){super();Ot(this,t,Dat,Iat,At,{layers:0,reqs:1})}}function Bat(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_;return{c(){t=k("div"),r=k("label"),n=k("input"),a=mt(`
|
|
none`),i=ht(),s=k("label"),u=k("input"),f=mt(`
|
|
partial`),c=ht(),h=k("label"),p=k("input"),v=mt(`
|
|
full`),this.h()},l(m){t=H(m,"DIV",{class:!0});var b=V(t);r=H(b,"LABEL",{class:!0});var y=V(r);n=H(y,"INPUT",{type:!0}),a=$t(y,`
|
|
none`),y.forEach(M),i=pt(b),s=H(b,"LABEL",{class:!0});var w=V(s);u=H(w,"INPUT",{type:!0}),f=$t(w,`
|
|
partial`),w.forEach(M),c=pt(b),h=H(b,"LABEL",{class:!0});var C=V(h);p=H(C,"INPUT",{type:!0}),v=$t(C,`
|
|
full`),C.forEach(M),b.forEach(M),this.h()},h(){F(n,"type","radio"),n.__value="none",n.value=n.__value,e[6][0].push(n),F(r,"class","svelte-x5copc"),F(u,"type","radio"),u.__value="partial",u.value=u.__value,e[6][0].push(u),F(s,"class","svelte-x5copc"),F(p,"type","radio"),p.__value="full",p.value=p.__value,e[6][0].push(p),F(h,"class","svelte-x5copc"),F(t,"class","svelte-x5copc")},m(m,b){q(m,t,b),j(t,r),j(r,n),n.checked=n.__value===e[0],j(r,a),j(t,i),j(t,s),j(s,u),u.checked=u.__value===e[0],j(s,f),j(t,c),j(t,h),j(h,p),p.checked=p.__value===e[0],j(h,v),g||(_=[ae(n,"change",e[5]),ae(u,"change",e[7]),ae(p,"change",e[8])],g=!0)},p(m,b){b&1&&(n.checked=n.__value===m[0]),b&1&&(u.checked=u.__value===m[0]),b&1&&(p.checked=p.__value===m[0])},d(m){m&&M(t),e[6][0].splice(e[6][0].indexOf(n),1),e[6][0].splice(e[6][0].indexOf(u),1),e[6][0].splice(e[6][0].indexOf(p),1),g=!1,io(_)}}}function Lat(e){let t,r;return t=new qe({props:{label:"streamlining",$$slots:{default:[Bat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&513&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Fat(e){let t,r;const n=[e[1]];let a={$$slots:{default:[Lat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&513&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function zat(e,t,r){let n,a=se,i=()=>(a(),a=MM(p,b=>r(4,n=b)),p);e.$$.on_destroy.push(()=>a());let{type:s="none"}=t,{reqs:u={}}=t,{dispatch:f,shipMass:c}=Ne("ship"),{dispatch:h=f,shipMass:p=c}=t;i();const v=[[]];function g(){s=this.__value,r(0,s)}function _(){s=this.__value,r(0,s)}function m(){s=this.__value,r(0,s)}return e.$$set=b=>{"type"in b&&r(0,s=b.type),"reqs"in b&&r(1,u=b.reqs),"dispatch"in b&&r(3,h=b.dispatch),"shipMass"in b&&i(r(2,p=b.shipMass))},e.$$.update=()=>{e.$$.dirty&25&&h.setStreamlining({type:s,shipMass:n})},[s,u,p,h,n,g,v,_,m]}class Gat extends Ct{constructor(t){super();Ot(this,t,zat,Fat,At,{type:0,reqs:1,dispatch:3,shipMass:2})}}function Nat(e){let t,r,n,a,i,s,u,f,c,h;const p=[e[0]];let v={};for(let A=0;A<p.length;A+=1)v=Bt(v,p[A]);t=new vat({props:v});const g=[e[1]];let _={};for(let A=0;A<g.length;A+=1)_=Bt(_,g[A]);n=new bat({props:_});const m=[e[4]];let b={};for(let A=0;A<m.length;A+=1)b=Bt(b,m[A]);i=new Rat({props:b});const y=[e[2]];let w={};for(let A=0;A<y.length;A+=1)w=Bt(w,y[A]);u=new Cat({props:w});const C=[e[3]];let T={};for(let A=0;A<C.length;A+=1)T=Bt(T,C[A]);return c=new Gat({props:T}),{c(){st(t.$$.fragment),r=ht(),st(n.$$.fragment),a=ht(),st(i.$$.fragment),s=ht(),st(u.$$.fragment),f=ht(),st(c.$$.fragment)},l(A){ft(t.$$.fragment,A),r=pt(A),ft(n.$$.fragment,A),a=pt(A),ft(i.$$.fragment,A),s=pt(A),ft(u.$$.fragment,A),f=pt(A),ft(c.$$.fragment,A)},m(A,x){ot(t,A,x),q(A,r,x),ot(n,A,x),q(A,a,x),ot(i,A,x),q(A,s,x),ot(u,A,x),q(A,f,x),ot(c,A,x),h=!0},p(A,x){const I=x&1?ne(p,[ue(A[0])]):{};t.$set(I);const B=x&2?ne(g,[ue(A[1])]):{};n.$set(B);const P=x&16?ne(m,[ue(A[4])]):{};i.$set(P);const L=x&4?ne(y,[ue(A[2])]):{};u.$set(L);const G=x&8?ne(C,[ue(A[3])]):{};c.$set(G)},i(A){h||(W(t.$$.fragment,A),W(n.$$.fragment,A),W(i.$$.fragment,A),W(u.$$.fragment,A),W(c.$$.fragment,A),h=!0)},o(A){X(t.$$.fragment,A),X(n.$$.fragment,A),X(i.$$.fragment,A),X(u.$$.fragment,A),X(c.$$.fragment,A),h=!1},d(A){ut(t,A),A&&M(r),ut(n,A),A&&M(a),ut(i,A),A&&M(s),ut(u,A),A&&M(f),ut(c,A)}}}function jat(e){let t,r;return t=new wf({props:{label:"structure",$$slots:{default:[Nat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&63&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function qat(e,t,r){let{hull:n={}}=t,{screens:a={}}=t,{cargo:i={}}=t,{streamlining:s={}}=t,{armor:u={}}=t;return e.$$set=f=>{"hull"in f&&r(0,n=f.hull),"screens"in f&&r(1,a=f.screens),"cargo"in f&&r(2,i=f.cargo),"streamlining"in f&&r(3,s=f.streamlining),"armor"in f&&r(4,u=f.armor)},[n,a,i,s,u]}class Uat extends Ct{constructor(t){super();Ot(this,t,qat,jat,At,{hull:0,screens:1,cargo:2,streamlining:3,armor:4})}}function Y_(e,t,r){const n=e.slice();return n[0]=t[r],n}function X_(e,t){let r,n=t[0]+"",a,i;return{key:e,first:null,c(){r=k("option"),a=mt(n),this.h()},l(s){r=H(s,"OPTION",{});var u=V(r);a=$t(u,n),u.forEach(M),this.h()},h(){r.__value=i=t[0],r.value=r.__value,this.first=r},m(s,u){q(s,r,u),j(r,a)},p(s,u){t=s},d(s){s&&M(r)}}}function kat(e){let t,r=[],n=new Map,a,i,s=e[3];const u=f=>f[0];for(let f=0;f<s.length;f+=1){let c=Y_(e,s,f),h=u(c);n.set(h,r[f]=X_(h,c))}return{c(){t=k("select");for(let f=0;f<r.length;f+=1)r[f].c();this.h()},l(f){t=H(f,"SELECT",{class:!0});var c=V(t);for(let h=0;h<r.length;h+=1)r[h].l(c);c.forEach(M),this.h()},h(){F(t,"class","svelte-14clsel"),e[0]===void 0&&Ni(()=>e[5].call(t))},m(f,c){q(f,t,c);for(let h=0;h<r.length;h+=1)r[h].m(t,null);vn(t,e[0]),a||(i=ae(t,"change",e[5]),a=!0)},p(f,c){c&8&&(s=f[3],r=Hr(r,c,u,1,f,s,n,t,$a,X_,null,Y_)),c&9&&vn(t,f[0])},d(f){f&&M(t);for(let c=0;c<r.length;c+=1)r[c].d();a=!1,i()}}}function Hat(e){let t,r;return t=new qe({props:{label:`squadron ${e[1]}`,$$slots:{default:[kat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&2&&(i.label=`squadron ${n[1]}`),a&257&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Wat(e){let t,r;const n=[e[2]];let a={$$slots:{default:[Hat]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&4?ne(n,[ue(i[2])]):{};s&259&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function Kat(e,t,r){const n=Nu.map(({type:h})=>h);let{id:a=1}=t,{type:i=n[0].type}=t,{reqs:s={}}=t,{dispatch:u}=Ne("ship"),{dispatch:f=u}=t;function c(){i=js(this),r(0,i),r(3,n)}return e.$$set=h=>{"id"in h&&r(1,a=h.id),"type"in h&&r(0,i=h.type),"reqs"in h&&r(2,s=h.reqs),"dispatch"in h&&r(4,f=h.dispatch)},e.$$.update=()=>{e.$$.dirty&1&&console.log(i),e.$$.dirty&19&&f.setSquadronType({type:i,id:a})},[i,a,s,n,f,c]}class Yat extends Ct{constructor(t){super();Ot(this,t,Kat,Wat,At,{id:1,type:0,reqs:2,dispatch:4})}}function V_(e,t,r){const n=e.slice();return n[5]=t[r],n[7]=r,n}function Xat(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{class:!0,type:!0,min:!0}),this.h()},h(){F(t,"class","short svelte-oj0ytd"),F(t,"type","number"),F(t,"min","0")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[3]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function Vat(e){let t,r;return t=new qe({props:{label:"bays",$$slots:{default:[Xat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&257&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Z_(e,t){let r,n,a;const i=[t[5],{id:t[7]+1}];let s={};for(let u=0;u<i.length;u+=1)s=Bt(s,i[u]);return n=new Yat({props:s}),{key:e,first:null,c(){r=je(),st(n.$$.fragment),this.h()},l(u){r=je(),ft(n.$$.fragment,u),this.h()},h(){this.first=r},m(u,f){q(u,r,f),ot(n,u,f),a=!0},p(u,f){t=u;const c=f&4?ne(i,[ue(t[5]),{id:t[7]+1}]):{};n.$set(c)},i(u){a||(W(n.$$.fragment,u),a=!0)},o(u){X(n.$$.fragment,u),a=!1},d(u){u&&M(r),ut(n,u)}}}function Zat(e){let t,r,n=[],a=new Map,i,s;const u=[e[1]];let f={$$slots:{default:[Vat]},$$scope:{ctx:e}};for(let p=0;p<u.length;p+=1)f=Bt(f,u[p]);t=new Wr({props:f});let c=e[2];const h=p=>p[7];for(let p=0;p<c.length;p+=1){let v=V_(e,c,p),g=h(v);a.set(g,n[p]=Z_(g,v))}return{c(){st(t.$$.fragment),r=ht();for(let p=0;p<n.length;p+=1)n[p].c();i=je()},l(p){ft(t.$$.fragment,p),r=pt(p);for(let v=0;v<n.length;v+=1)n[v].l(p);i=je()},m(p,v){ot(t,p,v),q(p,r,v);for(let g=0;g<n.length;g+=1)n[g].m(p,v);q(p,i,v),s=!0},p(p,v){const g=v&2?ne(u,[ue(p[1])]):{};v&257&&(g.$$scope={dirty:v,ctx:p}),t.$set(g),v&4&&(c=p[2],pr(),n=Hr(n,v,h,1,p,c,a,i.parentNode,Wu,Z_,i,V_),vr())},i(p){if(!s){W(t.$$.fragment,p);for(let v=0;v<c.length;v+=1)W(n[v]);s=!0}},o(p){X(t.$$.fragment,p);for(let v=0;v<n.length;v+=1)X(n[v]);s=!1},d(p){ut(t,p),p&&M(r);for(let v=0;v<n.length;v+=1)n[v].d(p);p&&M(i)}}}function Jat(e){let t,r;return t=new wf({props:{label:"carrier",$$slots:{default:[Zat]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&263&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Qat(e,t,r){let{bays:n=0}=t,{reqs:a={}}=t,{squadrons:i=[]}=t;const{dispatch:s}=Ne("ship");function u(){n=Be(this.value),r(0,n)}return e.$$set=f=>{"bays"in f&&r(0,n=f.bays),"reqs"in f&&r(1,a=f.reqs),"squadrons"in f&&r(2,i=f.squadrons)},e.$$.update=()=>{e.$$.dirty&1&&s.setCarrierBays(n)},[n,a,i,u]}class tit extends Ct{constructor(t){super();Ot(this,t,Qat,Jat,At,{bays:0,reqs:1,squadrons:2})}}function eit(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{type:!0,class:!0}),this.h()},h(){F(t,"type","number"),F(t,"class","short")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[2]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function rit(e){let t,r;return t=new qe({props:{label:"firecons",$$slots:{default:[eit]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&17&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function nit(e){let t,r;const n=[e[1]];let a={$$slots:{default:[rit]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&17&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function ait(e,t,r){let{stations:n=0}=t,{reqs:a={}}=t;const{dispatch:i}=Ne("ship");function s(){n=Be(this.value),r(0,n)}return e.$$set=u=>{"stations"in u&&r(0,n=u.stations),"reqs"in u&&r(1,a=u.reqs)},e.$$.update=()=>{e.$$.dirty&1&&i.setFirecons(n)},[n,a,s]}class iit extends Ct{constructor(t){super();Ot(this,t,ait,nit,At,{stations:0,reqs:1})}}function sit(e){let t,r,n;return{c(){t=k("input"),this.h()},l(a){t=H(a,"INPUT",{type:!0,class:!0}),this.h()},h(){F(t,"type","number"),F(t,"class","short")},m(a,i){q(a,t,i),xe(t,e[0]),r||(n=ae(t,"input",e[2]),r=!0)},p(a,i){i&1&&Be(t.value)!==a[0]&&xe(t,a[0])},d(a){a&&M(t),r=!1,n()}}}function oit(e){let t,r;return t=new qe({props:{label:"ADFC",$$slots:{default:[sit]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&17&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function uit(e){let t,r;const n=[e[1]];let a={$$slots:{default:[oit]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&2?ne(n,[ue(i[1])]):{};s&17&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function fit(e,t,r){let{rating:n=0}=t,{reqs:a={}}=t;const{dispatch:i}=Ne("ship");function s(){n=Be(this.value),r(0,n)}return e.$$set=u=>{"rating"in u&&r(0,n=u.rating),"reqs"in u&&r(1,a=u.reqs)},e.$$.update=()=>{e.$$.dirty&1&&i.setADFC(n)},[n,a,s]}class lit extends Ct{constructor(t){super();Ot(this,t,fit,uit,At,{rating:0,reqs:1})}}function J_(e,t,r){const n=e.slice();return n[4]=t[r],n}function Q_(e,t){let r,n=t[4].name+"",a,i;return{key:e,first:null,c(){r=k("option"),a=mt(n),this.h()},l(s){r=H(s,"OPTION",{});var u=V(r);a=$t(u,n),u.forEach(M),this.h()},h(){r.__value=i=t[4].type,r.value=r.__value,this.first=r},m(s,u){q(s,r,u),j(r,a)},p(s,u){t=s},d(s){s&&M(r)}}}function cit(e){let t,r=[],n=new Map,a,i,s,u,f,c=Zs;const h=p=>p[4].type;for(let p=0;p<c.length;p+=1){let v=J_(e,c,p),g=h(v);n.set(g,r[p]=Q_(g,v))}return{c(){t=k("select");for(let p=0;p<r.length;p+=1)r[p].c();a=ht(),i=k("button"),s=mt("add weapon"),this.h()},l(p){t=H(p,"SELECT",{class:!0});var v=V(t);for(let _=0;_<r.length;_+=1)r[_].l(v);v.forEach(M),a=pt(p),i=H(p,"BUTTON",{class:!0});var g=V(i);s=$t(g,"add weapon"),g.forEach(M),this.h()},h(){F(t,"class","svelte-e6kwbl"),e[0]===void 0&&Ni(()=>e[3].call(t)),F(i,"class","button small primary")},m(p,v){q(p,t,v);for(let g=0;g<r.length;g+=1)r[g].m(t,null);vn(t,e[0]),q(p,a,v),q(p,i,v),j(i,s),u||(f=[ae(t,"change",e[3]),ae(i,"click",e[1])],u=!0)},p(p,v){v&0&&(c=Zs,r=Hr(r,v,h,1,p,c,n,t,$a,Q_,null,J_)),v&1&&vn(t,p[0])},d(p){p&&M(t);for(let v=0;v<r.length;v+=1)r[v].d();p&&M(a),p&&M(i),u=!1,io(f)}}}function hit(e){let t,r;return t=new qe({props:{label:"weapon type",$$slots:{default:[cit]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&129&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function pit(e,t,r){let{ship:n=Ne("ship")}=t,a=Zs[0].value;const i=()=>n.dispatch.addWeapon(a);function s(){a=js(this),r(0,a)}return e.$$set=u=>{"ship"in u&&r(2,n=u.ship)},[a,i,n,s]}class vit extends Ct{constructor(t){super();Ot(this,t,pit,hit,At,{ship:2})}}function dit(e){let t,r,n,a;return{c(){t=Fn("g"),r=Fn("path"),this.h()},l(i){t=zn(i,"g",{transform:!0});var s=V(t);r=zn(s,"path",{d:!0,class:!0}),V(r).forEach(M),s.forEach(M),this.h()},h(){F(r,"d",e[1]),F(r,"class","svelte-jxsibt"),Me(r,"active",e[0]),F(t,"transform",e[2])},m(i,s){q(i,t,s),j(t,r),n||(a=ae(r,"click",e[7]),n=!0)},p(i,[s]){s&2&&F(r,"d",i[1]),s&1&&Me(r,"active",i[0]),s&4&&F(t,"transform",i[2])},i:se,o:se,d(i){i&&M(t),n=!1,a()}}}function git(e,t,r){let{arc:n}=t,{radius:a}=t,{active:i=!1}=t;const s={F:0,FS:300,AS:240,A:180,AP:120,FP:60};let u,f,c,h;function p(v){Fh.call(this,e,v)}return e.$$set=v=>{"arc"in v&&r(3,n=v.arc),"radius"in v&&r(4,a=v.radius),"active"in v&&r(0,i=v.active)},e.$$.update=()=>{e.$$.dirty&16&&r(5,u=Math.round(a*(1-Math.sin(60/180*Math.PI)))),e.$$.dirty&16&&r(6,f=Math.round(a*Math.cos(60/180*Math.PI))),e.$$.dirty&112&&r(1,c=`M ${a},${a} L ${a-f},${u} A ${a},${a} 0 0 1 ${a+f},${u} Z`),e.$$.dirty&24&&r(2,h=`rotate(${s[n]},${a},${a})`)},[i,c,h,n,a,u,f,p]}class _it extends Ct{constructor(t){super();Ot(this,t,git,dit,At,{arc:3,radius:4,active:0})}}function tm(e,t,r){const n=e.slice();return n[8]=t[r],n}function em(e,t){let r,n,a;function i(){return t[6](t[8])}return n=new _it({props:{arc:t[8],radius:t[1]/2,active:t[0].includes(t[8])}}),n.$on("click",i),{key:e,first:null,c(){r=je(),st(n.$$.fragment),this.h()},l(s){r=je(),ft(n.$$.fragment,s),this.h()},h(){this.first=r},m(s,u){q(s,r,u),ot(n,s,u),a=!0},p(s,u){t=s;const f={};u&2&&(f.radius=t[1]/2),u&1&&(f.active=t[0].includes(t[8])),n.$set(f)},i(s){a||(W(n.$$.fragment,s),a=!0)},o(s){X(n.$$.fragment,s),a=!1},d(s){s&&M(r),ut(n,s)}}}function mit(e){let t,r=[],n=new Map,a,i,s,u,f,c=e[2];const h=g=>g[8];for(let g=0;g<c.length;g+=1){let _=tm(e,c,g),m=h(_);n.set(m,r[g]=em(m,_))}const p=e[5].default,v=bn(p,e,e[4],null);return{c(){t=Fn("svg");for(let g=0;g<r.length;g+=1)r[g].c();a=Fn("circle"),v&&v.c(),this.h()},l(g){t=zn(g,"svg",{width:!0,height:!0});var _=V(t);for(let m=0;m<r.length;m+=1)r[m].l(_);a=zn(_,"circle",{cx:!0,cy:!0,r:!0,class:!0}),V(a).forEach(M),v&&v.l(_),_.forEach(M),this.h()},h(){F(a,"cx","50%"),F(a,"cy","50%"),F(a,"r",i=e[1]/3),F(a,"class","svelte-1rig4e6"),F(t,"width",s=e[1]+"px"),F(t,"height",u=e[1]+"px")},m(g,_){q(g,t,_);for(let m=0;m<r.length;m+=1)r[m].m(t,null);j(t,a),v&&v.m(t,null),f=!0},p(g,[_]){_&15&&(c=g[2],pr(),r=Hr(r,_,h,1,g,c,n,t,Wu,em,a,tm),vr()),(!f||_&2&&i!==(i=g[1]/3))&&F(a,"r",i),v&&v.p&&(!f||_&16)&&_n(v,p,g,g[4],f?$n(p,g[4],_,null):mn(g[4]),null),(!f||_&2&&s!==(s=g[1]+"px"))&&F(t,"width",s),(!f||_&2&&u!==(u=g[1]+"px"))&&F(t,"height",u)},i(g){if(!f){for(let _=0;_<c.length;_+=1)W(r[_]);W(v,g),f=!0}},o(g){for(let _=0;_<r.length;_+=1)X(r[_]);X(v,g),f=!1},d(g){g&&M(t);for(let _=0;_<r.length;_+=1)r[_].d();v&&v.d(g)}}}function $it(e,t,r){let{$$slots:n={},$$scope:a}=t;const i=["FS","F","FP","AP","A","AS"];let{selected:s=[]}=t,{size:u=60}=t;const f=Wa(),c=p=>f("click_arc",p),h=p=>c(p);return e.$$set=p=>{"selected"in p&&r(0,s=p.selected),"size"in p&&r(1,u=p.size),"$$scope"in p&&r(4,a=p.$$scope)},[s,u,i,c,a,n,h]}class Sf extends Ct{constructor(t){super();Ot(this,t,$it,mit,At,{selected:0,size:1})}}function rm(e,t,r){const n=e.slice();return n[2]=t[r],n}function bit(e){let t,r,n,a,i,s,u,f,c,h,p;return{c(){t=k("select"),r=k("option"),n=mt("1"),a=k("option"),i=mt("2"),s=k("option"),u=mt("3"),f=k("option"),c=mt("4"),this.h()},l(v){t=H(v,"SELECT",{});var g=V(t);r=H(g,"OPTION",{});var _=V(r);n=$t(_,"1"),_.forEach(M),a=H(g,"OPTION",{});var m=V(a);i=$t(m,"2"),m.forEach(M),s=H(g,"OPTION",{});var b=V(s);u=$t(b,"3"),b.forEach(M),f=H(g,"OPTION",{});var y=V(f);c=$t(y,"4"),y.forEach(M),g.forEach(M),this.h()},h(){r.__value=1,r.value=r.__value,a.__value=2,a.value=a.__value,s.__value=3,s.value=s.__value,f.__value=4,f.value=f.__value,e[0]===void 0&&Ni(()=>e[6].call(t))},m(v,g){q(v,t,g),j(t,r),j(r,n),j(t,a),j(a,i),j(t,s),j(s,u),j(t,f),j(f,c),vn(t,e[0]),h||(p=ae(t,"change",e[6]),h=!0)},p(v,g){g&1&&vn(t,v[0])},d(v){v&&M(t),h=!1,p()}}}function nm(e,t){let r,n=t[2]+"",a,i;return{key:e,first:null,c(){r=k("option"),a=mt(n),this.h()},l(s){r=H(s,"OPTION",{});var u=V(r);a=$t(u,n),u.forEach(M),this.h()},h(){r.__value=i=t[2],r.value=r.__value,this.first=r},m(s,u){q(s,r,u),j(r,a)},p(s,u){t=s,u&1&&n!==(n=t[2]+"")&&er(a,n),u&1&&i!==(i=t[2])&&(r.__value=i,r.value=r.__value)},d(s){s&&M(r)}}}function yit(e){let t,r=[],n=new Map,a,i,s=e[3][e[0]]||[];const u=f=>f[2];for(let f=0;f<s.length;f+=1){let c=rm(e,s,f),h=u(c);n.set(h,r[f]=nm(h,c))}return{c(){t=k("select");for(let f=0;f<r.length;f+=1)r[f].c();this.h()},l(f){t=H(f,"SELECT",{});var c=V(t);for(let h=0;h<r.length;h+=1)r[h].l(c);c.forEach(M),this.h()},h(){e[2]===void 0&&Ni(()=>e[7].call(t))},m(f,c){q(f,t,c);for(let h=0;h<r.length;h+=1)r[h].m(t,null);vn(t,e[2]),a||(i=ae(t,"change",e[7]),a=!0)},p(f,c){c&9&&(s=f[3][f[0]]||[],r=Hr(r,c,u,1,f,s,n,t,$a,nm,null,rm)),c&13&&vn(t,f[2])},d(f){f&&M(t);for(let c=0;c<r.length;c+=1)r[c].d();a=!1,i()}}}function wit(e){let t,r,n,a,i,s,u,f,c;return a=new qe({props:{label:"beam class",$$slots:{default:[bit]},$$scope:{ctx:e}}}),s=new qe({props:{label:"arcs",$$slots:{default:[yit]},$$scope:{ctx:e}}}),f=new Sf({props:{selected:e[1]}}),f.$on("click_arc",e[8]),{c(){t=k("label"),r=mt("beam"),n=ht(),st(a.$$.fragment),i=ht(),st(s.$$.fragment),u=ht(),st(f.$$.fragment)},l(h){t=H(h,"LABEL",{});var p=V(t);r=$t(p,"beam"),p.forEach(M),n=pt(h),ft(a.$$.fragment,h),i=pt(h),ft(s.$$.fragment,h),u=pt(h),ft(f.$$.fragment,h)},m(h,p){q(h,t,p),j(t,r),q(h,n,p),ot(a,h,p),q(h,i,p),ot(s,h,p),q(h,u,p),ot(f,h,p),c=!0},p(h,[p]){const v={};p&16385&&(v.$$scope={dirty:p,ctx:h}),a.$set(v);const g={};p&16389&&(g.$$scope={dirty:p,ctx:h}),s.$set(g);const _={};p&2&&(_.selected=h[1]),f.$set(_)},i(h){c||(W(a.$$.fragment,h),W(s.$$.fragment,h),W(f.$$.fragment,h),c=!0)},o(h){X(a.$$.fragment,h),X(s.$$.fragment,h),X(f.$$.fragment,h),c=!1},d(h){h&&M(t),h&&M(n),ut(a,h),h&&M(i),ut(s,h),h&&M(u),ut(f,h)}}}function Sit(e,t,r){let n;const a=["FS","F","FP","AP","A","AS"];let{weaponClass:i=1}=t,{arcs:s=["F"]}=t,u={1:[6],2:[3,6],3:[1,2,3,4,5,6,"broadside"],4:[1,2,3,4,5,6,"broadside"]},f=s.length;const c=["FS","FP","AP","AS"];function h(m){if(f==="broadside"){r(1,s=c);return}let b=a.findIndex(y=>y===m);b===-1&&(b=0),r(1,s=Array.from({length:f}).map((y,w)=>a[(b+w)%a.length])),r(5,n=s.join(","))}const p=Wa();function v(){i=js(this),r(0,i)}function g(){f=js(this),r(2,f),r(3,u),r(0,i),r(3,u),r(0,i)}const _=({detail:m})=>h(m);return e.$$set=m=>{"weaponClass"in m&&r(0,i=m.weaponClass),"arcs"in m&&r(1,s=m.arcs)},e.$$.update=()=>{e.$$.dirty&2&&r(5,n=s.join(",")),e.$$.dirty&5&&(u[i].includes(f)||(r(2,f=u[i][0]),console.log({nbrArcs:f,label:"in if"}))),e.$$.dirty&6&&s.length!==f&&h(s[0]),e.$$.dirty&2&&console.log("it changed!",s),e.$$.dirty&32&&console.log("it changed!",n),e.$$.dirty&33&&p("change",{weaponClass:i,arcs:n.split(",")})},[i,s,f,u,h,n,v,g,_]}class Eit extends Ct{constructor(t){super();Ot(this,t,Sit,wit,At,{weaponClass:0,arcs:1})}}function Cit(e){let t,r,n,a,i;return a=new Sf({props:{selected:[e[0]]}}),a.$on("click_arc",e[2]),{c(){t=k("label"),r=mt("submunition pack"),n=ht(),st(a.$$.fragment)},l(s){t=H(s,"LABEL",{});var u=V(t);r=$t(u,"submunition pack"),u.forEach(M),n=pt(s),ft(a.$$.fragment,s)},m(s,u){q(s,t,u),j(t,r),q(s,n,u),ot(a,s,u),i=!0},p(s,[u]){const f={};u&1&&(f.selected=[s[0]]),a.$set(f)},i(s){i||(W(a.$$.fragment,s),i=!0)},o(s){X(a.$$.fragment,s),i=!1},d(s){s&&M(t),s&&M(n),ut(a,s)}}}function Oit(e,t,r){let{arc:n="F"}=t;const a=Wa(),i=u=>{a("change",{arc:u})},s=({detail:u})=>i(u);return e.$$set=u=>{"arc"in u&&r(0,n=u.arc)},[n,i,s]}class Ait extends Ct{constructor(t){super();Ot(this,t,Oit,Cit,At,{arc:0})}}function Tit(e){let t,r;return{c(){t=k("label"),r=mt("point defence system")},l(n){t=H(n,"LABEL",{});var a=V(t);r=$t(a,"point defence system"),a.forEach(M)},m(n,a){q(n,t,a),j(t,r)},p:se,i:se,o:se,d(n){n&&M(t)}}}class Mit extends Ct{constructor(t){super();Ot(this,t,null,Tit,At,{})}}function Pit(e){let t,r;return{c(){t=k("label"),r=mt("scattergun")},l(n){t=H(n,"LABEL",{});var a=V(t);r=$t(a,"scattergun"),a.forEach(M)},m(n,a){q(n,t,a),j(t,r)},p:se,i:se,o:se,d(n){n&&M(t)}}}class xit extends Ct{constructor(t){super();Ot(this,t,null,Pit,At,{})}}function Iit(e){let t,r,n,a,i;return a=new Sf({props:{selected:[e[0]]}}),a.$on("click_arc",e[2]),{c(){t=k("label"),r=mt("needle weapon"),n=ht(),st(a.$$.fragment)},l(s){t=H(s,"LABEL",{});var u=V(t);r=$t(u,"needle weapon"),u.forEach(M),n=pt(s),ft(a.$$.fragment,s)},m(s,u){q(s,t,u),j(t,r),q(s,n,u),ot(a,s,u),i=!0},p(s,[u]){const f={};u&1&&(f.selected=[s[0]]),a.$set(f)},i(s){i||(W(a.$$.fragment,s),i=!0)},o(s){X(a.$$.fragment,s),i=!1},d(s){s&&M(t),s&&M(n),ut(a,s)}}}function Dit(e,t,r){let{arc:n="F"}=t;const a=Wa(),i=u=>{a("change",{arc:u})},s=({detail:u})=>i(u);return e.$$set=u=>{"arc"in u&&r(0,n=u.arc)},[n,i,s]}class Rit extends Ct{constructor(t){super();Ot(this,t,Dit,Iit,At,{arc:0})}}function Bit(e){let t,r,n,a,i,s,u,f;const c=[e[0]];var h=e[3][e[1]];function p(v){let g={};for(let _=0;_<c.length;_+=1)g=Bt(g,c[_]);return{props:g}}return h&&(i=new h(p()),i.$on("change",e[5])),{c(){t=k("div"),r=k("button"),n=mt("remove"),a=ht(),i&&st(i.$$.fragment),this.h()},l(v){t=H(v,"DIV",{class:!0});var g=V(t);r=H(g,"BUTTON",{class:!0});var _=V(r);n=$t(_,"remove"),_.forEach(M),a=pt(g),i&&ft(i.$$.fragment,g),g.forEach(M),this.h()},h(){F(r,"class","button small red remove"),F(t,"class","weapon_row svelte-1y8jrjk")},m(v,g){q(v,t,g),j(t,r),j(r,n),j(t,a),i&&ot(i,t,null),s=!0,u||(f=ae(r,"click",e[4]),u=!0)},p(v,g){const _=g&1?ne(c,[ue(v[0])]):{};if(h!==(h=v[3][v[1]])){if(i){pr();const m=i;X(m.$$.fragment,1,0,()=>{ut(m,1)}),vr()}h?(i=new h(p()),i.$on("change",v[5]),st(i.$$.fragment),W(i.$$.fragment,1),ot(i,t,null)):i=null}else h&&i.$set(_)},i(v){s||(i&&W(i.$$.fragment,v),s=!0)},o(v){i&&X(i.$$.fragment,v),s=!1},d(v){v&&M(t),i&&ut(i),u=!1,f()}}}function Lit(e){let t,r;const n=[e[2]];let a={$$slots:{default:[Bit]},$$scope:{ctx:e}};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new Wr({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,[s]){const u=s&4?ne(n,[ue(i[2])]):{};s&259&&(u.$$scope={dirty:s,ctx:i}),t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function Fit(e,t,r){let n,a;const i={beam:Eit,submunition:Ait,pds:Mit,scattergun:xit,needle:Rit};let{weapon:s={}}=t,{id:u}=t;const f=Ne("ship"),c=()=>f.dispatch.removeWeapon(u),h=({detail:p})=>{console.log({id:u,type:a}),f.dispatch.setWeapon(wi({id:u,type:a},p))};return e.$$set=p=>{"weapon"in p&&r(0,s=p.weapon),"id"in p&&r(6,u=p.id)},e.$$.update=()=>{e.$$.dirty&1&&r(2,n=s.reqs),e.$$.dirty&1&&r(1,a=s.type)},[s,a,n,i,c,h,u]}class zit extends Ct{constructor(t){super();Ot(this,t,Fit,Lit,At,{weapon:0,id:6})}}function am(e,t,r){const n=e.slice();return n[3]=t[r],n}function im(e,t){let r,n,a;return n=new zit({props:{weapon:t[3],id:t[3].id}}),{key:e,first:null,c(){r=je(),st(n.$$.fragment),this.h()},l(i){r=je(),ft(n.$$.fragment,i),this.h()},h(){this.first=r},m(i,s){q(i,r,s),ot(n,i,s),a=!0},p(i,s){t=i;const u={};s&4&&(u.weapon=t[3]),s&4&&(u.id=t[3].id),n.$set(u)},i(i){a||(W(n.$$.fragment,i),a=!0)},o(i){X(n.$$.fragment,i),a=!1},d(i){i&&M(r),ut(n,i)}}}function Git(e){let t,r,n,a,i,s,u=[],f=new Map,c,h;const p=[e[0]];let v={};for(let y=0;y<p.length;y+=1)v=Bt(v,p[y]);t=new iit({props:v});const g=[e[1]];let _={};for(let y=0;y<g.length;y+=1)_=Bt(_,g[y]);n=new lit({props:_}),i=new vit({});let m=e[2];const b=y=>y[3].id;for(let y=0;y<m.length;y+=1){let w=am(e,m,y),C=b(w);f.set(C,u[y]=im(C,w))}return{c(){st(t.$$.fragment),r=ht(),st(n.$$.fragment),a=ht(),st(i.$$.fragment),s=ht();for(let y=0;y<u.length;y+=1)u[y].c();c=je()},l(y){ft(t.$$.fragment,y),r=pt(y),ft(n.$$.fragment,y),a=pt(y),ft(i.$$.fragment,y),s=pt(y);for(let w=0;w<u.length;w+=1)u[w].l(y);c=je()},m(y,w){ot(t,y,w),q(y,r,w),ot(n,y,w),q(y,a,w),ot(i,y,w),q(y,s,w);for(let C=0;C<u.length;C+=1)u[C].m(y,w);q(y,c,w),h=!0},p(y,w){const C=w&1?ne(p,[ue(y[0])]):{};t.$set(C);const T=w&2?ne(g,[ue(y[1])]):{};n.$set(T),w&4&&(m=y[2],pr(),u=Hr(u,w,b,1,y,m,f,c.parentNode,Wu,im,c,am),vr())},i(y){if(!h){W(t.$$.fragment,y),W(n.$$.fragment,y),W(i.$$.fragment,y);for(let w=0;w<m.length;w+=1)W(u[w]);h=!0}},o(y){X(t.$$.fragment,y),X(n.$$.fragment,y),X(i.$$.fragment,y);for(let w=0;w<u.length;w+=1)X(u[w]);h=!1},d(y){ut(t,y),y&&M(r),ut(n,y),y&&M(a),ut(i,y),y&&M(s);for(let w=0;w<u.length;w+=1)u[w].d(y);y&&M(c)}}}function Nit(e){let t,r;return t=new wf({props:{label:"weaponry",$$slots:{default:[Git]},$$scope:{ctx:e}}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&71&&(i.$$scope={dirty:a,ctx:n}),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function jit(e,t,r){let{firecons:n={}}=t,{adfc:a={}}=t,{weapons:i=[]}=t;return e.$$set=s=>{"firecons"in s&&r(0,n=s.firecons),"adfc"in s&&r(1,a=s.adfc),"weapons"in s&&r(2,i=s.weapons)},[n,a,i]}class qit extends Ct{constructor(t){super();Ot(this,t,jit,Nit,At,{firecons:0,adfc:1,weapons:2})}}function Uit(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_;const m=[e[0].identification];let b={};for(let P=0;P<m.length;P+=1)b=Bt(b,m[P]);n=new znt({props:b});const y=[e[0].reqs];let w={};for(let P=0;P<y.length;P+=1)w=Bt(w,y[P]);i=new Hnt({props:w}),u=new fat({props:{propulsion:e[0].propulsion}});const C=[e[0].structure];let T={};for(let P=0;P<C.length;P+=1)T=Bt(T,C[P]);c=new Uat({props:T});const A=[e[0].weaponry];let x={};for(let P=0;P<A.length;P+=1)x=Bt(x,A[P]);p=new qit({props:x});const I=[e[0].carrier];let B={};for(let P=0;P<I.length;P+=1)B=Bt(B,I[P]);return g=new tit({props:B}),{c(){t=k("main"),r=k("div"),st(n.$$.fragment),a=ht(),st(i.$$.fragment),s=ht(),st(u.$$.fragment),f=ht(),st(c.$$.fragment),h=ht(),st(p.$$.fragment),v=ht(),st(g.$$.fragment),this.h()},l(P){t=H(P,"MAIN",{class:!0});var L=V(t);r=H(L,"DIV",{class:!0});var G=V(r);ft(n.$$.fragment,G),a=pt(G),ft(i.$$.fragment,G),G.forEach(M),s=pt(L),ft(u.$$.fragment,L),f=pt(L),ft(c.$$.fragment,L),h=pt(L),ft(p.$$.fragment,L),v=pt(L),ft(g.$$.fragment,L),L.forEach(M),this.h()},h(){F(r,"class","identification-row svelte-1xmntps"),F(t,"class","svelte-1xmntps")},m(P,L){q(P,t,L),j(t,r),ot(n,r,null),j(r,a),ot(i,r,null),j(t,s),ot(u,t,null),j(t,f),ot(c,t,null),j(t,h),ot(p,t,null),j(t,v),ot(g,t,null),_=!0},p(P,[L]){const G=L&1?ne(m,[ue(P[0].identification)]):{};n.$set(G);const K=L&1?ne(y,[ue(P[0].reqs)]):{};i.$set(K);const at={};L&1&&(at.propulsion=P[0].propulsion),u.$set(at);const et=L&1?ne(C,[ue(P[0].structure)]):{};c.$set(et);const rt=L&1?ne(A,[ue(P[0].weaponry)]):{};p.$set(rt);const gt=L&1?ne(I,[ue(P[0].carrier)]):{};g.$set(gt)},i(P){_||(W(n.$$.fragment,P),W(i.$$.fragment,P),W(u.$$.fragment,P),W(c.$$.fragment,P),W(p.$$.fragment,P),W(g.$$.fragment,P),_=!0)},o(P){X(n.$$.fragment,P),X(i.$$.fragment,P),X(u.$$.fragment,P),X(c.$$.fragment,P),X(p.$$.fragment,P),X(g.$$.fragment,P),_=!1},d(P){P&&M(t),ut(n),ut(i),ut(u),ut(c),ut(p),ut(g)}}}function kit(e,t,r){let n;const{state:a}=Ne("ship");return ao(e,a,i=>r(0,n=i)),[n,a]}class Hit extends Ct{constructor(t){super();Ot(this,t,kit,Uit,At,{})}}function Wit(e){let t,r,n,a,i,s,u,f,c,h,p;return{c(){t=k("div"),r=k("button"),n=mt("save"),a=ht(),i=k("pre"),s=k("code"),u=mt(e[0]),f=ht(),c=k("a"),this.h()},l(v){t=H(v,"DIV",{class:!0});var g=V(t);r=H(g,"BUTTON",{class:!0});var _=V(r);n=$t(_,"save"),_.forEach(M),a=pt(g),i=H(g,"PRE",{class:!0});var m=V(i);s=H(m,"CODE",{});var b=V(s);u=$t(b,e[0]),b.forEach(M),m.forEach(M),g.forEach(M),f=pt(v),c=H(v,"A",{href:!0,download:!0}),V(c).forEach(M),this.h()},h(){F(r,"class","button primary svelte-1f6rwrs"),F(i,"class","svelte-1f6rwrs"),F(t,"class","svelte-1f6rwrs"),F(c,"href",e[3]),F(c,"download",e[2]),Ln(c,"display","none",!1)},m(v,g){q(v,t,g),j(t,r),j(r,n),j(t,a),j(t,i),j(i,s),j(s,u),q(v,f,g),q(v,c,g),e[8](c),h||(p=ae(r,"click",e[5]),h=!0)},p(v,[g]){g&1&&er(u,v[0]),g&8&&F(c,"href",v[3]),g&4&&F(c,"download",v[2])},i:se,o:se,d(v){v&&M(t),v&&M(f),v&&M(c),e[8](null),h=!1,p()}}}function Kit(e,t,r){let n,a,i,{ship:s={}}=t,u;const{state:f}=Ne("ship");ao(e,f,v=>r(7,i=v)),Wa();let c;function h(){c==null||c.click()}function p(v){Nn[v?"unshift":"push"](()=>{c=v,r(1,c)})}return e.$$set=v=>{"ship"in v&&r(6,s=v.ship)},e.$$.update=()=>{var v,g;e.$$.dirty&64&&r(0,u=JSON.stringify(s,null,2)),e.$$.dirty&128&&r(0,u=JSON.stringify(i,null,2)),e.$$.dirty&1&&r(3,n="data:text/plain;charset=utf-8,"+encodeURIComponent(u)),e.$$.dirty&128&&r(2,a=((g=(v=i==null?void 0:i.identification)==null?void 0:v.shipClass)!=null?g:"ship")+".json")},[u,c,a,n,f,h,s,i,p]}class Yit extends Ct{constructor(t){super();Ot(this,t,Kit,Wit,At,{ship:6})}}function Xit(e){let t,r;return{c(){t=k("div"),r=mt(e[0]),this.h()},l(n){t=H(n,"DIV",{class:!0});var a=V(t);r=$t(a,e[0]),a.forEach(M),this.h()},h(){F(t,"class","svelte-uinb9")},m(n,a){q(n,t,a),j(t,r)},p(n,[a]){a&1&&er(r,n[0])},i:se,o:se,d(n){n&&M(t)}}}function Vit(e,t,r){let{cost:n=0}=t;return e.$$set=a=>{"cost"in a&&r(0,n=a.cost)},[n]}class Zit extends Ct{constructor(t){super();Ot(this,t,Vit,Xit,At,{cost:0})}}function Jit(e){let t,r,n,a;return{c(){t=k("div"),r=mt(e[0]),n=k("img"),this.h()},l(i){t=H(i,"DIV",{});var s=V(t);r=$t(s,e[0]),n=H(s,"IMG",{src:!0,alt:!0,class:!0}),s.forEach(M),this.h()},h(){kn(n.src,a=yn+"/mass.svg")||F(n,"src",a),F(n,"alt","mass"),F(n,"class","svelte-vmvu0j")},m(i,s){q(i,t,s),j(t,r),j(t,n)},p(i,[s]){s&1&&er(r,i[0])},i:se,o:se,d(i){i&&M(t)}}}function Qit(e,t,r){let{mass:n=0}=t;return e.$$set=a=>{"mass"in a&&r(0,n=a.mass)},[n]}class tst extends Ct{constructor(t){super();Ot(this,t,Qit,Jit,At,{mass:0})}}function sm(e){let t,r;return{c(){t=mt(e[0]),r=mt("-class,")},l(n){t=$t(n,e[0]),r=$t(n,"-class,")},m(n,a){q(n,t,a),q(n,r,a)},p(n,a){a&1&&er(t,n[0])},d(n){n&&M(t),n&&M(r)}}}function est(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_,m=e[0]&&sm(e);return p=new Zit({props:{cost:e[2]}}),g=new tst({props:{mass:e[3]}}),{c(){t=k("h1"),r=mt("ship name: "),n=k("div"),a=ht(),i=k("div"),s=k("h2"),m&&m.c(),u=ht(),f=mt(e[1]),c=ht(),h=k("div"),st(p.$$.fragment),v=mt(`
|
|
\xA0
|
|
`),st(g.$$.fragment),this.h()},l(b){t=H(b,"H1",{class:!0});var y=V(t);r=$t(y,"ship name: "),n=H(y,"DIV",{class:!0}),V(n).forEach(M),y.forEach(M),a=pt(b),i=H(b,"DIV",{class:!0});var w=V(i);s=H(w,"H2",{class:!0});var C=V(s);m&&m.l(C),u=pt(C),f=$t(C,e[1]),C.forEach(M),c=pt(w),h=H(w,"DIV",{class:!0});var T=V(h);ft(p.$$.fragment,T),v=$t(T,`
|
|
\xA0
|
|
`),ft(g.$$.fragment,T),T.forEach(M),w.forEach(M),this.h()},h(){F(n,"class","fill svelte-1v8962g"),F(t,"class","svelte-1v8962g"),F(s,"class","svelte-1v8962g"),F(h,"class","reqs svelte-1v8962g"),F(i,"class","details svelte-1v8962g")},m(b,y){q(b,t,y),j(t,r),j(t,n),q(b,a,y),q(b,i,y),j(i,s),m&&m.m(s,null),j(s,u),j(s,f),j(i,c),j(i,h),ot(p,h,null),j(h,v),ot(g,h,null),_=!0},p(b,[y]){b[0]?m?m.p(b,y):(m=sm(b),m.c(),m.m(s,u)):m&&(m.d(1),m=null),(!_||y&2)&&er(f,b[1]);const w={};y&4&&(w.cost=b[2]),p.$set(w);const C={};y&8&&(C.mass=b[3]),g.$set(C)},i(b){_||(W(p.$$.fragment,b),W(g.$$.fragment,b),_=!0)},o(b){X(p.$$.fragment,b),X(g.$$.fragment,b),_=!1},d(b){b&&M(t),b&&M(a),b&&M(i),m&&m.d(),ut(p),ut(g)}}}function rst(e,t,r){let{shipClass:n}=t,{shipType:a}=t,{cost:i=0}=t,{mass:s=0}=t;return e.$$set=u=>{"shipClass"in u&&r(0,n=u.shipClass),"shipType"in u&&r(1,a=u.shipType),"cost"in u&&r(2,i=u.cost),"mass"in u&&r(3,s=u.mass)},[n,a,i,s]}class nst extends Ct{constructor(t){super();Ot(this,t,rst,est,At,{shipClass:0,shipType:1,cost:2,mass:3})}}function ast(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.map(function(n){return n.split(" ").map(function(a){return a?""+e+a:""}).join(" ")}).join(" ")}function ist(e,t){return t.replace(/([^}{]*){/gm,function(r,n){return n.replace(/\.([^{,\s\d.]+)/g,"."+e+"$1")+"{"})}function pn(e,t){return function(r){r&&(e[t]=r)}}function Cy(e,t,r){return function(n){n&&(e[t][r]=n)}}function om(e,t){return function(r){var n=r.prototype;e.forEach(function(a){t(n,a)})}}function sst(e,t){return t===void 0&&(t={}),function(r,n){e.forEach(function(a){var i=t[a]||a;i in r||(r[i]=function(){for(var s,u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=(s=this[n])[a].apply(s,u);return c===this[n]?this:c})})}}var ost=function(){function e(){this.keys=[],this.values=[]}var t=e.prototype;return t.get=function(r){return this.values[this.keys.indexOf(r)]},t.set=function(r,n){var a=this.keys,i=this.values,s=a.indexOf(r),u=s===-1?a.length:s;a[u]=r,i[u]=n},e}(),ust=function(){function e(){this.object={}}var t=e.prototype;return t.get=function(r){return this.object[r]},t.set=function(r,n){this.object[r]=n},e}(),fst=typeof Map=="function",lst=function(){function e(){}var t=e.prototype;return t.connect=function(r,n){this.prev=r,this.next=n,r&&(r.next=this),n&&(n.prev=this)},t.disconnect=function(){var r=this.prev,n=this.next;r&&(r.next=n),n&&(n.prev=r)},t.getIndex=function(){for(var r=this,n=-1;r;)r=r.prev,++n;return n},e}();function cst(e,t){var r=[],n=[];return e.forEach(function(a){var i=a[0],s=a[1],u=new lst;r[i]=u,n[s]=u}),r.forEach(function(a,i){a.connect(r[i-1])}),e.filter(function(a,i){return!t[i]}).map(function(a,i){var s=a[0],u=a[1];if(s===u)return[0,0];var f=r[s],c=n[u-1],h=f.getIndex();f.disconnect(),c?f.connect(c,c.next):f.connect(void 0,r[0]);var p=f.getIndex();return[h,p]})}var hst=function(){function e(r,n,a,i,s,u,f,c){this.prevList=r,this.list=n,this.added=a,this.removed=i,this.changed=s,this.maintained=u,this.changedBeforeAdded=f,this.fixed=c}var t=e.prototype;return Object.defineProperty(t,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(t,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),t.caculateOrdered=function(){var r=cst(this.changedBeforeAdded,this.fixed),n=this.changed,a=[];this.cacheOrdered=r.filter(function(i,s){var u=i[0],f=i[1],c=n[s],h=c[0],p=c[1];if(u!==f)return a.push([h,p]),!0}),this.cachePureChanged=a},e}();function Ef(e,t,r){var n=fst?Map:r?ust:ost,a=r||function(w){return w},i=[],s=[],u=[],f=e.map(a),c=t.map(a),h=new n,p=new n,v=[],g=[],_={},m=[],b=0,y=0;return f.forEach(function(w,C){h.set(w,C)}),c.forEach(function(w,C){p.set(w,C)}),f.forEach(function(w,C){var T=p.get(w);typeof T=="undefined"?(++y,s.push(C)):_[T]=y}),c.forEach(function(w,C){var T=h.get(w);typeof T=="undefined"?(i.push(C),++b):(u.push([T,C]),y=_[C]||0,v.push([T-y,C-b]),g.push(C===T),T!==C&&m.push([T,C]))}),s.reverse(),new hst(e,t,i,s,m,u,v,g)}var pst=function(){function e(r,n){r===void 0&&(r=[]),this.findKeyCallback=n,this.list=[].slice.call(r)}var t=e.prototype;return t.update=function(r){var n=[].slice.call(r),a=Ef(this.list,n,this.findKeyCallback);return this.list=n,a},e}(),vst="function",dst="object",gst="string",_st="number",Oy="undefined",Ay=typeof window!==Oy,mst=[{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:'\\"',close:'\\"'},{open:"\\'",close:"\\'"}],Or=1e-7,gu={cm:function(e){return e*96/2.54},mm:function(e){return e*96/254},in:function(e){return e*96},pt:function(e){return e*96/72},pc:function(e){return e*96/6},"%":function(e,t){return e*t/100},vw:function(e,t){return t===void 0&&(t=window.innerWidth),e/100*t},vh:function(e,t){return t===void 0&&(t=window.innerHeight),e/100*t},vmax:function(e,t){return t===void 0&&(t=Math.max(window.innerWidth,window.innerHeight)),e/100*t},vmin:function(e,t){return t===void 0&&(t=Math.min(window.innerWidth,window.innerHeight)),e/100*t}};function $st(e,t,r,n){return(e*n+t*r)/(r+n)}function Ha(e){return typeof e===Oy}function va(e){return e&&typeof e===dst}function ni(e){return Array.isArray(e)}function rn(e){return typeof e===gst}function bst(e){return typeof e===_st}function Ty(e){return typeof e===vst}function yst(e,t){var r=e===""||e==" ",n=t===""||t==" ";return n&&r||e===t}function My(e,t,r,n,a){var i=tv(e,t,r);return i?r:wst(e,t,r+1,n,a)}function tv(e,t,r){if(!e.ignore)return null;var n=t.slice(Math.max(r-3,0),r+3).join("");return new RegExp(e.ignore).exec(n)}function wst(e,t,r,n,a){for(var i=function(c){var h=t[c].trim();if(h===e.close&&!tv(e,t,c))return{value:c};var p=c,v=oh(a,function(g){var _=g.open;return _===h});if(v&&(p=My(v,t,c,n,a)),p===-1)return s=c,"break";c=p,s=c},s,u=r;u<n;++u){var f=i(u);if(u=s,typeof f=="object")return f.value;if(f==="break")break}return-1}function Py(e,t){var r=rn(t)?{separator:t}:t,n=r.separator,a=n===void 0?",":n,i=r.isSeparateFirst,s=r.isSeparateOnlyOpenClose,u=r.isSeparateOpenClose,f=u===void 0?s:u,c=r.openCloseCharacters,h=c===void 0?mst:c,p=h.map(function(I){var B=I.open,P=I.close;return B===P?B:B+"|"+P}).join("|"),v="(\\s*"+a+"\\s*|"+p+"|\\s+)",g=new RegExp(v,"g"),_=e.split(g).filter(Boolean),m=_.length,b=[],y=[];function w(){return y.length?(b.push(y.join("")),y=[],!0):!1}for(var C=function(I){var B=_[I].trim(),P=I,L=oh(h,function(K){var at=K.open;return at===B}),G=oh(h,function(K){var at=K.close;return at===B});if(L){if(P=My(L,_,I,m,h),P!==-1&&f)return w()&&i||(b.push(_.slice(I,P+1).join("")),I=P,i)?(T=I,"break"):(T=I,"continue")}else{if(G&&!tv(G,_,I))throw new Error("invalid format: "+G.close);if(yst(B,a)&&!s)return w(),i?(T=I,"break"):(T=I,"continue")}P===-1&&(P=m-1),y.push(_.slice(I,P+1).join("")),I=P,T=I},T,A=0;A<m;++A){var x=C(A);if(A=T,x==="break")break}return y.length&&b.push(y.join("")),b}function da(e){return Py(e,"")}function Ua(e){return Py(e,",")}function ev(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function go(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var r=t[1],n=t[2],a=t[3];return{prefix:r,unit:a,value:parseFloat(n)}}function xy(e){return e.replace(/[\s-_]([a-z])/g,function(t,r){return r.toUpperCase()})}function dc(e,t){return t===void 0&&(t="-"),e.replace(/([a-z])([A-Z])/g,function(r,n,a){return""+n+t+a.toLowerCase()})}function Js(){return Date.now?Date.now():new Date().getTime()}function nn(e,t,r){r===void 0&&(r=-1);for(var n=e.length,a=0;a<n;++a)if(t(e[a],a,e))return a;return r}function oh(e,t,r){var n=nn(e,t);return n>-1?e[n]:r}var rv=function(){var e=Js(),t=Ay&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return t?t.bind(window):function(r){var n=Js(),a=window.setTimeout(function(){r(n-e)},1e3/60);return a}}(),Sst=function(){var e=Ay&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(t){clearTimeout(t)}}();function Iy(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in t)t.push(r);return t}function Ze(e,t){var r=go(e),n=r.value,a=r.unit;if(va(t)){var i=t[a];if(i){if(Ty(i))return i(n);if(gu[a])return gu[a](n,i)}}else if(a==="%")return n*t/100;return gu[a]?gu[a](n):n}function Est(e,t,r){return Math.max(t,Math.min(e,r))}function um(e,t,r){return[[re(t[0],Or),re(t[0]*e[1]/e[0],Or)],[re(t[1]*e[0]/e[1],Or),re(t[1],Or)]].filter(function(n){return n.every(function(a,i){return r?a<=t[i]:a>=t[i]})})[0]||e}function Cst(e,t,r,n){if(!n)return e.map(function(v,g){return Est(v,t[g],r[g])});var a=e[0],i=e[1],s=um(e,t,!1),u=s[0],f=s[1],c=um(e,r,!0),h=c[0],p=c[1];return a<u||i<f?(a=u,i=f):(a>h||i>p)&&(a=h,i=p),[a,i]}function Ost(e){for(var t=e.length,r=0,n=t-1;n>=0;--n)r+=e[n];return r}function Qs(e){for(var t=e.length,r=0,n=t-1;n>=0;--n)r+=e[n];return t?r/t:0}function Ce(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=Math.atan2(n,r);return a>=0?a:a+Math.PI*2}function Ast(e){return[0,1].map(function(t){return Qs(e.map(function(r){return r[t]}))})}function uh(e){var t=Ast(e),r=Ce(t,e[0]),n=Ce(t,e[1]);return r<n&&n-r<Math.PI||r>n&&n-r<-Math.PI?1:-1}function Gn(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function re(e,t){return t?Math.round(e/t)*t:e}function fm(e,t){return e.forEach(function(r,n){e[n]=re(e[n],t)}),e}function tn(e,t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function Tst(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function Mst(e,t){if(e.classList)e.classList.remove(t);else{var r=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(r," ")}}function Jr(e,t,r,n){e.addEventListener(t,r,n)}function hr(e,t,r,n){e.removeEventListener(t,r,n)}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var fh=function(e,t){return fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},fh(e,t)};function ai(e,t){fh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var oa=function(){return oa=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},oa.apply(this,arguments)};function Dy(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function Pst(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,a++)n[a]=i[s];return n}function lh(e,t){if(e===t)return!1;for(var r in e)if(!(r in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}function nv(e,t){var r=Object.keys(e),n=Object.keys(t),a=Ef(r,n,function(f){return f}),i={},s={},u={};return a.added.forEach(function(f){var c=n[f];i[c]=t[c]}),a.removed.forEach(function(f){var c=r[f];s[c]=e[c]}),a.maintained.forEach(function(f){var c=f[0],h=r[c],p=[e[h],t[h]];e[h]!==t[h]&&(u[h]=p)}),{added:i,removed:s,changed:u}}function Ry(e){e.forEach(function(t){t()})}function lm(e){var t=0;return e.map(function(r){return r==null?"$compat"+ ++t:""+r})}function cm(e,t,r,n){if(rn(e)||bst(e))return new Rst("text_"+e,t,r,n,null,{});var a=typeof e.type=="string"?Bst:e.type.prototype.render?Fst:Lst;return new a(e.type,t,r,n,e.ref,e.props)}function By(e){var t=[];return e.forEach(function(r){t=t.concat(ni(r)?By(r):r)}),t}function hm(e){var t=e.className,r=Dy(e,["className"]);return t!=null&&(r.class=t),delete r.style,delete r.children,r}function gc(e,t){if(!t)return e;for(var r in t)Ha(e[r])&&(e[r]=t[r]);return e}function Ur(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=t||{},i=a.key,s=a.ref,u=Dy(a,["key","ref"]);return{type:e,key:i,ref:s,props:oa(oa({},u),{children:By(r).filter(function(f){return f!=null&&f!==!1})})}}var _o=function(){function e(r,n,a,i,s,u){u===void 0&&(u={}),this.type=r,this.key=n,this.index=a,this.container=i,this.ref=s,this.props=u,this._providers=[]}var t=e.prototype;return t._should=function(r,n){return!0},t._update=function(r,n,a,i){if(this.base&&!rn(n)&&!i&&!this._should(n.props,a))return!1;this.original=n,this._setState(a);var s=this.props;return rn(n)||(this.props=n.props,this.ref=n.ref),this._render(r,this.base?s:{},a),!0},t._mounted=function(){var r=this.ref;r&&r(this.base)},t._setState=function(r){},t._updated=function(){var r=this.ref;r&&r(this.base)},t._destroy=function(){var r=this.ref;r&&r(null)},e}();function xst(e,t,r){var n=nv(e,t),a=n.added,i=n.removed,s=n.changed;for(var u in a)r.setAttribute(u,a[u]);for(var u in s)r.setAttribute(u,s[u][1]);for(var u in i)r.removeAttribute(u)}function Ist(e,t,r){var n=nv(e,t),a=n.added,i=n.removed,s=n.changed;for(var u in i)r.removeEventListener(u);for(var u in a)r.addEventListener(u,a[u]);for(var u in s)r.removeEventListener(u),r.addEventListener(u,s[u][1]);for(var u in i)r.removeEventListener(u)}function Dst(e,t,r){var n=r.style,a=nv(e,t),i=a.added,s=a.removed,u=a.changed;for(var f in i){var c=dc(f,"-");n.setProperty?n.setProperty(c,i[f]):n[c]=i[f]}for(var f in u){var c=dc(f,"-");n.setProperty?n.setProperty(c,u[f][1]):n[c]=u[f][1]}for(var f in s){var c=dc(f,"-");n.removeProperty?n.removeProperty(c):n[c]=""}}function pm(e){var t={},r={};for(var n in e)n.indexOf("on")===0?r[n.replace("on","").toLowerCase()]=e[n]:t[n]=e[n];return{attributes:t,events:r}}var Rst=function(e){ai(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}var r=t.prototype;return r._render=function(n){var a=this,i=!this.base;return i&&(this.base=document.createTextNode(this.type.replace("text_",""))),n.push(function(){i?a._mounted():a._updated()}),!0},r._unmount=function(){this.base.parentNode.removeChild(this.base)},t}(_o),Bst=function(e){ai(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.events={},n._isSVG=!1,n}var r=t.prototype;return r.addEventListener=function(n,a){var i=this.events;i[n]=function(s){s.nativeEvent=s,a(s)},this.base.addEventListener(n,i[n])},r.removeEventListener=function(n){var a=this.events;this.base.removeEventListener(n,a[n]),delete a[n]},r._should=function(n){return lh(this.props,n)},r._render=function(n,a){var i=this,s=!this.base;if(s){var u=this._hasSVG();this._isSVG=u;var f=this.props.portalContainer;if(!f){var c=this.type;u?f=document.createElementNS("http://www.w3.org/2000/svg",c):f=document.createElement(c)}this.base=f}mo(this,this._providers,this.props.children,n,null);var h=this.base,p=pm(a),v=p.attributes,g=p.events,_=pm(this.props),m=_.attributes,b=_.events;return xst(hm(v),hm(m),h),Ist(g,b,this),Dst(a.style||{},this.props.style||{},h),n.push(function(){s?i._mounted():i._updated()}),!0},r._unmount=function(){var n=this.events,a=this.base;for(var i in n)a.removeEventListener(i,n[i]);this._providers.forEach(function(s){s._unmount()}),this.events={},this.props.portalContainer||a.parentNode.removeChild(a)},r._hasSVG=function(){if(this._isSVG||this.type==="svg")return!0;var n=av(this.container);return n&&"ownerSVGElement"in n},t}(_o);function av(e){if(!e)return null;var t=e.base;return t instanceof Node?t:av(e.container)}function to(e){if(!e)return null;if(e instanceof Node)return e;var t=e.$_provider._providers;return t.length?to(t[0].base):null}var Lst=function(e){ai(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}var r=t.prototype;return r._render=function(n){var a=this.type(this.props);return mo(this,this._providers,a?[a]:[],n),!0},r._unmount=function(){this._providers.forEach(function(n){n._unmount()})},t}(_o),Ly=function(e){ai(t,e);function t(n){var a=e.call(this,"container","container",0,null)||this;return a.base=n,a}var r=t.prototype;return r._render=function(){return!0},r._unmount=function(){},t}(_o),Fst=function(e){ai(t,e);function t(n,a,i,s,u,f){return f===void 0&&(f={}),e.call(this,n,a,i,s,u,gc(f,n.defaultProps))||this}var r=t.prototype;return r._should=function(n,a){return this.base.shouldComponentUpdate(gc(n,this.type.defaultProps),a||this.base.state)},r._render=function(n,a,i){var s=this;this.props=gc(this.props,this.type.defaultProps);var u=!this.base;u?(this.base=new this.type(this.props),this.base.$_provider=this):this.base.props=this.props;var f=this.base,c=f.state,h=f.render();h&&h.props&&!h.props.children.length&&(h.props.children=this.props.children),mo(this,this._providers,h?[h]:[],n,i,null),n.push(function(){u?(s._mounted(),f.componentDidMount()):(s._updated(),f.componentDidUpdate(a,c))})},r._setState=function(n){var a=this.base;!a||!n||(a.state=n)},r._unmount=function(){this._providers.forEach(function(n){n._unmount()}),clearTimeout(this.base.$_timer),this.base.componentWillUnmount()},t}(_o),iv=function(){function e(r){r===void 0&&(r={}),this.props=r,this.state={},this.$_timer=0,this.$_state={}}var t=e.prototype;return t.shouldComponentUpdate=function(r,n){return!0},t.render=function(){return null},t.setState=function(r,n,a){var i=this;this.$_timer||(this.$_state={}),clearTimeout(this.$_timer),this.$_timer=0,this.$_state=oa(oa({},this.$_state),r),a?this.$_setState(n,a):this.$_timer=setTimeout(function(){i.$_timer=0,i.$_setState(n,a)})},t.forceUpdate=function(r){this.setState({},r,!0)},t.componentDidMount=function(){},t.componentDidUpdate=function(r,n){},t.componentWillUnmount=function(){},t.$_setState=function(r,n){var a=[],i=this.$_provider,s=mo(i.container,[i],[i.original],a,oa(oa({},this.state),this.$_state),n);s&&(r&&a.push(r),Ry(a))},e}(),sv=function(e){ai(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}var r=t.prototype;return r.shouldComponentUpdate=function(n,a){return lh(this.props,n)||lh(this.state,a)},t}(iv),zst=function(e){ai(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}var r=t.prototype;return r.componentDidMount=function(){var n=this.props,a=n.element,i=n.container;this._portalProvider=new Ly(i),Pu(a,i,this._portalProvider)},r.componentDidUpdate=function(){var n=this.props,a=n.element,i=n.container;Pu(a,i,this._portalProvider)},r.componentWillUnmount=function(){var n=this.props.container;Pu(null,n,this._portalProvider),this._portalProvider=null},t}(sv);function Gst(e,t,r){var n=[];mo(e,e._providers,t,n,r),Ry(n)}function Nst(e,t){for(var r=e._providers,n=r.length,a=t.index+1;a<n;++a){var i=to(r[a].base);if(i)return i}return null}function jst(e,t,r){var n=r.map(function(f){return rn(f)?null:f.key}),a=lm(t.map(function(f){return f.key})),i=lm(n),s=Ef(a,i,function(f){return f});s.removed.forEach(function(f){t.splice(f,1)[0]._unmount()}),s.ordered.forEach(function(f){var c=f[0],h=f[1],p=t.splice(c,1)[0];t.splice(h,0,p);var v=to(p.base),g=to(t[h+1]&&t[h+1].base);v&&v.parentNode.insertBefore(v,g)}),s.added.forEach(function(f){t.splice(f,0,cm(r[f],n[f],f,e))});var u=s.maintained.filter(function(f){f[0];var c=f[1],h=r[c],p=t[c],v=rn(h)?"text_"+h:h.type;return v!==p.type?(p._unmount(),t.splice(c,1,cm(h,n[c],c,e)),!0):(p.index=c,!1)});return Pst(s.added,u.map(function(f){f[0];var c=f[1];return c}))}function mo(e,t,r,n,a,i){var s=jst(e,t,r),u=t.filter(function(c,h){return c._update(n,r[h],a,i)}),f=av(e);return f&&s.reverse().forEach(function(c){var h=t[c],p=to(h.base);if(!!p&&f!==p&&!p.parentNode){var v=Nst(e,h);f.insertBefore(p,v)}}),u.length>0}function Pu(e,t,r){r===void 0&&(r=t.__REACT_COMPAT__);var n=!!r;return r||(r=new Ly(t)),Gst(r,e?[e]:[]),n||(t.__REACT_COMPAT__=r),r}function vm(e,t,r){var n=t.__REACT_COMPAT__;e&&!n&&(t.innerHTML=""),Pu(e,t,n),r&&r()}function qst(e,t){return Ur(zst,{element:e,container:t})}var Ust="simple-1.1.0";function ov(e,t){for(var r=e.length,n=0;n<r;++n)if(t(e[n],n))return!0;return!1}function Fy(e,t){for(var r=e.length,n=0;n<r;++n)if(t(e[n],n))return e[n];return null}function kst(e){var t=e;if(typeof t=="undefined"){if(typeof navigator=="undefined"||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}function uv(e,t){try{return new RegExp(e,"g").exec(t)}catch{return null}}function Hst(){if(typeof navigator=="undefined"||!navigator||!navigator.userAgentData)return!1;var e=navigator.userAgentData,t=e.brands||e.uaList;return!!(t&&t.length)}function Wst(e,t){var r=uv("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",t);return r?r[3]:""}function ch(e){return e.replace(/_/g,".")}function Ts(e,t){var r=null,n="-1";return ov(e,function(a){var i=uv("("+a.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",t);return!i||a.brand?!1:(r=a,n=i[3]||"-1",a.versionAlias?n=a.versionAlias:a.versionTest&&(n=Wst(a.versionTest.toLowerCase(),t)||n),n=ch(n),!0)}),{preset:r,version:n}}function _u(e,t){var r={brand:"",version:"-1"};return ov(e,function(n){var a=zy(t,n);return a?(r.brand=n.id,r.version=n.versionAlias||a.version,r.version!=="-1"):!1}),r}function zy(e,t){return Fy(e,function(r){var n=r.brand;return uv(""+t.test,n.toLowerCase())})}var Gy=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],Ny=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],hh=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],jy=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],qy=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"win32|windows",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"macos|macintel|mac os x",id:"mac"},{test:"android|linux armv81",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Kst(e){var t=navigator.userAgentData,r=(t.uaList||t.brands).slice(),n=t.mobile||!1,a=r[0],i=(e&&e.platform||t.platform||navigator.platform).toLowerCase(),s={name:a.brand,version:a.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!_u(jy,r).brand},u={name:"unknown",version:"-1",majorVersion:-1};s.webkit=!s.chromium&&ov(hh,function(v){return zy(r,v)});var f=_u(Ny,r);if(s.chromium=!!f.brand,s.chromiumVersion=f.version,!s.chromium){var c=_u(hh,r);s.webkit=!!c.brand,s.webkitVersion=c.version}var h=Fy(qy,function(v){return new RegExp(""+v.test,"g").exec(i)});u.name=h?h.id:"",e&&(u.version=e.platformVersion);var p=_u(Gy,r);return p.brand&&(s.name=p.brand,s.version=e?e.uaFullVersion:p.version),s.webkit&&(u.name=n?"ios":"mac"),u.name==="ios"&&s.webview&&(s.version="-1"),u.version=ch(u.version),s.version=ch(s.version),u.majorVersion=parseInt(u.version,10),s.majorVersion=parseInt(s.version,10),{browser:s,os:u,isMobile:n,isHints:!0}}function Yst(e){var t=kst(e),r=!!/mobi/g.exec(t),n={name:"unknown",version:"-1",majorVersion:-1,webview:!!Ts(jy,t).preset,chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},a={name:"unknown",version:"-1",majorVersion:-1},i=Ts(Gy,t),s=i.preset,u=i.version,f=Ts(qy,t),c=f.preset,h=f.version,p=Ts(Ny,t);if(n.chromium=!!p.preset,n.chromiumVersion=p.version,!n.chromium){var v=Ts(hh,t);n.webkit=!!v.preset,n.webkitVersion=v.version}return c&&(a.name=c.id,a.version=h,a.majorVersion=parseInt(h,10)),s&&(n.name=s.id,n.version=u,n.webview&&a.name==="ios"&&n.name!=="safari"&&(n.webview=!1)),n.majorVersion=parseInt(n.version,10),{browser:n,os:a,isMobile:r,isHints:!1}}function Xst(e){return typeof e=="undefined"&&Hst()?Kst():Yst(e)}function Vst(e,t,r,n,a,i){for(var s=0;s<a;++s){var u=r+s*a,f=n+s*a;e[u]+=e[f]*i,t[u]+=t[f]*i}}function Zst(e,t,r,n,a){for(var i=0;i<a;++i){var s=r+i*a,u=n+i*a,f=e[s],c=t[s];e[s]=e[u],e[u]=f,t[s]=t[u],t[u]=c}}function Jst(e,t,r,n,a){for(var i=0;i<n;++i){var s=r+i*n;e[s]/=a,t[s]/=a}}function Uy(e,t,r){r===void 0&&(r=Math.sqrt(e.length));for(var n=e.slice(),a=0;a<r;++a)n[a*r+t-1]=0,n[(t-1)*r+a]=0;return n[(t-1)*(r+1)]=1,n}function gn(e,t){t===void 0&&(t=Math.sqrt(e.length));for(var r=e.slice(),n=Pe(t),a=0;a<t;++a){var i=t*a+a;if(!re(r[i],Or)){for(var s=a+1;s<t;++s)if(r[t*a+s]){Zst(r,n,a,s,t);break}}if(!re(r[i],Or))return[];Jst(r,n,a,t,r[i]);for(var s=0;s<t;++s){var u=s,f=s+a*t,c=r[f];!re(c,Or)||a===s||Vst(r,n,u,a,t,-c)}}return n}function Qst(e,t){t===void 0&&(t=Math.sqrt(e.length));for(var r=[],n=0;n<t;++n)for(var a=0;a<t;++a)r[a*t+n]=e[t*n+a];return r}function tot(e,t){t===void 0&&(t=Math.sqrt(e.length));for(var r=[],n=e[t*t-1],a=0;a<t-1;++a)r[a]=e[t*(t-1)+a]/n;return r[t-1]=0,r}function eot(e,t){for(var r=Pe(t),n=0;n<t-1;++n)r[t*(t-1)+n]=e[n]||0;return r}function $o(e,t){for(var r=e.slice(),n=e.length;n<t-1;++n)r[n]=0;return r[t-1]=1,r}function Un(e,t,r){if(t===void 0&&(t=Math.sqrt(e.length)),t===r)return e;for(var n=Pe(r),a=Math.min(t,r),i=0;i<a-1;++i){for(var s=0;s<a-1;++s)n[i*r+s]=e[i*t+s];n[(i+1)*r-1]=e[(i+1)*t-1],n[(r-1)*r+i]=e[(t-1)*t+i]}return n[r*r-1]=e[t*t-1],n}function ph(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Pe(e);return t.forEach(function(a){n=pe(n,a,e)}),n}function pe(e,t,r){r===void 0&&(r=Math.sqrt(e.length));var n=[],a=e.length/r,i=t.length/a;if(a){if(!i)return e}else return t;for(var s=0;s<r;++s)for(var u=0;u<i;++u){n[u*r+s]=0;for(var f=0;f<a;++f)n[u*r+s]+=e[f*r+s]*t[u*a+f]}return n}function Vt(e,t){for(var r=Math.min(e.length,t.length),n=e.slice(),a=0;a<r;++a)n[a]=n[a]+t[a];return n}function Gt(e,t){for(var r=Math.min(e.length,t.length),n=e.slice(),a=0;a<r;++a)n[a]=n[a]-t[a];return n}function rot(e,t){return t===void 0&&(t=e.length===6),t?[e[0],e[1],0,e[2],e[3],0,e[4],e[5],1]:e}function ky(e,t){return t===void 0&&(t=e.length===9),t?[e[0],e[1],e[3],e[4],e[6],e[7]]:e}function sr(e,t,r){r===void 0&&(r=t.length);var n=pe(e,t,r),a=n[r-1];return n.map(function(i){return i/a})}function not(e,t){return pe(e,[1,0,0,0,0,Math.cos(t),Math.sin(t),0,0,-Math.sin(t),Math.cos(t),0,0,0,0,1],4)}function aot(e,t){return pe(e,[Math.cos(t),0,-Math.sin(t),0,0,1,0,0,Math.sin(t),0,Math.cos(t),0,0,0,0,1],4)}function iot(e,t){return pe(e,Fi(t,4))}function mu(e,t){var r=t[0],n=r===void 0?1:r,a=t[1],i=a===void 0?1:a,s=t[2],u=s===void 0?1:s;return pe(e,[n,0,0,0,0,i,0,0,0,0,u,0,0,0,0,1],4)}function ua(e,t){return sr(Fi(t,3),$o(e,3))}function _c(e,t){var r=t[0],n=r===void 0?0:r,a=t[1],i=a===void 0?0:a,s=t[2],u=s===void 0?0:s;return pe(e,[1,0,0,0,0,1,0,0,0,0,1,0,n,i,u,1],4)}function dm(e,t){return pe(e,t,4)}function Fi(e,t){var r=Math.cos(e),n=Math.sin(e),a=Pe(t);return a[0]=r,a[1]=n,a[t]=-n,a[t+1]=r,a}function Pe(e){for(var t=e*e,r=[],n=0;n<t;++n)r[n]=n%(e+1)?0:1;return r}function Hy(e,t){for(var r=Pe(t),n=Math.min(e.length,t-1),a=0;a<n;++a)r[(t+1)*a]=e[a];return r}function eo(e,t){for(var r=Pe(t),n=Math.min(e.length,t-1),a=0;a<n;++a)r[t*(t-1)+a]=e[a];return r}function fv(e,t,r,n,a,i,s,u){var f=e[0],c=e[1],h=t[0],p=t[1],v=r[0],g=r[1],_=n[0],m=n[1],b=a[0],y=a[1],w=i[0],C=i[1],T=s[0],A=s[1],x=u[0],I=u[1],B=[f,0,h,0,v,0,_,0,c,0,p,0,g,0,m,0,1,0,1,0,1,0,1,0,0,f,0,h,0,v,0,_,0,c,0,p,0,g,0,m,0,1,0,1,0,1,0,1,-b*f,-y*f,-w*h,-C*h,-T*v,-A*v,-x*_,-I*_,-b*c,-y*c,-w*p,-C*p,-T*g,-A*g,-x*m,-I*m],P=gn(B,8);if(!P.length)return[];var L=pe(P,[b,y,w,C,T,A,x,I],8);return L[8]=1,Un(Qst(L),3,4)}function sot(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function oot(e){return Ti(Na(e))}function uot(e,t){var r=sr(e,[t[0],t[1]||0,t[2]||0,1],4),n=r[3]||1;return[r[0]/n,r[1]/n,r[2]/n]}function Ti(e){var t=sot();return e.forEach(function(r){var n=r.matrixFunction,a=r.functionValue;!n||(t=n(t,a))}),t}function Na(e){var t=ni(e)?e:da(e);return t.map(function(r){var n=ev(r),a=n.prefix,i=n.value,s=null,u=a,f="";if(a==="translate"||a==="translateX"||a==="translate3d"){var c=Ua(i).map(function(L){return parseFloat(L)}),h=c[0],p=c[1],v=p===void 0?0:p,g=c[2],_=g===void 0?0:g;s=_c,f=[h,v,_]}else if(a==="translateY"){var v=parseFloat(i);s=_c,f=[0,v,0]}else if(a==="translateZ"){var _=parseFloat(i);s=_c,f=[0,0,_]}else if(a==="scale"||a==="scale3d"){var m=Ua(i).map(function(L){return parseFloat(L)}),b=m[0],y=m[1],w=y===void 0?b:y,C=m[2],T=C===void 0?1:C;s=mu,f=[b,w,T]}else if(a==="scaleX"){var b=parseFloat(i);s=mu,f=[b,1,1]}else if(a==="scaleY"){var w=parseFloat(i);s=mu,f=[1,w,1]}else if(a==="scaleZ"){var T=parseFloat(i);s=mu,f=[1,1,T]}else if(a==="rotate"||a==="rotateZ"||a==="rotateX"||a==="rotateY"){var A=go(i),x=A.unit,I=A.value,B=x==="rad"?I:I*Math.PI/180;a==="rotate"||a==="rotateZ"?(u="rotateZ",s=iot):a==="rotateX"?s=not:a==="rotateY"&&(s=aot),f=B}else if(a==="matrix3d")s=dm,f=Ua(i).map(function(L){return parseFloat(L)});else if(a==="matrix"){var P=Ua(i).map(function(L){return parseFloat(L)});s=dm,f=[P[0],P[1],0,0,P[2],P[3],0,0,0,0,1,0,P[4],P[5],0,1]}else u="";return{name:a,functionName:u,value:i,matrixFunction:s,functionValue:f}})}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var vh=function(e,t){return vh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},vh(e,t)};function fot(e,t){vh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Wy=typeof Map=="function"?void 0:function(){var e=0;return function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}}(),lot=function(e){fot(t,e);function t(r){return r===void 0&&(r=[]),e.call(this,r,Wy)||this}return t}(pst);function cot(e,t){return Ef(e,t,Wy)}var hot=lot;/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */function pot(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,a++)n[a]=i[s];return n}function Ky(e){return e.length<3?0:Math.abs(Ost(e.map(function(t,r){var n=e[r+1]||e[0];return t[0]*n[1]-n[0]*t[1]})))/2}function gm(e,t){var r=t.width,n=t.height,a=t.left,i=t.top,s=Cf(e),u=s.minX,f=s.minY,c=s.maxX,h=s.maxY,p=r/(c-u),v=n/(h-f);return e.map(function(g){return[a+(g[0]-u)*p,i+(g[1]-f)*v]})}function Cf(e){var t=e.map(function(n){return n[0]}),r=e.map(function(n){return n[1]});return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,r),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,r)}}function dh(e,t,r){var n=e[0],a=e[1],i=Cf(t),s=i.minX,u=i.minY,f=i.maxX,c=i.maxY,h=[[s,a],[f,a]],p=[[n,u],[n,c]],v=zs(h[0],h[1]),g=zs(p[0],p[1]),_=mh(t),m=[],b=[];return _.forEach(function(y){var w=zs(y[0],y[1]),C=_h(gh(v,w),[h,y]),T=_h(gh(g,w),[p,y]);(C.length!==1||y[0][1]!==a)&&m.push.apply(m,C),(T.length!==1||y[0][0]!==n)&&b.push.apply(b,T),w[0]||m.push.apply(m,C),w[1]||b.push.apply(b,T)}),!!(!r&&(nn(m,function(y){return y[0]===n})>-1||nn(b,function(y){return y[1]===a})>-1)||m.filter(function(y){return y[0]>n}).length%2&&b.filter(function(y){return y[1]>a}).length%2)}function zs(e,t){var r=e[0],n=e[1],a=t[0],i=t[1];if(r===a&&n===i)return[0,0,0];if(r===a)return[1,0,-r];if(n===i)return[0,1,-n];var s=(a-r)/(n-i),u=-r-s*n;return[1,s,u]}function gh(e,t){var r=e[0],n=e[1],a=e[2],i=t[0],s=t[1],u=t[2],f=r===0&&i===0,c=n===0&&s===0;if(f&&c)return[];if(f){var h=-a/n,p=-u/s;return h!==p?[]:[[-1/0,h],[1/0,h]]}else if(c){var v=-a/r,g=-u/i;return v!==g?[]:[[v,-1/0],[v,1/0]]}else if(r===0){var _=-a/n,m=-(s*_+u)/i;return[[m,_]]}else if(i===0){var _=-u/s,m=-(n*_+a)/r;return[[m,_]]}else if(n===0){var m=-a/r,_=-(i*m+u)/s;return[[m,_]]}else if(s===0){var m=-u/i,_=-(r*m+a)/n;return[[m,_]]}else{var m=(n*u-s*a)/(s*r-n*i),_=-(r*m+a)/n;return[[m,_]]}}function _h(e,t){var r=t.map(function(h){return[0,1].map(function(p){return[Math.min(h[0][p],h[1][p]),Math.max(h[0][p],h[1][p])]})});if(e.length===2){var n=e[0],a=n[0],i=n[1];if(a===e[1][0]){var s=Math.max.apply(Math,r.map(function(h){return h[1][0]})),u=Math.min.apply(Math,r.map(function(h){return h[1][1]}));return s>u?[]:[[a,s],[a,u]]}else if(i===e[1][1]){var f=Math.max.apply(Math,r.map(function(h){return h[0][0]})),c=Math.min.apply(Math,r.map(function(h){return h[0][1]}));return f>c?[]:[[f,i],[c,i]]}}return e.filter(function(h){return r.every(function(p){return p[0][0]<=h[0]&&h[0]<=p[0][1]&&p[1][0]<=h[1]&&h[1]<=p[1][1]})})}function mh(e){return pot(e.slice(1),[e[0]]).map(function(t,r){return[e[r],t]})}function vot(e,t){var r=e.slice(),n=t.slice();uh(r)===-1&&r.reverse(),uh(n)===-1&&n.reverse();var a=mh(r),i=mh(n),s=a.map(function(p){return zs(p[0],p[1])}),u=i.map(function(p){return zs(p[0],p[1])}),f=[];s.forEach(function(p,v){var g=a[v],_=[];u.forEach(function(m,b){var y=gh(p,m),w=_h(y,[g,i[b]]);_.push.apply(_,w.map(function(C){return{index1:v,index2:b,pos:C}}))}),_.sort(function(m,b){return Gn(g[0],m.pos)-Gn(g[0],b.pos)}),f.push.apply(f,_),dh(g[1],n)&&f.push({index1:v,index2:-1,pos:g[1]})}),i.forEach(function(p,v){if(dh(p[1],r)){var g=!1,_=nn(f,function(m){var b=m.index2;return b===v?(g=!0,!1):!!g});_===-1&&(g=!1,_=nn(f,function(m){var b=m.index1,y=m.index2;return b===-1&&y+1===v?(g=!0,!1):!!g})),_===-1?f.push({index1:-1,index2:v,pos:p[1]}):f.splice(_,0,{index1:-1,index2:v,pos:p[1]})}});var c=f.map(function(p){var v=p.pos;return v}),h={};return c.filter(function(p){var v=p[0]+"x"+p[1];return h[v]?!1:(h[v]=!0,!0)})}function dot(e,t){var r=vot(e,t);return Ky(r)}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var $h=function(){return $h=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},$h.apply(this,arguments)};function got(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,a++)n[a]=i[s];return n}var _ot=function(){function e(){this._events={}}var t=e.prototype;return t.on=function(r,n){if(va(r))for(var a in r)this.on(a,r[a]);else this._addEvent(r,n,{});return this},t.off=function(r,n){if(!r)this._events={};else if(va(r))for(var a in r)this.off(a);else if(!n)this._events[r]=[];else{var i=this._events[r];if(i){var s=nn(i,function(u){return u.listener===n});s>-1&&i.splice(s,1)}}return this},t.once=function(r,n){var a=this;return n&&this._addEvent(r,n,{once:!0}),new Promise(function(i){a._addEvent(r,i,{once:!0})})},t.emit=function(r,n){var a=this;n===void 0&&(n={});var i=this._events[r];if(!r||!i)return!0;var s=!1;return n.eventType=r,n.stop=function(){s=!0},n.currentTarget=this,got(i).forEach(function(u){u.listener(n),u.once&&a.off(r,u.listener)}),!s},t.trigger=function(r,n){return n===void 0&&(n={}),this.emit(r,n)},t._addEvent=function(r,n,a){var i=this._events;i[r]=i[r]||[];var s=i[r];s.push($h({listener:n},a))},e}(),Yy=_ot;/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var bh=function(e,t){return bh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},bh(e,t)};function mot(e,t){bh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Mi=function(){return Mi=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Mi.apply(this,arguments)};function $ot(e){var t=e.container;return t===document.body?[t.scrollLeft||document.documentElement.scrollLeft,t.scrollTop||document.documentElement.scrollTop]:[t.scrollLeft,t.scrollTop]}var bot=function(e){mot(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n._startRect=null,n._startPos=[],n._prevTime=0,n._timer=0,n._prevScrollPos=[0,0],n._isWait=!1,n}var r=t.prototype;return r.dragStart=function(n,a){var i=a.container,s=0,u=0,f=0,c=0;if(i===document.body)f=window.innerWidth,c=window.innerHeight;else{var h=i.getBoundingClientRect();s=h.top,u=h.left,f=h.width,c=h.height}this._startPos=[n.clientX,n.clientY],this._startRect={top:s,left:u,width:f,height:c},this._prevScrollPos=this._getScrollPosition([0,0],a)},r.drag=function(n,a){var i=n.clientX,s=n.clientY,u=a.threshold,f=u===void 0?0:u,c=this,h=c._startRect,p=c._startPos,v=[0,0];return h.top>s-f?(p[1]>h.top||s<p[1])&&(v[1]=-1):h.top+h.height<s+f&&(p[1]<h.top+h.height||s>p[1])&&(v[1]=1),h.left>i-f?(p[0]>h.left||i<p[0])&&(v[0]=-1):h.left+h.width<i+f&&(p[0]<h.left+h.width||i>p[0])&&(v[0]=1),clearTimeout(this._timer),!v[0]&&!v[1]?!1:this._continueDrag(Mi(Mi({},a),{direction:v,inputEvent:n,isDrag:!0}))},r.checkScroll=function(n){var a=this;if(this._isWait)return!1;var i=n.prevScrollPos,s=i===void 0?this._prevScrollPos:i,u=n.direction,f=n.throttleTime,c=f===void 0?0:f,h=n.inputEvent,p=n.isDrag,v=this._getScrollPosition(u||[0,0],n),g=v[0]-s[0],_=v[1]-s[1],m=u||[g?Math.abs(g)/g:0,_?Math.abs(_)/_:0];return this._prevScrollPos=v,!g&&!_?!1:(this.trigger("move",{offsetX:m[0]?g:0,offsetY:m[1]?_:0,inputEvent:h}),c&&p&&(this._timer=window.setTimeout(function(){a._continueDrag(n)},c)),!0)},r.dragEnd=function(){clearTimeout(this._timer)},r._getScrollPosition=function(n,a){var i=a.container,s=a.getScrollPosition,u=s===void 0?$ot:s;return u({container:i,direction:n})},r._continueDrag=function(n){var a=this,i=n.container,s=n.direction,u=n.throttleTime,f=n.useScroll,c=n.isDrag,h=n.inputEvent;if(!(c&&this._isWait)){var p=Js(),v=Math.max(u+this._prevTime-p,0);if(v>0)return this._timer=window.setTimeout(function(){a._continueDrag(n)},v),!1;this._prevTime=p;var g=this._getScrollPosition(s,n);return this._prevScrollPos=g,c&&(this._isWait=!0),this.trigger("scroll",{container:i,direction:s,inputEvent:h}),this._isWait=!1,f||this.checkScroll(Mi(Mi({},n),{prevScrollPos:g,direction:s,inputEvent:h}))}},t}(Yy),yot=bot;/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var yh=function(e,t){return yh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},yh(e,t)};function wot(e,t){yh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var qr=function(){return qr=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},qr.apply(this,arguments)};function Sot(e,t){var r=t[0]-e[0],n=t[1]-e[1],a=Math.atan2(n,r);return a>=0?a:a+Math.PI*2}function mc(e){return Sot([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function Eot(e){return e.touches&&e.touches.length>=2}function $c(e){return e.touches?Cot(e.touches):[Xy(e)]}function _m(e,t,r){var n=r.length,a=Gs(e,n),i=a.clientX,s=a.clientY,u=a.originalClientX,f=a.originalClientY,c=Gs(t,n),h=c.clientX,p=c.clientY,v=Gs(r,n),g=v.clientX,_=v.clientY,m=i-h,b=s-p,y=i-g,w=s-_;return{clientX:u,clientY:f,deltaX:m,deltaY:b,distX:y,distY:w}}function bc(e){return Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2))}function Cot(e){for(var t=Math.min(e.length,2),r=[],n=0;n<t;++n)r.push(Xy(e[n]));return r}function Xy(e){return{clientX:e.clientX,clientY:e.clientY}}function Gs(e,t){t===void 0&&(t=e.length);for(var r={clientX:0,clientY:0,originalClientX:0,originalClientY:0},n=0;n<t;++n){var a=e[n];r.originalClientX+="originalClientX"in a?a.originalClientX:a.clientX,r.originalClientY+="originalClientY"in a?a.originalClientY:a.clientY,r.clientX+=a.clientX,r.clientY+=a.clientY}return t?{clientX:r.clientX/t,clientY:r.clientY/t,originalClientX:r.originalClientX/t,originalClientY:r.originalClientY/t}:r}var mm=function(){function e(r){this.prevClients=[],this.startClients=[],this.movement=0,this.length=0,this.startClients=r,this.prevClients=r,this.length=r.length}var t=e.prototype;return t.getAngle=function(r){return r===void 0&&(r=this.prevClients),mc(r)},t.getRotation=function(r){return r===void 0&&(r=this.prevClients),mc(r)-mc(this.startClients)},t.getPosition=function(r,n){r===void 0&&(r=this.prevClients);var a=_m(r||this.prevClients,this.prevClients,this.startClients),i=a.deltaX,s=a.deltaY;return this.movement+=Math.sqrt(i*i+s*s),this.prevClients=r,a},t.getPositions=function(r){r===void 0&&(r=this.prevClients);var n=this.prevClients;return this.startClients.map(function(a,i){return _m([r[i]],[n[i]],[a])})},t.getMovement=function(r){var n=this.movement;if(!r)return n;var a=Gs(r,this.length),i=Gs(this.prevClients,this.length),s=a.clientX-i.clientX,u=a.clientY-i.clientY;return Math.sqrt(s*s+u*u)+n},t.getDistance=function(r){return r===void 0&&(r=this.prevClients),bc(r)},t.getScale=function(r){return r===void 0&&(r=this.prevClients),bc(r)/bc(this.startClients)},t.move=function(r,n){this.startClients.forEach(function(a){a.clientX-=r,a.clientY-=n})},e}(),$m=["textarea","input"],Oot=function(e){wot(t,e);function t(n,a){a===void 0&&(a={});var i=e.call(this)||this;i.options={},i.flag=!1,i.pinchFlag=!1,i.datas={},i.isDrag=!1,i.isPinch=!1,i.isMouse=!1,i.isTouch=!1,i.clientStores=[],i.targets=[],i.prevTime=0,i.doubleFlag=!1,i._dragFlag=!1,i.onDragStart=function(v,g){if(g===void 0&&(g=!0),!(!i.flag&&v.cancelable===!1)){var _=i.options,m=_.container,b=_.pinchOutside,y=_.preventRightClick,w=_.preventDefault,C=_.checkInput,T=i.isTouch,A=!i.flag;if(A){var x=document.activeElement,I=v.target,B=I.tagName.toLowerCase(),P=$m.indexOf(B)>-1,L=I.isContentEditable;if(P||L){if(C||x===I||x&&L&&x.isContentEditable&&x.contains(I))return!1}else if((w||v.type==="touchstart")&&x){var G=x.tagName;(x.isContentEditable||$m.indexOf(G)>-1)&&x.blur()}if(i.clientStores=[new mm($c(v))],i.flag=!0,i.isDrag=!1,i._dragFlag=!0,i.datas={},y&&(v.which===3||v.button===2))return i.initDrag(),!1;i.doubleFlag=Js()-i.prevTime<200;var K=i.emit("dragStart",qr({datas:i.datas,inputEvent:v,isTrusted:g,isDouble:i.doubleFlag},i.getCurrentStore().getPosition(),{preventDefault:function(){v.preventDefault()},preventDrag:function(){i._dragFlag=!1}}));K===!1&&i.initDrag(),i.flag&&w&&v.preventDefault()}if(!i.flag)return!1;var at=0;if(A&&T&&b&&(at=setTimeout(function(){Jr(m,"touchstart",i.onDragStart,{passive:!1})})),!A&&T&&b&&hr(m,"touchstart",i.onDragStart),i.flag&&Eot(v)){if(clearTimeout(at),A&&v.touches.length!==v.changedTouches.length)return;i.pinchFlag||i.onPinchStart(v)}}},i.onDrag=function(v,g){if(!!i.flag){var _=$c(v),m=i.moveClients(_,v,!1);if(i._dragFlag){if(i.pinchFlag||m.deltaX||m.deltaY){var b=i.emit("drag",qr({},m,{isScroll:!!g,inputEvent:v}));if(b===!1){i.stop();return}}i.pinchFlag&&i.onPinch(v,_)}i.getCurrentStore().getPosition(_,!0)}},i.onDragEnd=function(v){if(!!i.flag){var g=i.options,_=g.pinchOutside,m=g.container;i.isTouch&&_&&hr(m,"touchstart",i.onDragStart),i.flag=!1;var b=i._getPosition(),y=Js(),w=!i.isDrag&&i.doubleFlag;i.prevTime=i.isDrag||w?0:y,i.emit("dragEnd",qr({datas:i.datas,isDouble:w,isDrag:i.isDrag,isClick:!i.isDrag,inputEvent:v},b)),i.pinchFlag&&i.onPinchEnd(v),i.clientStores=[]}},i.onBlur=function(){i.onDragEnd()};var s=[].concat(n);i.options=qr({checkInput:!1,container:s.length>1?window:s[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},a);var u=i.options,f=u.container,c=u.events,h=u.checkWindowBlur;if(i.isTouch=c.indexOf("touch")>-1,i.isMouse=c.indexOf("mouse")>-1,i.targets=s,i.isMouse&&(s.forEach(function(v){Jr(v,"mousedown",i.onDragStart)}),Jr(f,"mousemove",i.onDrag),Jr(f,"mouseup",i.onDragEnd),Jr(f,"contextmenu",i.onDragEnd)),h&&Jr(window,"blur",i.onBlur),i.isTouch){var p={passive:!1};s.forEach(function(v){Jr(v,"touchstart",i.onDragStart,p)}),Jr(f,"touchmove",i.onDrag,p),Jr(f,"touchend",i.onDragEnd,p),Jr(f,"touchcancel",i.onDragEnd,p)}return i}var r=t.prototype;return r.stop=function(){this.isDrag=!1,this.flag=!1,this.clientStores=[],this.datas={}},r.getMovement=function(n){return this.getCurrentStore().getMovement(n)+this.clientStores.slice(1).reduce(function(a,i){return a+i.movement},0)},r.isDragging=function(){return this.isDrag},r.isFlag=function(){return this.flag},r.isPinchFlag=function(){return this.pinchFlag},r.isDoubleFlag=function(){return this.doubleFlag},r.isPinching=function(){return this.isPinch},r.scrollBy=function(n,a,i,s){s===void 0&&(s=!0),this.flag&&(this.clientStores[0].move(n,a),s&&this.onDrag(i,!0))},r.move=function(n,a){var i=n[0],s=n[1],u=this.getCurrentStore(),f=u.prevClients;return this.moveClients(f.map(function(c){var h=c.clientX,p=c.clientY;return{clientX:h+i,clientY:p+s,originalClientX:h,originalClientY:p}}),a,!0)},r.triggerDragStart=function(n){this.onDragStart(n,!1)},r.setEventDatas=function(n){var a=this.datas;for(var i in n)a[i]=n[i];return this},r.getCurrentEvent=function(n){return qr({datas:this.datas},this._getPosition(),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:n})},r.getEventDatas=function(){return this.datas},r.unset=function(){var n=this,a=this.targets,i=this.options.container;this.off(),hr(window,"blur",this.onBlur),this.isMouse&&(a.forEach(function(s){hr(s,"mousedown",n.onDragStart)}),hr(i,"mousemove",this.onDrag),hr(i,"mouseup",this.onDragEnd),hr(i,"contextmenu",this.onDragEnd)),this.isTouch&&(a.forEach(function(s){hr(s,"touchstart",n.onDragStart)}),hr(i,"touchstart",this.onDragStart),hr(i,"touchmove",this.onDrag),hr(i,"touchend",this.onDragEnd),hr(i,"touchcancel",this.onDragEnd))},r.onPinchStart=function(n){var a=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>a)){var i=new mm($c(n));this.pinchFlag=!0,this.clientStores.splice(0,0,i);var s=this.emit("pinchStart",qr({datas:this.datas,angle:i.getAngle(),touches:this.getCurrentStore().getPositions()},i.getPosition(),{inputEvent:n}));s===!1&&(this.pinchFlag=!1)}},r.onPinch=function(n,a){if(!(!this.flag||!this.pinchFlag||a.length<2)){var i=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",qr({datas:this.datas,movement:this.getMovement(a),angle:i.getAngle(a),rotation:i.getRotation(a),touches:i.getPositions(a),scale:i.getScale(a),distance:i.getDistance(a)},i.getPosition(a),{inputEvent:n}))}},r.onPinchEnd=function(n){if(!!this.pinchFlag){var a=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var i=this.getCurrentStore();this.emit("pinchEnd",qr({datas:this.datas,isPinch:a,touches:i.getPositions()},i.getPosition(),{inputEvent:n})),this.isPinch=!1,this.pinchFlag=!1}},r.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},r.getCurrentStore=function(){return this.clientStores[0]},r.moveClients=function(n,a,i){var s=this._getPosition(n,i);return(s.deltaX||s.deltaY)&&(this.isDrag=!0),qr({datas:this.datas},s,{movement:this.getMovement(n),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:a})},r._getPosition=function(n,a){var i=this.getCurrentStore(),s=i.getPosition(n,a),u=this.clientStores.slice(1).reduce(function(h,p){var v=p.getPosition();return h.distX+=v.distX,h.distY+=v.distY,h},s),f=u.distX,c=u.distY;return qr({},s,{distX:f,distY:c})},t}(Yy),Aot=Oot;function Tot(e){for(var t=5381,r=e.length;r;)t=t*33^e.charCodeAt(--r);return t>>>0}var Mot=Tot;function Pot(e){return Mot(e).toString(36)}function xot(e){if(e&&e.getRootNode){var t=e.getRootNode();if(t.nodeType===11)return t}}function Iot(e,t,r){return r.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/mg,function(n,a){var i=a.trim();return(i?Ua(i):[""]).map(function(s){var u=s.trim();return u.indexOf("@")===0?u:u.indexOf(":global")>-1?u.replace(/\:global/g,""):u.indexOf(":host")>-1?""+u.replace(/\:host/g,"."+e):u?"."+e+" "+u:"."+e}).join(", ")+" {"})}function Dot(e,t,r,n){var a=document.createElement("style");return a.setAttribute("type","text/css"),a.setAttribute("data-styled-id",e),r.nonce&&a.setAttribute("nonce",r.nonce),a.innerHTML=Iot(e,t,r),(n||document.head||document.body).appendChild(a),a}function Rot(e){var t="rCS"+Pot(e),r=0,n;return{className:t,inject:function(a,i){i===void 0&&(i={});var s=xot(a),u=r===0,f;return(s||u)&&(f=Dot(t,e,i,s)),u&&(n=f),s||++r,{destroy:function(){s?(a.removeChild(f),f=null):(r>0&&--r,r===0&&n&&(n.parentNode.removeChild(n),n=null))}}}}}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
this file except in compliance with the License. You may obtain a copy of the
|
|
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
and limitations under the License.
|
|
***************************************************************************** */var wh=function(e,t){return wh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},wh(e,t)};function Vy(e,t){wh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Sh=function(){return Sh=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Sh.apply(this,arguments)};function Bot(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var Lot=function(e){Vy(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.injectResult=null,n.tag="div",n}var r=t.prototype;return r.render=function(){var n=this.props,a=n.className,i=a===void 0?"":a;n.cspNonce;var s=n.portalContainer,u=Bot(n,["className","cspNonce","portalContainer"]),f=this.injector.className,c=this.tag,h={};return Ust.indexOf("simple")>-1&&s&&(h={portalContainer:s}),Ur(c,Sh({ref:pn(this,"element"),"data-styled-id":f,className:i+" "+f},h,u))},r.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},r.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},r.getElement=function(){return this.element},t}(iv);function Zy(e,t){var r=Rot(t);return function(n){Vy(a,n);function a(){var i=n!==null&&n.apply(this,arguments)||this;return i.injector=r,i.tag=e,i}return a}(Lot)}/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Eh=function(e,t){return Eh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},Eh(e,t)};function bo(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Eh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Q=function(){return Q=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Q.apply(this,arguments)};function Fot(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function zot(e,t,r,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(a<3?s(i):a>3?s(t,r,i):s(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}function Rt(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function yo(e,t){var r;return Q({events:{},props:(r={},r[e]=Boolean,r),name:e},t)}function Got(e,t){return'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="'+32*e+'px" height="'+32*e+'px" viewBox="0 0 32 32" ><path d="M 16,5 L 12,10 L 14.5,10 L 14.5,22 L 12,22 L 16,27 L 20,22 L 17.5,22 L 17.5,10 L 20, 10 L 16,5 Z" stroke-linejoin="round" stroke-width="1.2" fill="black" stroke="white" style="transform:rotate('+t+'deg);transform-origin: 16px 16px"></path></svg>'}function Not(e){var t=Got(1,e),r=Math.round(e/45)*45%180,n="ns-resize";return r===135?n="nwse-resize":r===45?n="nesw-resize":r===90&&(n="ew-resize"),"cursor:"+n+";cursor: url('"+t+"') 16 16, "+n+";"}var jot=Xst(),Jy=jot.browser.webkit,Qy=Jy&&function(){var e=typeof window=="undefined"?{userAgent:""}:window.navigator,t=/applewebkit\/([^\s]+)/g.exec(e.userAgent.toLowerCase());return t?parseFloat(t[1])<605:!1}(),lv="moveable-",qot=`
|
|
{
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
left: 0;
|
|
top: 0;
|
|
z-index: 3000;
|
|
--moveable-color: #4af;
|
|
--zoom: 1;
|
|
--zoompx: 1px;
|
|
will-change: transform;
|
|
}
|
|
.control-box {
|
|
z-index: 0;
|
|
}
|
|
.line, .control {
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
will-change: transform;
|
|
}
|
|
.control {
|
|
width: 14px;
|
|
height: 14px;
|
|
border-radius: 50%;
|
|
border: 2px solid #fff;
|
|
box-sizing: border-box;
|
|
background: #4af;
|
|
background: var(--moveable-color);
|
|
margin-top: -7px;
|
|
margin-left: -7px;
|
|
border: 2px solid #fff;
|
|
z-index: 10;
|
|
}
|
|
.padding {
|
|
position: absolute;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 100px;
|
|
height: 100px;
|
|
transform-origin: 0 0;
|
|
}
|
|
.line {
|
|
width: 1px;
|
|
height: 1px;
|
|
background: #4af;
|
|
background: var(--moveable-color);
|
|
transform-origin: 0px 50%;
|
|
}
|
|
.line.dashed {
|
|
box-sizing: border-box;
|
|
background: transparent;
|
|
}
|
|
.line.dashed.horizontal {
|
|
border-top: 1px dashed #4af;
|
|
border-top-color: #4af;
|
|
border-top-color: var(--moveable-color);
|
|
}
|
|
.line.dashed.vertical {
|
|
border-left: 1px dashed #4af;
|
|
border-left-color: #4af;
|
|
border-left-color: var(--moveable-color);
|
|
}
|
|
.line.vertical {
|
|
transform: translateX(-50%);
|
|
}
|
|
.line.horizontal {
|
|
transform: translateY(-50%);
|
|
}
|
|
.line.vertical.bold {
|
|
width: 2px;
|
|
}
|
|
.line.horizontal.bold {
|
|
height: 2px;
|
|
}
|
|
|
|
.control.origin {
|
|
border-color: #f55;
|
|
background: #fff;
|
|
width: 12px;
|
|
height: 12px;
|
|
margin-top: -6px;
|
|
margin-left: -6px;
|
|
pointer-events: none;
|
|
}
|
|
`+[0,15,30,45,60,75,90,105,120,135,150,165].map(function(e){return`
|
|
.direction[data-rotation="`+e+`"] {
|
|
`+Not(e)+`
|
|
}
|
|
`}).join(`
|
|
`)+`
|
|
.group {
|
|
z-index: -1;
|
|
}
|
|
.area {
|
|
position: absolute;
|
|
}
|
|
.area-pieces {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: none;
|
|
}
|
|
.area.avoid, .area.pass {
|
|
pointer-events: none;
|
|
}
|
|
.area.avoid+.area-pieces {
|
|
display: block;
|
|
}
|
|
.area-piece {
|
|
position: absolute;
|
|
}
|
|
|
|
`+(Qy?`:global svg *:before {
|
|
content:"";
|
|
transform-origin: inherit;
|
|
}`:"")+`
|
|
`,Uot=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],kot=1e-4,Mr=1e-7,$u=1e-9,Ds=Math.pow(10,10),bm=-Ds,tw=["n","w","s","e","nw","ne","sw","se"],Hot={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},Wot={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},ew=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate"];function Kot(e,t){return[e[0]*t[0],e[1]*t[1]]}function Ht(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ast.apply(void 0,Rt([lv],e))}function Yot(e){if(!e||e==="none")return[1,0,0,1,0,0];if(va(e))return e;var t=ev(e).value;return t.split(/s*,\s*/g).map(function(r){return parseFloat(r)})}function cv(e,t,r){return ph(t,eo(r,t),e,eo(r.map(function(n){return-n}),t))}function Xot(e,t,r){if(t==="%"){var n=hv(e.ownerSVGElement);return n[r?"width":"height"]/100}return 1}function Vot(e){var t=Ch(dr(e,":before"));return t.map(function(r,n){var a=go(r),i=a.value,s=a.unit;return i*Xot(e,s,n===0)})}function Ch(e){var t=e.transformOrigin;return t?t.split(" "):["0","0"]}function ju(e,t,r){for(var n=document.body,a=!e||r?e:e.parentElement,i=e===t||a===t,s="relative";a&&a!==n;){t===a&&(i=!0);var u=dr(a),f=u.transform;if(s=u.position,a.tagName.toLowerCase()==="svg"||s!=="static"||f&&f!=="none")break;a=a.parentElement,s="relative"}return{isStatic:s==="static",isEnd:i||!a||a===n,offsetParent:a||n}}function Zot(e,t,r,n){var a,i=e.tagName.toLowerCase(),s=e.offsetLeft,u=e.offsetTop;if(n){var f=(t||document.documentElement).getBoundingClientRect();s-=f.left,u-=f.top}var c=Ha(s),h=!c,p,v;return!h&&i!=="svg"?(p=Qy?Vot(e):Ch(r).map(function(g){return parseFloat(g)}),v=p.slice(),h=!0,a=eut(e,p),s=a[0],u=a[1],p[0]=a[2],p[1]=a[3]):(p=Ch(r).map(function(g){return parseFloat(g)}),v=p.slice()),{tagName:i,isSVG:c,hasOffset:h,offset:[s||0,u||0],origin:p,targetOrigin:v}}function rw(e,t,r){r===void 0&&(r=dr(e));var n=dr(document.body),a=n.position;if(!t&&(!a||a==="static"))return[0,0];var i=parseInt(n.marginLeft,10),s=parseInt(n.marginTop,10);return r.position==="absolute"&&((r.top!=="auto"||r.bottom!=="auto")&&(s=0),(r.left!=="auto"||r.right!=="auto")&&(i=0)),[i,s]}function Oh(e){e.forEach(function(t){var r=t.matrix;r&&(t.matrix=Un(r,3,4))})}function ym(e,t,r){for(var n=e,a=[],i=!r&&e===t,s=i,u=!1,f=3,c,h,p,v=ju(t,t,!0).offsetParent;n&&!s;){s=i;var g=dr(n),_=g.position,m=_==="fixed",b=rot(Yot(g.transform)),y=b.length;!u&&y===16&&(u=!0,f=4,Oh(a),p&&(p=Un(p,3,4))),u&&y===9&&(b=Un(b,3,4));var w=Zot(n,t,g,m),C=w.tagName,T=w.hasOffset,A=w.isSVG,x=w.origin,I=w.targetOrigin,B=w.offset,P=B[0],L=B[1];C==="svg"&&p?(a.push({type:"target",target:n,matrix:tut(n,f)}),a.push({type:"offset",target:n,matrix:Pe(f)})):C==="g"&&e!==n&&(P=0,L=0);var G=ju(n,t),K=G.offsetParent,at=G.isEnd,et=G.isStatic;Jy&&T&&!A&&et&&(_==="relative"||_==="static")&&(P-=K.offsetLeft,L-=K.offsetTop,i=i||at);var rt=0,gt=0;if(T&&v!==K&&(rt=K.clientLeft,gt=K.clientTop),T&&K===document.body){var Z=rw(n,!1,g);P+=Z[0],L+=Z[1]}if(a.push({type:"target",target:n,matrix:cv(b,f,x)}),T?a.push({type:"offset",target:n,matrix:eo([P-n.scrollLeft+rt,L-n.scrollTop+gt],f)}):a.push({type:"offset",target:n,origin:x}),p||(p=b),c||(c=x),h||(h=I),s||m)break;n=K,i=at,(!r||n===document.body)&&(s=i)}return p||(p=Pe(f)),c||(c=[0,0]),h||(h=[0,0]),{offsetContainer:v,matrixes:a,targetMatrix:p,transformOrigin:c,targetOrigin:h,is3d:u}}function Jot(e,t,r,n){var a;r===void 0&&(r=t);var i=0,s=0,u=0,f={};if(e){var c=dr(e);i=e.offsetWidth,s=e.offsetHeight,Ha(i)&&(a=iw(e,c,!0),i=a[0],s=a[1])}if(e){var h=Qot(e,t,r,n),p=qu(h.allMatrix,h.transformOrigin,i,s);f=Q(Q({},h),p);var v=qu(h.allMatrix,[50,50],100,100);u=sw([v.pos1,v.pos2],v.direction)}var g=n?4:3;return Q({width:i,height:s,rotation:u,rootMatrix:Pe(g),beforeMatrix:Pe(g),offsetMatrix:Pe(g),allMatrix:Pe(g),targetMatrix:Pe(g),targetTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!n,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1},f)}function Qot(e,t,r,n){var a;r===void 0&&(r=t);var i=ym(e,t),s=i.matrixes,u=i.is3d,f=i.targetMatrix,c=i.transformOrigin,h=i.targetOrigin,p=i.offsetContainer,v=ym(p,r,!0),g=v.matrixes,_=v.is3d,m=n||_||u,b=m?4:3,y=e.tagName.toLowerCase()!=="svg"&&"ownerSVGElement"in e,w=f,C=Pe(b),T=Pe(b),A=Pe(b),x=Pe(b),I=s.length;g.reverse(),s.reverse(),!u&&m&&(w=Un(w,3,4),Oh(s)),!_&&m&&Oh(g),g.forEach(function(at){T=pe(T,at.matrix,b)});var B=r||document.body,P=((a=g[0])===null||a===void 0?void 0:a.target)||ju(B,B,!0).offsetParent,L=g.slice(1).reduce(function(at,et){return pe(at,et.matrix,b)},Pe(b));s.forEach(function(at,et){if(I-2===et&&(A=C.slice()),I-1===et&&(x=C.slice()),!at.matrix){var rt=s[et+1],gt=rut(at,rt,P,b,pe(L,C,b));at.matrix=eo(gt,b)}C=pe(C,at.matrix,b)});var G=!y&&u;w||(w=Pe(G?4:3));var K=Of(y&&w.length===16?Un(w,4,3):w,G);return T=Uy(T,b,b),{rootMatrix:T,beforeMatrix:A,offsetMatrix:x,allMatrix:C,targetMatrix:w,targetTransform:K,transformOrigin:c,targetOrigin:h,is3d:m}}function Of(e,t){return t===void 0&&(t=e.length>9),(t?"matrix3d":"matrix")+"("+ky(e,!t).join(",")+")"}function hv(e){var t=e.clientWidth,r=e.clientHeight;if(!e)return{x:0,y:0,width:0,height:0,clientWidth:t,clientHeight:r};var n=e.viewBox,a=n&&n.baseVal||{x:0,y:0,width:0,height:0};return{x:a.x,y:a.y,width:a.width||t,height:a.height||r,clientWidth:t,clientHeight:r}}function tut(e,t){var r=hv(e),n=r.width,a=r.height,i=r.clientWidth,s=r.clientHeight,u=i/n,f=s/a,c=e.preserveAspectRatio.baseVal,h=c.align,p=c.meetOrSlice,v=[0,0],g=[u,f],_=[0,0];if(h!==1){var m=(h-2)%3,b=Math.floor((h-2)/3);v[0]=n*m/2,v[1]=a*b/2;var y=p===2?Math.max(f,u):Math.min(u,f);g[0]=y,g[1]=y,_[0]=(i-n)/2*m,_[1]=(s-a)/2*b}var w=Hy(g,t);return w[t*(t-1)]=_[0],w[t*(t-1)+1]=_[1],cv(w,t,v)}function eut(e,t){if(!e.getBBox)return[0,0];var r=e.getBBox(),n=hv(e.ownerSVGElement),a=r.x-n.x,i=r.y-n.y;return[a,i,t[0]-a,t[1]-i]}function Je(e,t,r){return sr(e,$o(t,r),r)}function wo(e,t,r,n){return[[0,0],[t,0],[0,r],[t,r]].map(function(a){return Je(e,a,n)})}function kr(e){var t=e.map(function(c){return c[0]}),r=e.map(function(c){return c[1]}),n=Math.min.apply(Math,t),a=Math.min.apply(Math,r),i=Math.max.apply(Math,t),s=Math.max.apply(Math,r),u=i-n,f=s-a;return{left:n,top:a,right:i,bottom:s,width:u,height:f}}function wm(e,t,r,n){var a=wo(e,t,r,n);return kr(a)}function rut(e,t,r,n,a){var i,s=e.target,u=e.origin,f=t.matrix,c=iw(s,void 0,!0),h=c[0],p=c[1],v=r.getBoundingClientRect(),g=[0,0];r===document.body&&(g=rw(s,!0));for(var _=s.getBoundingClientRect(),m=_.left-v.left+r.scrollLeft-(r.clientLeft||0)+g[0],b=_.top-v.top+r.scrollTop-(r.clientTop||0)+g[1],y=_.width,w=_.height,C=ph(n,a,f),T=wm(C,h,p,n),A=T.left,x=T.top,I=T.width,B=T.height,P=Je(C,u,n),L=Gt(P,[A,x]),G=[m+L[0]*y/I,b+L[1]*w/B],K=[0,0],at=0;++at<10;){var et=gn(a,n);i=Gt(Je(et,G,n),Je(et,P,n)),K[0]=i[0],K[1]=i[1];var rt=ph(n,a,eo(K,n),f),gt=wm(rt,h,p,n),Z=gt.left,it=gt.top,ct=Z-m,lt=it-b;if(Math.abs(ct)<2&&Math.abs(lt)<2)break;G[0]-=ct,G[1]-=lt}return K.map(function(dt){return Math.round(dt)})}function qu(e,t,r,n){var a=e.length===16,i=a?4:3,s=wo(e,r,n,i),u=s[0],f=u[0],c=u[1],h=s[1],p=h[0],v=h[1],g=s[2],_=g[0],m=g[1],b=s[3],y=b[0],w=b[1],C=Je(e,t,i),T=C[0],A=C[1],x=Math.min(f,p,_,y),I=Math.min(c,v,m,w),B=Math.max(f,p,_,y),P=Math.max(c,v,m,w);f=f-x||0,p=p-x||0,_=_-x||0,y=y-x||0,c=c-I||0,v=v-I||0,m=m-I||0,w=w-I||0,T=T-x||0,A=A-I||0;var L=uh(s);return{left:x,top:I,right:B,bottom:P,origin:[T,A],pos1:[f,c],pos2:[p,v],pos3:[_,m],pos4:[y,w],direction:L}}function en(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function nw(e,t){return en([t[0]-e[0],t[1]-e[1]])}function Rs(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=Ce(e,t));var a=nw(e,t);return{transform:"translateY(-50%) translate("+e[0]+"px, "+e[1]+"px) rotate("+n+"rad) scaleY("+r+")",width:a+"px"}}function aw(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=r.length,i=r.reduce(function(u,f){return u+f[0]},0)/a,s=r.reduce(function(u,f){return u+f[1]},0)/a;return{transform:"translateZ(0px) translate("+i+"px, "+s+"px) rotate("+e+"rad) scale("+t+")"}}function nut(e){var t=dr(e);return[parseFloat(t.width),parseFloat(t.height)]}function iw(e,t,r,n){t===void 0&&(t=dr(e)),n===void 0&&(n=r||t.boxSizing==="border-box");var a=e.offsetWidth,i=e.offsetHeight,s=!Ha(a);if((r||n)&&s)return[a,i];if(!s&&e.tagName.toLowerCase()!=="svg"){var u=e.getBBox();return[u.width,u.height]}if(a=e.clientWidth,i=e.clientHeight,r||n){var f=parseFloat(t.borderLeftWidth)||0,c=parseFloat(t.borderRightWidth)||0,h=parseFloat(t.borderTopWidth)||0,p=parseFloat(t.borderBottomWidth)||0;return[a+f+c,i+h+p]}else{var v=parseFloat(t.paddingLeft)||0,g=parseFloat(t.paddingRight)||0,_=parseFloat(t.paddingTop)||0,m=parseFloat(t.paddingBottom)||0;return[a-v-g,i-_-m]}}function sw(e,t){return Ce(t>0?e[0]:e[1],t>0?e[1]:e[0])}function Ah(e,t,r,n,a){var i=1,s=[0,0],u=yc(),f=yc(),c=yc(),h=Jot(t,r,a,!1);if(t){var p=h.is3d?4:3,v=qu(h.offsetMatrix,Vt(h.transformOrigin,tot(h.targetMatrix,p)),h.width,h.height);i=v.direction,s=Vt(v.origin,[v.left-h.left,v.top-h.top]),u=xu(t),f=xu(ju(n,n,!0).offsetParent||document.body,!0),e&&(c=xu(e))}return Q({targetClientRect:u,containerClientRect:f,moveableClientRect:c,beforeDirection:i,beforeOrigin:s,originalBeforeOrigin:s,target:t},h)}function yc(){return{left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0}}function xu(e,t){var r=0,n=0,a=0,i=0;if(e===document.body||e===document.documentElement)a=window.innerWidth,i=window.innerHeight,r=-(document.documentElement.scrollLeft||document.body.scrollLeft),n=-(document.documentElement.scrollTop||document.body.scrollTop);else{var s=e.getBoundingClientRect();r=s.left,n=s.top,a=s.width,i=s.height}var u={left:r,right:r+a,top:n,bottom:n+i,width:a,height:i};return t&&(u.clientLeft=e.clientLeft,u.clientTop=e.clientTop,u.clientWidth=e.clientWidth,u.clientHeight=e.clientHeight,u.scrollWidth=e.scrollWidth,u.scrollHeight=e.scrollHeight,u.overflow=dr(e).overflow!=="visible"),u}function pv(e){if(!!e){var t=e.getAttribute("data-direction");if(!!t){var r=[0,0];return t.indexOf("w")>-1&&(r[0]=-1),t.indexOf("e")>-1&&(r[0]=1),t.indexOf("n")>-1&&(r[1]=-1),t.indexOf("s")>-1&&(r[1]=1),r}}}function vv(e,t){return[Vt(t,e[0]),Vt(t,e[1]),Vt(t,e[2]),Vt(t,e[3])]}function Cn(e){var t=e.left,r=e.top,n=e.pos1,a=e.pos2,i=e.pos3,s=e.pos4;return vv([n,a,i,s],[t,r])}function aut(e){return Math.round(e%1===-.5?e-1:e)}function Pi(e,t){var r;(r=e[t])===null||r===void 0||r.unset(),e[t]=null}function Zt(e,t,r){var n=t.datas;n.datas||(n.datas={});var a=Q(Q({},r),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,moveable:e,datas:n.datas});return n.isStartEvent?n.lastEvent=a:n.isStartEvent=!0,a}function Pr(e,t,r){var n=t.datas,a="isDrag"in r?r.isDrag:t.isDrag;return n.datas||(n.datas={}),Q(Q({isDrag:a},r),{moveable:e,target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:n.lastEvent,isDouble:t.isDouble,datas:n.datas})}function Et(e,t,r,n){return e.triggerEvent(t,r,n)}function dr(e,t){return window.getComputedStyle(e,t)}function bu(e,t,r){var n={},a={};return e.filter(function(i){var s=i.name;if(n[s]||!t.some(function(u){return i[u]}))return!1;if(!r&&i.ableGroup){if(a[i.ableGroup])return!1;a[i.ableGroup]=!0}return n[s]=!0,!0})}function Th(e,t){return e===t||e==null&&t==null}function iut(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=e.length-1,n=0;n<r;++n){var a=e[n];if(!Ha(a))return a}return e[r]}function sut(e,t){var r=[],n=[];return e.forEach(function(a,i){var s=t(a,i,e),u=n.indexOf(s),f=r[u]||[];u===-1&&(n.push(s),r.push(f)),f.push(a)}),r}function out(e,t){var r=[],n={};return e.forEach(function(a,i){var s=t(a,i,e),u=n[s];u||(u=[],n[s]=u,r.push(u)),u.push(a)}),r}function uut(e){return e.reduce(function(t,r){return t.concat(r)},[])}function zi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.sort(function(r,n){return Math.abs(n)-Math.abs(r)}),e[0]}function Ri(e,t,r){return sr(gn(e,r),$o(t,r),r)}function ow(e,t){var r,n=e.is3d,a=e.rootMatrix,i=n?4:3;return r=Ri(a,[t.distX,t.distY],i),t.distX=r[0],t.distY=r[1],t}function yu(e,t,r,n,a){return Gt(Je(e,Vt(r,t),a),n)}function Qr(e,t,r){return r?e/t*100+"%":e+"px"}function fut(e,t,r,n){var a=e[t],i=a.direction,s=a.sub,u=e.map(function(){return[0,0]}),f=i?i.split(""):[];if(n&&t<8){var c=f.filter(function(p){return p==="w"||p==="e"})[0],h=f.filter(function(p){return p==="n"||p==="s"})[0];u[t]=r,e.forEach(function(p,v){var g=p.direction;!g||(g.indexOf(c)>-1&&(u[v][0]=r[0]),g.indexOf(h)>-1&&(u[v][1]=r[1]))}),c&&(u[1][0]=r[0]/2,u[5][0]=r[0]/2),h&&(u[3][1]=r[1]/2,u[7][1]=r[1]/2)}else i&&!s?f.forEach(function(p){var v=p==="n"||p==="s";e.forEach(function(g,_){var m=g.direction,b=g.horizontal,y=g.vertical;!m||m.indexOf(p)===-1||(u[_]=[v||!b?0:r[0],!v||!y?0:r[1]])})}):u[t]=r;return u}function xi(e){return Math.abs(e)<=Mr?0:e}function ro(e,t){return t.isRequest?t.requestAble==="resizable"||t.requestAble==="scalable"?t.parentDirection:!1:tn(t.inputEvent.target,Ht("direction"))}function lut(e){var t={};for(var r in e)t[e[r]]=r;return t}function cut(e,t){var r=e.slice(0,t<0?void 0:t),n=e.slice(0,t<0?void 0:t+1),a=e[t]||"",i=t<0?[]:e.slice(t),s=t<0?[]:e.slice(t+1),u=Na(r),f=Na(n),c=Na([a]),h=Na(i),p=Na(s),v=Ti(u),g=Ti(f),_=Ti(h),m=Ti(p),b=pe(v,_,4);return{transforms:e,beforeFunctionMatrix:v,beforeFunctionMatrix2:g,targetFunctionMatrix:Ti(c),afterFunctionMatrix:_,afterFunctionMatrix2:m,allFunctionMatrix:b,beforeFunctions:u,beforeFunctions2:f,targetFunction:c[0],afterFunctions:h,afterFunctions2:p,beforeFunctionTexts:r,beforeFunctionTexts2:n,targetFunctionText:a,afterFunctionTexts:i,afterFunctionTexts2:s}}function hut(e){return!e||!va(e)?!1:ni(e)||"length"in e}function Af(e,t){return e?rn(e)?t?document.querySelector(e):e:Ty(e)?e():"current"in e?e.current:e:null}function uw(e,t){if(!e)return[];var r=hut(e)?[].slice.call(e):[e];return r.reduce(function(n,a){return rn(a)&&t?Rt(Rt([],n),[].slice.call(document.querySelectorAll(a))):(n.push(Af(a,t)),n)},[])}function put(e,t){var r=[];return e.forEach(function(n){if(!!n){if(rn(n)){t[n]&&r.push.apply(r,t[n]);return}r.push(n)}}),r}function vut(e,t,r){var n=Ce(e,t)/Math.PI*180;return n=r>=0?n:180-n,n=n>=0?n:360+n,n}function Sm(e,t){var r=e.rootMatrix,n=e.is3d,a=n?4:3,i=gn(r,a);return n||(i=Un(i,3,4)),i[12]=0,i[13]=0,i[14]=0,uot(i,t)}var dut=yo("pinchable",{events:{onPinchStart:"pinchStart",onPinch:"pinch",onPinchEnd:"pinchEnd",onPinchGroupStart:"pinchGroupStart",onPinchGroup:"pinchGroup",onPinchGroupEnd:"pinchGroupEnd"},dragStart:function(){return!0},pinchStart:function(e,t){var r=t.datas,n=t.targets,a=t.angle,i=t.originalDatas,s=e.props,u=s.pinchable,f=s.ables;if(!u)return!1;var c="onPinch"+(n?"Group":"")+"Start",h="drag"+(n?"Group":"")+"ControlStart",p=(u===!0?e.controlAbles:f.filter(function(m){return u.indexOf(m.name)>-1})).filter(function(m){return m.canPinch&&m[h]}),v=Zt(e,t,{});n&&(v.targets=n);var g=Et(e,c,v);r.isPinch=g!==!1,r.ables=p;var _=r.isPinch;return _?(p.forEach(function(m){if(i[m.name]=i[m.name]||{},!!m[h]){var b=Q(Q({},t),{datas:i[m.name],parentRotate:a,isPinch:!0});m[h](e,b)}}),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},_):!1},pinch:function(e,t){var r=t.datas,n=t.scale,a=t.distance,i=t.originalDatas,s=t.inputEvent,u=t.targets,f=t.angle;if(!!r.isPinch){var c=a*(1-1/n),h=Zt(e,t,{});u&&(h.targets=u);var p="onPinch"+(u?"Group":"");Et(e,p,h);var v=r.ables,g="drag"+(u?"Group":"")+"Control";return v.forEach(function(_){!_[g]||_[g](e,Q(Q({},t),{datas:i[_.name],inputEvent:s,parentDistance:c,parentRotate:f,isPinch:!0}))}),h}},pinchEnd:function(e,t){var r=t.datas,n=t.isPinch,a=t.inputEvent,i=t.targets,s=t.originalDatas;if(!!r.isPinch){var u="onPinch"+(i?"Group":"")+"End",f=Pr(e,t,{isDrag:n});i&&(f.targets=i),Et(e,u,f);var c=r.ables,h="drag"+(i?"Group":"")+"ControlEnd";return c.forEach(function(p){!p[h]||p[h](e,Q(Q({},t),{isDrag:n,datas:s[p.name],inputEvent:a,isPinch:!0}))}),n}},pinchGroupStart:function(e,t){return this.pinchStart(e,Q(Q({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,Q(Q({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,Q(Q({},t),{targets:e.props.targets}))}});function Tf(e,t,r,n,a){var i=t.gesto.move(r,e.inputEvent),s=i.originalDatas||i.datas,u=s.draggable||(s.draggable={});return Q(Q({},a?ow(t,i):i),{isDrag:!0,isPinch:!!n,parentEvent:!0,datas:u,originalDatas:e.originalDatas})}var So=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(r,n){this.isDrag=!1,this.isFlag=!1;var a=n.originalDatas;return this.datas=a,a.draggable||(a.draggable={}),Q(Q({},this.move(r,n.inputEvent)),{type:"dragstart"})},t.drag=function(r,n){return this.move([r[0]-this.prevX,r[1]-this.prevY],n)},t.move=function(r,n){var a,i;return this.isFlag?(a=this.prevX+r[0],i=this.prevY+r[1],this.isDrag=!0):(this.prevX=r[0],this.prevY=r[1],this.startX=r[0],this.startY=r[1],a=r[0],i=r[1],this.isFlag=!0),this.prevX=a,this.prevY=i,{type:"drag",clientX:a,clientY:i,inputEvent:n,isDrag:this.isDrag,distX:a-this.startX,distY:i-this.startY,deltaX:r[0],deltaY:r[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function ga(e,t,r){var n=r.originalDatas;n.groupable=n.groupable||{};var a=n.groupable;a.childDatas=a.childDatas||[];var i=a.childDatas;return e.moveables.map(function(s,u){return i[u]=i[u]||{},i[u][t]=i[u][t]||{},Q(Q({},r),{datas:i[u][t],originalDatas:i[u]})})}function wc(e,t,r,n,a,i){var s=!!r.match(/Start$/g),u=!!r.match(/End$/g),f=a.isPinch,c=a.datas,h=ga(e,t.name,a),p=e.moveables,v=h.map(function(g,_){var m=p[_],b=g;s?b=new So().dragStart(n,g):(m.state.gesto||(m.state.gesto=c.childGestos[_]),b=Tf(g,m.state,n,f,i));var y=t[r](m,Q(Q({},b),{parentFlag:!0}));return u&&(m.state.gesto=null),y});return s&&(c.childGestos=p.map(function(g){return g.state.gesto})),v}function jn(e,t,r,n,a,i){a===void 0&&(a=function(h,p){return p});var s=!!r.match(/End$/g),u=ga(e,t.name,n),f=e.moveables,c=u.map(function(h,p){var v=f[p],g=h;g=a(v,h);var _=t[r](v,Q(Q({},g),{parentFlag:!0}));return _&&i&&i(v,h,_,p),s&&(v.state.gesto=null),_});return c}function fw(e,t){var r=t.clientX,n=t.clientY,a=t.datas,i=e.state,s=i.moveableClientRect,u=i.rootMatrix,f=i.is3d,c=i.pos1,h=s.left,p=s.top,v=f?4:3,g=Gt(Ri(u,[r-h,n-p],v),c),_=g[0],m=g[1],b=On({datas:a,distX:_,distY:m}),y=b[0],w=b[1];return[y,w]}function ii(e,t){var r=t.datas,n=e.state,a=n.allMatrix,i=n.beforeMatrix,s=n.is3d,u=n.left,f=n.top,c=n.origin,h=n.offsetMatrix,p=n.targetMatrix,v=n.transformOrigin,g=s?4:3;r.is3d=s,r.matrix=a,r.targetMatrix=p,r.beforeMatrix=i,r.offsetMatrix=h,r.transformOrigin=v,r.inverseMatrix=gn(a,g),r.inverseBeforeMatrix=gn(i,g),r.absoluteOrigin=$o(Vt([u,f],c),g),r.startDragBeforeDist=sr(r.inverseBeforeMatrix,r.absoluteOrigin,g),r.startDragDist=sr(r.inverseMatrix,r.absoluteOrigin,g)}function gut(e){return qu(e.datas.beforeTransform,[50,50],100,100).direction}function Mf(e,t){var r=e.datas,n=e.originalDatas.beforeRenderable,a=r.transformIndex,i=n.nextTransforms,s=n.nextTransformAppendedIndexes,u=0;a===-1?(u=i.length,r.transformIndex=u):u=a+s.filter(function(p){return p<a}).length;var f=cut(i,u),c=f.targetFunction,h=t==="rotate"?"rotateZ":t;r.beforeFunctionTexts=f.beforeFunctionTexts,r.afterFunctionTexts=f.afterFunctionTexts,r.beforeTransform=f.beforeFunctionMatrix,r.beforeTransform2=f.beforeFunctionMatrix2,r.targetTansform=f.targetFunctionMatrix,r.afterTransform=f.afterFunctionMatrix,r.afterTransform2=f.afterFunctionMatrix2,r.targetAllTransform=f.allFunctionMatrix,c.functionName===h?(r.afterFunctionTexts.splice(0,1),r.isAppendTransform=!1):(r.isAppendTransform=!0,n.nextTransformAppendedIndexes=Rt(Rt([],s),[u]))}function Pf(e,t,r){return e.beforeFunctionTexts.join(" ")+" "+(e.isAppendTransform?r:t)+" "+e.afterFunctionTexts.join(" ")}function _ut(e){var t=e.datas,r=e.distX,n=e.distY,a=cw({datas:t,distX:r,distY:n}),i=a[0],s=a[1],u=lw(t,eot([i,s],4));return sr(u,$o([0,0,0],4),4)}function lw(e,t,r){var n=e.beforeTransform,a=e.afterTransform,i=e.beforeTransform2,s=e.afterTransform2,u=e.targetAllTransform,f=r?pe(u,t,4):pe(t,u,4),c=pe(gn(r?i:n,4),f,4),h=pe(c,gn(r?s:a,4),4);return h}function cw(e){var t=e.datas,r=e.distX,n=e.distY,a=t.inverseBeforeMatrix,i=t.is3d,s=t.startDragBeforeDist,u=t.absoluteOrigin,f=i?4:3;return Gt(sr(a,Vt(u,[r,n]),f),s)}function On(e,t){var r=e.datas,n=e.distX,a=e.distY,i=r.inverseBeforeMatrix,s=r.inverseMatrix,u=r.is3d,f=r.startDragBeforeDist,c=r.startDragDist,h=r.absoluteOrigin,p=u?4:3;return Gt(sr(t?i:s,Vt(h,[n,a]),p),t?f:c)}function mut(e,t){var r=e.datas,n=e.distX,a=e.distY,i=r.beforeMatrix,s=r.matrix,u=r.is3d,f=r.startDragBeforeDist,c=r.startDragDist,h=r.absoluteOrigin,p=u?4:3;return Gt(sr(t?i:s,Vt(t?f:c,[n,a]),p),h)}function $ut(e,t,r,n,a,i){return n===void 0&&(n=t),a===void 0&&(a=r),i===void 0&&(i=[0,0]),e?e.map(function(s,u){var f=go(s),c=f.value,h=f.unit,p=u?a:n,v=u?r:t;if(s==="%"||isNaN(c)){var g=p?i[u]/p:0;return v*g}else if(h!=="%")return c;return v*c/100}):i}function hw(e){var t=[];return e[1]>=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function pw(e,t){return hw(t).map(function(r){return e[r]})}function or(e,t){var r=pw(e,t);return[Qs(r.map(function(n){return n[0]})),Qs(r.map(function(n){return n[1]}))]}function but(e,t){return or(e,t.map(function(r){return-r}))}function yut(e,t,r,n,a,i){var s=wo(t,r,n,a),u=or(s,i),f=e[0]-u[0],c=e[1]-u[1];return[f,c]}function xf(e,t,r,n){return pe(e,cv(t,n,r),n)}function wut(e,t,r){var n=e.transformOrigin,a=e.offsetMatrix,i=e.is3d,s=t.beforeTransform,u=t.afterTransform,f=i?4:3,c=oot([r]);return xf(a,Un(pe(pe(s,c,4),u,4),4,f),n,f)}function Sut(e,t){var r=e.transformOrigin,n=e.offsetMatrix,a=e.is3d,i=e.targetMatrix,s=a?4:3;return xf(n,pe(i,Hy(t,s),s),r,s)}function If(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(r,n){n===void 0&&(n=-1),t.startTransforms=ni(r)?r:da(r),Mh(e,n)},setTransformIndex:function(r){Mh(e,r)}}}function Df(e,t){var r=e.originalDatas.beforeRenderable,n=r.startTransforms;Mh(e,nn(n,function(a){return a.indexOf(t+"(")===0}))}function Mh(e,t){var r=e.originalDatas.beforeRenderable,n=e.datas;if(n.transformIndex=t,t!==-1){var a=r.startTransforms[t];if(!!a){var i=Na([a]);n.startValue=i[0].functionValue}}}function dv(e,t){var r=e.originalDatas.beforeRenderable;r.nextTransforms=da(t)}function Em(e){var t=e.originalDatas.beforeRenderable;return t.nextTransforms.join(" ")}function vw(e,t,r,n,a){return dv(a,t),{transform:t,drag:ir.drag(e,Tf(a,e.state,r,n,!1))}}function dw(e,t,r,n,a){var i=e.state,s=i.left,u=i.top,f=e.props.groupable,c=wut(e.state,a,t),h=f?s:0,p=f?u:0,v=_w(e,r,c),g=Gt(n,v);return Gt(g,[h,p])}function Eut(e,t,r,n,a){return dw(e,"scale("+t.join(", ")+")",r,n,a)}function gw(e){var t=e.state,r=t.width,n=t.height,a=t.transformOrigin;return[-1+a[0]/(r/2),-1+a[1]/(n/2)]}function _w(e,t,r){r===void 0&&(r=e.state.allMatrix);var n=e.state,a=n.width,i=n.height,s=n.is3d,u=s?4:3,f=[a/2*(1+t[0]),i/2*(1+t[1])];return Je(r,f,u)}function Cut(e,t,r,n){var a=gw(e);return dw(e,"rotate("+t+"deg)",a,r,n)}function Out(e,t,r,n,a,i){var s=e.props.groupable,u=e.state,f=u.transformOrigin,c=u.targetMatrix,h=u.offsetMatrix,p=u.is3d,v=u.width,g=u.height,_=u.left,m=u.top,b=p?4:3,y=$ut(i,t,r,v,g,f),w=s?_:0,C=s?m:0,T=xf(h,c,y,b),A=yut(a,T,t,r,b,n);return Gt(A,[w,C])}function Bi(e,t){return or(Cn(e.state),t)}var Aut=["left","right","center"],Tut=["top","bottom","middle"],_a={start:"left",end:"right",center:"center"},ma={start:"top",end:"bottom",center:"middle"};function us(e,t){var r=e.props,n=r.snappable,a=r.bounds,i=r.innerBounds,s=r.verticalGuidelines,u=r.horizontalGuidelines,f=r.snapGridWidth,c=r.snapGridHeight,h=e.state,p=h.guidelines,v=h.enableSnap;return!n||!v||t&&n!==!0&&n.indexOf(t)<0?!1:!!(f||c||a||i||p&&p.length||s&&s.length||u&&u.length)}function gv(e){return e===!1?{}:e===!0||!e?{left:!0,right:!0,top:!0,bottom:!0}:e}function Mut(e,t){var r=gv(e),n={};for(var a in r)a in t&&r[a]&&(n[a]=t[a]);return n}function _v(e,t){var r=Mut(e,t),n=Tut.filter(function(i){return i in r}),a=Aut.filter(function(i){return i in r});return{horizontal:n.map(function(i){return r[i]}),vertical:a.map(function(i){return r[i]})}}function Put(e,t,r){var n=e.state.elementRects,a=[];return[["vertical",_a,ma],["horizontal",ma,_a]].forEach(function(i){var s=i[0],u=i[1],f=i[2],c=t[u.start],h=t[u.end],p=t[u.center],v=t[f.start],g=t[f.end];function _(y){var w=y.rect;return w[u.end]<c+r?c-w[u.end]:h-r<w[u.start]?w[u.start]-h:-1}var m=n.filter(function(y){var w=y.rect;return w[f.start]>g||w[f.end]<v?!1:_(y)>0}).sort(function(y,w){return _(y)-_(w)}),b=[];m.forEach(function(y){m.forEach(function(w){if(y!==w){var C=y.rect,T=w.rect,A=C[f.start],x=C[f.end],I=T[f.start],B=T[f.end];A>B||I>x||b.push([y,w])}})}),b.forEach(function(y){var w=y[0],C=y[1],T=w.rect,A=C.rect,x=T[u.start],I=T[u.end],B=A[u.start],P=A[u.end],L=0,G=0,K=!1,at=!1,et=!1;if(I<=c&&h<=B){if(at=!0,L=(B-I-(h-c))/2,G=I+L+(h-c)/2,Math.abs(G-p)>r)return}else if(I<B&&P<c+r){if(K=!0,L=B-I,G=P+L,Math.abs(G-c)>r)return}else if(I<B&&h-r<x){if(et=!0,L=B-I,G=x-L,Math.abs(G-h)>r)return}else return;!L||a.push({type:s,pos:s==="vertical"?[G,0]:[0,G],element:C.element,size:0,className:C.className,isStart:K,isCenter:at,isEnd:et,gap:L,hide:!0,gapRects:[w,C]})})}),a}function mw(e,t,r,n,a,i,s){a===void 0&&(a=0),i===void 0&&(i=0),s===void 0&&(s={left:0,top:0,right:0,bottom:0});var u=[],f=s.left,c=s.top,h=s.bottom,p=s.right,v=r+p-f,g=n+h-c;return e&&e.forEach(function(_){u.push({type:"horizontal",pos:[f,re(_-i+c,.1)],size:v})}),t&&t.forEach(function(_){u.push({type:"vertical",pos:[re(_-a+f,.1),c],size:g})}),u}function xut(e,t,r){var n=Je(e,[t.clientLeft,t.clientTop],r);return[t.left+n[0],t.top+n[1]]}function Iut(e,t){if(!t.length)return[];var r=e.state,n=r.containerClientRect,a=r.targetClientRect,i=a.top,s=a.left,u=r.rootMatrix,f=r.is3d,c=f?4:3,h=xut(u,n,c),p=h[0],v=h[1],g=Cn(r),_=Cf(g),m=_.minX,b=_.minY,y=Gt([m,b],Ri(u,[s-p,i-v],c)).map(function(T){return aut(T)}),w=y[0],C=y[1];return t.map(function(T){var A=T.element.getBoundingClientRect(),x=A.left-p,I=A.top-v,B=I+A.height,P=x+A.width,L=Ri(u,[x,I],c),G=L[0],K=L[1],at=Ri(u,[P,B],c),et=at[0],rt=at[1];return Q(Q({},T),{rect:{left:G+w,right:et+w,top:K+C,bottom:rt+C,center:(G+et)/2+w,middle:(K+rt)/2+C}})})}function Dut(e){var t=e.state,r=e.props.elementGuidelines,n=r===void 0?[]:r;if(!n.length)return t.elementRects=[],[];var a=(t.elementRects||[]).filter(function(v){return!v.refresh}),i=n.map(function(v){return va(v)&&"element"in v?v:{element:Af(v,!0)}}).filter(function(v){return v.element}),s=cot(a.map(function(v){return v.element}),i.map(function(v){return v.element})),u=s.maintained,f=s.added,c=[];u.forEach(function(v){var g=v[0],_=v[1];c[_]=a[g]}),Iut(e,f.map(function(v){return i[v]})).map(function(v,g){c[f[g]]=v}),t.elementRects=c;var h=gv(e.props.elementSnapDirections),p=[];return c.forEach(function(v){var g=v.element,_=v.top,m=_===void 0?h.top:_,b=v.left,y=b===void 0?h.left:b,w=v.right,C=w===void 0?h.right:w,T=v.bottom,A=T===void 0?h.bottom:T,x=v.center,I=x===void 0?h.center:x,B=v.middle,P=B===void 0?h.middle:B,L=v.className,G=v.rect,K=_v({top:m,right:C,left:y,bottom:A,center:I,middle:P},G),at=K.horizontal,et=K.vertical,rt=G.top,gt=G.left,Z=G.right-gt,it=G.bottom-rt,ct=[Z,it];et.forEach(function(lt){p.push({type:"vertical",element:g,pos:[re(lt,.1),rt],size:it,sizes:ct,className:L,elementRect:v})}),at.forEach(function(lt){p.push({type:"horizontal",element:g,pos:[gt,re(lt,.1)],size:Z,sizes:ct,className:L,elementRect:v})})}),p}function Ph(e){var t=e.state,r=t.snapOffset,n=t.containerClientRect,a=n.overflow,i=n.scrollHeight,s=n.scrollWidth,u=n.clientHeight,f=n.clientWidth,c=n.clientLeft,h=n.clientTop,p=e.props,v=p.snapGap,g=v===void 0?!0:v,_=p.verticalGuidelines,m=p.horizontalGuidelines,b=p.snapThreshold,y=b===void 0?5:b,w=p.snapGridWidth,C=w===void 0?0:w,T=p.snapGridHeight,A=T===void 0?0:T,x=Dut(e),I=Rt([],x);if(g){var B=kr(Cn(e.state)),P=B.top,L=B.left,G=B.bottom,K=B.right;I.push.apply(I,Put(e,{top:P,left:L,bottom:G,right:K,center:(L+K)/2,middle:(P+G)/2},y))}return I.push.apply(I,Rut(C,A,a?s:f,a?i:u,c,h)),I.push.apply(I,mw(m||!1,_||!1,a?s:f,a?i:u,c,h,r)),I}function Rut(e,t,r,n,a,i){a===void 0&&(a=0),i===void 0&&(i=0);var s=[];if(t)for(var u=0;u<=n;u+=t)s.push({type:"horizontal",pos:[0,re(u-i,.1)],size:r,hide:!0});if(e)for(var u=0;u<=r;u+=e)s.push({type:"vertical",pos:[re(u-a,.1),0],size:n,hide:!0});return s}function Rf(e,t,r,n){var a=e.props,i=iut(n,a.snapThreshold,5);return $w(e.state.guidelines,t,r,i)}function $w(e,t,r,n){return{vertical:Om(e,"vertical",t,n),horizontal:Om(e,"horizontal",r,n)}}function But(e,t,r){var n=r[0],a=r[1],i=t[0],s=t[1],u=Gt(r,t),f=u[0],c=u[1],h=c>0,p=f>0;f=xi(f),c=xi(c);var v={isSnap:!1,offset:0,pos:0},g={isSnap:!1,offset:0,pos:0};if(f===0&&c===0)return{vertical:v,horizontal:g};var _=Rf(e,f?[n]:[],c?[a]:[]),m=_.vertical,b=_.horizontal;m.posInfos.filter(function(et){var rt=et.pos;return p?rt>=i:rt<=i}),b.posInfos.filter(function(et){var rt=et.pos;return h?rt>=s:rt<=s}),m.isSnap=m.posInfos.length>0,b.isSnap=b.posInfos.length>0;var y=xh(m),w=y.isSnap,C=y.guideline,T=xh(b),A=T.isSnap,x=T.guideline,I=A?x.pos[1]:0,B=w?C.pos[0]:0;if(f===0)A&&(g.isSnap=!0,g.pos=x.pos[1],g.offset=a-g.pos);else if(c===0)w&&(v.isSnap=!0,v.pos=B,v.offset=n-B);else{var P=c/f,L=r[1]-P*n,G=0,K=0,at=!1;w?(K=B,G=P*K+L,at=!0):A&&(G=I,K=(G-L)/P,at=!0),at&&(v.isSnap=!0,v.pos=K,v.offset=n-K,g.isSnap=!0,g.pos=G,g.offset=a-G)}return{vertical:v,horizontal:g}}function Cm(e,t,r){var n=_v(e.props.snapDirections,t);return Rf(e,n.vertical,n.horizontal,r)}function xh(e){var t=e.isSnap;if(!t)return{isSnap:!1,offset:0,dist:-1,pos:0,guideline:null};var r=e.posInfos[0],n=r.guidelineInfos[0],a=n.offset,i=n.dist,s=n.guideline;return{isSnap:t,offset:a,dist:i,pos:r.pos,guideline:s}}function Om(e,t,r,n){if(!e||!e.length)return{isSnap:!1,index:-1,posInfos:[]};var a=t==="vertical",i=a?0:1,s=r.map(function(f,c){var h=e.map(function(p){var v=p.pos,g=f-v[i];return{offset:g,dist:Math.abs(g),guideline:p}}).filter(function(p){var v=p.guideline,g=p.dist,_=v.type;return!(_!==t||g>n)}).sort(function(p,v){return p.dist-v.dist});return{pos:f,index:c,guidelineInfos:h}}).filter(function(f){return f.guidelineInfos.length>0}).sort(function(f,c){return f.guidelineInfos[0].dist-c.guidelineInfos[0].dist}),u=s.length>0;return{isSnap:u,index:u?s[0].index:-1,posInfos:s}}function Lut(e,t,r){var n=[];if(r[0]&&r[1])n=[r,[-r[0],r[1]],[r[0],-r[1]]].map(function(s){return or(t,s)});else if(!r[0]&&!r[1])for(var a=[t[0],t[1],t[3],t[2],t[0]],i=0;i<4;++i)n.push(a[i]),n.push([(a[i][0]+a[i+1][0])/2,(a[i][1]+a[i+1][1])/2]);else e.props.keepRatio?n=[[-1,-1],[-1,1],[1,-1],[1,1],r].map(function(s){return or(t,s)}):(n=pw(t,r),n.length>1&&n.push([(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]));return Rf(e,n.map(function(s){return s[0]}),n.map(function(s){return s[1]}),1)}function bw(e,t){var r=Math.abs(e.offset),n=Math.abs(t.offset);return e.isBound&&t.isBound?n-r:e.isBound?-1:t.isBound?1:e.isSnap&&t.isSnap?n-r:e.isSnap?-1:t.isSnap||r<Mr?1:n<Mr?-1:r-n}function Uu(e,t){return e.slice().sort(function(r,n){var a=r.sign[t],i=n.sign[t],s=r.offset[t],u=n.offset[t];if(a){if(!i)return-1}else return 1;return bw({isBound:r.isBound,isSnap:r.isSnap,offset:s},{isBound:n.isBound,isSnap:n.isSnap,offset:u})})[0]}function Fut(e,t){var r=[],n=[-e[0],-e[1]];return e[0]&&e[1]?(r.push([n,[e[0],-e[1]]],[n,[-e[0],e[1]]]),t&&r.push([n,e])):e[0]?t?r.push([n,[n[0],-1]],[n,[n[0],1]],[n,[e[0],-1]],[n,e],[n,[e[0],1]]):r.push([[n[0],-1],[e[0],-1]],[[n[0],0],[e[0],0]],[[n[0],1],[e[0],1]]):e[1]?t?r.push([n,[-1,n[1]]],[n,[1,n[1]]],[n,[-1,e[1]]],[n,[1,e[1]]],[n,e]):r.push([[-1,n[1]],[-1,e[1]]],[[0,n[1]],[0,e[1]]],[[1,n[1]],[1,e[1]]]):r.push([n,[1,0]],[n,[-1,0]],[n,[0,-1]],[n,[0,1]],[[1,0],[1,-1]],[[1,0],[1,1]],[[0,1],[1,1]],[[0,1],[-1,1]],[[-1,0],[-1,-1]],[[-1,0],[-1,1]],[[0,-1],[1,-1]],[[0,-1],[-1,-1]]),r}function yw(e,t){var r=Qs([t[0][0],t[1][0]]),n=Qs([t[0][1],t[1][1]]);return{vertical:r<=e[0],horizontal:n<=e[1]}}function Am(e,t){var r=t[0],n=t[1],a=n[0]-r[0],i=n[1]-r[1];Math.abs(a)<Mr&&(a=0),Math.abs(i)<Mr&&(i=0);var s,u;if(!a)s=r[0],u=e[0];else if(!i)s=r[1],u=e[1];else{var f=i/a;s=f*(e[0]-r[0])+r[1],u=e[1]}return s-u}function ww(e,t,r){r===void 0&&(r=Mr);var n=Am(e[0],t)<=0;return e.slice(1).every(function(a){var i=Am(a,t),s=i<=0;return s===n||Math.abs(i)<=r})}function Tm(e,t,r,n,a){return a===void 0&&(a=0),n&&t-a<=e||!n&&e<=r+a?{isBound:!0,offset:n?t-e:r-e}:{isBound:!1,offset:0}}function zut(e,t,r){var n=e.props.innerBounds;if(!n)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var a=n.left,i=n.top,s=n.width,u=n.height,f=[[a,i],[a,i+u]],c=[[a,i],[a+s,i]],h=[[a+s,i],[a+s,i+u]],p=[[a,i+u],[a+s,i+u]],v=yw(r,t),g=v.horizontal,_=v.vertical;if(ww([r,[a,i],[a+s,i],[a,i+u],[a+s,i+u]],t))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var m=fa(t,c,_),b=fa(t,p,_),y=fa(t,f,g),w=fa(t,h,g),C=m.isBound&&b.isBound,T=m.isBound||b.isBound,A=y.isBound&&w.isBound,x=y.isBound||w.isBound,I=zi(m.offset,b.offset),B=zi(y.offset,w.offset),P=[0,0],L=!1,G=!1;return Math.abs(B)<Math.abs(I)?(P=[I,0],L=T,G=C):(P=[0,B],L=x,G=A),{isAllBound:G,isVerticalBound:T,isHorizontalBound:x,isBound:L,offset:P}}function fa(e,t,r,n,a){var i=e[0],s=e[1],u=t[0],f=t[1],c=xi(s[1]-i[1]),h=xi(s[0]-i[0]),p=xi(f[1]-u[1]),v=xi(f[0]-u[0]);if(v){if(!p){if(a&&!h)return{isBound:!1,offset:0};if(c){var b=(u[1]-i[1])/(c/h)+i[0];return Tm(b,u[0],f[0],r,n)}else{var _=u[1]-i[1],m=Math.abs(_)<=(n||0);return{isBound:m,offset:m?_:0}}}}else{if(a&&!c)return{isBound:!1,offset:0};if(h){var g=c/h*(u[0]-i[0])+i[1];return Tm(g,u[1],f[1],r,n)}else{var _=u[0]-i[0],m=Math.abs(_)<=(n||0);return{isBound:m,offset:m?_:0}}}return{isBound:!1,offset:0}}function Sw(e,t,r,n){return t.map(function(a){var i=a[0],s=a[1],u=a[2],f=zut(e,[s,u],r),c=f.isBound,h=f.offset,p=f.isVerticalBound,v=f.isHorizontalBound,g=On({datas:n,distX:h[0],distY:h[1]}).map(function(_,m){return _*(i[m]?2/i[m]:0)});return{sign:i,isBound:c,isVerticalBound:p,isHorizontalBound:v,isSnap:!1,offset:g}})}function Gut(e,t,r){var n,a=Ew(t,[0,0],!1).map(function(v){var g=v[0],_=v[1],m=v[2];return[g.map(function(b){return Math.abs(b)*2}),_,m]}),i=Sw(e,a,or(t,[0,0]),r),s=Uu(i,0),u=Uu(i,1),f=0,c=0,h=s.isVerticalBound||u.isVerticalBound,p=s.isHorizontalBound||u.isHorizontalBound;return(h||p)&&(n=mut({datas:r,distX:-s.offset[0],distY:-u.offset[1]}),f=n[0],c=n[1]),{vertical:{isBound:h,offset:f},horizontal:{isBound:p,offset:c}}}function Nut(e,t){var r=[],n=e[0],a=e[1];return n&&a?r.push([[0,a*2],e,[-n,a]],[[n*2,0],e,[n,-a]]):n?(r.push([[n*2,0],[n,1],[n,-1]]),t&&r.push([[0,-1],[n,-1],[-n,-1]],[[0,1],[n,1],[-n,1]])):a?(r.push([[0,a*2],[1,a],[-1,a]]),t&&r.push([[-1,0],[-1,a],[-1,-a]],[[1,0],[1,a],[1,-a]])):r.push([[-1,0],[-1,-1],[-1,1]],[[1,0],[1,-1],[1,1]],[[0,-1],[-1,-1],[1,-1]],[[0,1],[-1,1],[1,1]]),r}function Ew(e,t,r){return Nut(t,r).map(function(n){var a=n[0],i=n[1],s=n[2];return[a,or(e,i),or(e,s)]})}function Mm(e,t,r,n){var a=n?e.map(function(s){return ua(s,n)}):e,i=Rt([r],t);return[[a[0],a[1]],[a[1],a[3]],[a[3],a[2]],[a[2],a[0]]].some(function(s){return!ww(i,s)})}function jut(e){var t=e[0],r=e[1],n=r[0]-t[0],a=r[1]-t[1];if(!n)return Math.abs(t[0]);if(!a)return Math.abs(t[1]);var i=a/n;return Math.abs((-i*t[0]+t[1])/Math.sqrt(Math.pow(i,2)+1))}function qut(e){var t=e[0],r=e[1],n=r[0]-t[0],a=r[1]-t[1];if(!n)return[t[0],0];if(!a)return[0,t[1]];var i=a/n,s=-i*t[0]+t[1];return[-s/(i+1/i),s/(i*i+1)]}function Uut(e,t,r,n,a){var i=e.props.innerBounds,s=a*Math.PI/180;if(!i)return[];var u=i.left,f=i.top,c=i.width,h=i.height,p=u-n[0],v=u+c-n[0],g=f-n[1],_=f+h-n[1],m=[[p,g],[v,g],[p,_],[v,_]],b=or(r,[0,0]);if(!Mm(r,m,b,0))return[];var y=[],w=m.map(function(C){return[en(C),Ce([0,0],C)]});return[[r[0],r[1]],[r[1],r[3]],[r[3],r[2]],[r[2],r[0]]].forEach(function(C){var T=Ce([0,0],qut(C)),A=jut(C);y.push.apply(y,w.filter(function(x){var I=x[0];return I&&A<=I}).map(function(x){var I=x[0],B=x[1],P=Math.acos(I?A/I:0),L=B+P,G=B-P;return[s+L-T,s+G-T]}).reduce(function(x,I){return x.push.apply(x,I),x},[]).filter(function(x){return!Mm(t,m,b,x)}).map(function(x){return re(x*180/Math.PI,Mr)}))}),y}function kut(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var r=e.getRect(),n=r.pos1,a=r.pos2,i=r.pos3,s=r.pos4,u=[n,a,i,s],f=or(u,[0,0]),c=t.left,h=t.top,p=t.width,v=t.height,g=[[c,h],[c,h+v]],_=[[c,h],[c+p,h]],m=[[c+p,h],[c+p,h+v]],b=[[c,h+v],[c+p,h+v]],y=[[n,a],[a,s],[s,i],[i,n]],w=[],C=[],T={top:!1,bottom:!1,left:!1,right:!1};return y.forEach(function(A){var x=yw(f,A),I=x.horizontal,B=x.vertical,P=fa(A,_,B,1,!0),L=fa(A,b,B,1,!0),G=fa(A,g,I,1,!0),K=fa(A,m,I,1,!0);P.isBound&&!T.top&&(w.push(h),T.top=!0),L.isBound&&!T.bottom&&(w.push(h+v),T.bottom=!0),G.isBound&&!T.left&&(C.push(c),T.left=!0),K.isBound&&!T.right&&(C.push(c+p),T.right=!0)}),{horizontal:w,vertical:C}}function mv(e,t,r){var n=e||{},a=n.position,i=a===void 0?"client":a,s=n.left,u=s===void 0?-1/0:s,f=n.top,c=f===void 0?-1/0:f,h=n.right,p=h===void 0?1/0:h,v=n.bottom,g=v===void 0?1/0:v,_={position:i,left:u,top:c,right:p,bottom:g};return{vertical:Pm(_,t,!0),horizontal:Pm(_,r,!1)}}function Bf(e,t){var r=e.state,n=r.containerClientRect,a=n.clientHeight,i=n.clientWidth,s=n.clientLeft,u=n.clientTop,f=r.snapOffset,c=f.left,h=f.top,p=f.right,v=f.bottom,g=t||e.props.bounds||{},_=g.position||"client",m=_==="css",b=g.left,y=b===void 0?-1/0:b,w=g.top,C=w===void 0?-1/0:w,T=g.right,A=T===void 0?m?-1/0:1/0:T,x=g.bottom,I=x===void 0?m?-1/0:1/0:x;return m&&(A=i+p-c-A,I=a+v-h-I),{left:y+c-s,right:A+c-s,top:C+h-u,bottom:I+h-u}}function Hut(e,t,r){var n=Bf(e),a=n.left,i=n.top,s=n.right,u=n.bottom,f=r[0],c=r[1],h=Gt(r,t),p=h[0],v=h[1];Math.abs(p)<Mr&&(p=0),Math.abs(v)<Mr&&(v=0);var g=v>0,_=p>0,m={isBound:!1,offset:0,pos:0},b={isBound:!1,offset:0,pos:0};if(p===0&&v===0)return{vertical:m,horizontal:b};if(p===0)g?u<c&&(b.pos=u,b.offset=c-u):i>c&&(b.pos=i,b.offset=c-i);else if(v===0)_?s<f&&(m.pos=s,m.offset=f-s):a>f&&(m.pos=a,m.offset=f-a);else{var y=v/p,w=r[1]-y*f,C=0,T=0,A=!1;_&&s<=f?(C=y*s+w,T=s,A=!0):!_&&f<=a&&(C=y*a+w,T=a,A=!0),A&&(C<i||C>u)&&(A=!1),A||(g&&u<=c?(C=u,T=(C-w)/y,A=!0):!g&&c<=i&&(C=i,T=(C-w)/y,A=!0)),A&&(m.isBound=!0,m.pos=T,m.offset=f-T,b.isBound=!0,b.pos=C,b.offset=c-C)}return{vertical:m,horizontal:b}}function Pm(e,t,r){var n=e[r?"left":"top"],a=e[r?"right":"bottom"],i=Math.min.apply(Math,t),s=Math.max.apply(Math,t),u=[];return n+1>i&&u.push({isBound:!0,offset:i-n,pos:n}),a-1<s&&u.push({isBound:!0,offset:s-a,pos:a}),u.length||u.push({isBound:!1,offset:0,pos:0}),u.sort(function(f,c){return Math.abs(c.offset)-Math.abs(f.offset)})}function xm(e,t,r){var n=r?e.map(function(a){return ua(a,r)}):e;return n.some(function(a){return a[0]<t.left&&Math.abs(a[0]-t.left)>.1||a[0]>t.right&&Math.abs(a[0]-t.right)>.1||a[1]<t.top&&Math.abs(a[1]-t.top)>.1||a[1]>t.bottom&&Math.abs(a[1]-t.bottom)>.1})}function Wut(e,t,r){var n=en(e),a=Math.sqrt(n*n-t*t)||0;return[a,-a].sort(function(i,s){return Math.abs(i-e[r?0:1])-Math.abs(s-e[r?0:1])}).map(function(i){return Ce([0,0],r?[i,t]:[t,i])})}function Kut(e,t,r,n,a){if(!e.props.bounds)return[];var i=a*Math.PI/180,s=Bf(e),u=s.left,f=s.top,c=s.right,h=s.bottom,p=u-n[0],v=c-n[0],g=f-n[1],_=h-n[1],m={left:p,top:g,right:v,bottom:_};if(!xm(r,m,0))return[];var b=[];return[[p,0],[v,0],[g,1],[_,1]].forEach(function(y){var w=y[0],C=y[1];r.forEach(function(T){var A=Ce([0,0],T);b.push.apply(b,Wut(T,w,C).map(function(x){return i+x-A}).filter(function(x){return!xm(t,m,x)}).map(function(x){return re(x*180/Math.PI,Mr)}))})}),b}function Yut(e,t){var r,n=e.direction,a=e.classNames,i=e.size,s=e.pos,u=e.zoom,f=e.key,c=n==="horizontal",h=c?"Y":"X";return t.createElement("div",{key:f,className:a.join(" "),style:(r={},r[c?"width":"height"]=""+i,r.transform="translate("+s[0]+", "+s[1]+") translate"+h+"(-50%) scale"+h+"("+u+")",r)})}function $v(e,t){return Yut(Q(Q({},e),{classNames:Rt([Ht("line","guideline",e.direction)],e.classNames).filter(function(r){return r}),size:e.size||e.sizeValue+"px",pos:e.pos||e.posValue.map(function(r){return re(r,.1)+"px"})}),t)}function Im(e,t,r,n,a,i,s,u){var f=e.props.zoom;return r.map(function(c,h){var p=c.type,v=c.pos,g=[0,0];return g[s]=n,g[s?0:1]=-a+v,$v({key:t+"TargetGuideline"+h,classNames:[Ht("target","bold",p)],posValue:g,sizeValue:i,zoom:f,direction:t},u)})}function Dm(e,t,r,n,a,i){var s=e.props,u=s.zoom,f=s.isDisplayInnerSnapDigit,c=t==="horizontal"?_a:ma,h=a[c.start],p=a[c.end];return r.filter(function(v){var g=v.hide,_=v.elementRect;if(g)return!1;if(f&&_){var m=_.rect;if(m[c.start]<=h&&p<=m[c.end])return!1}return!0}).map(function(v,g){var _=v.pos,m=v.size,b=v.element,y=[-n[0]+_[0],-n[1]+_[1]];return $v({key:t+"-default-guideline-"+g,classNames:b?[Ht("bold")]:[],direction:t,posValue:y,sizeValue:m,zoom:u},i)})}function Bs(e,t,r,n,a,i,s,u){var f,c=e.props,h=c.snapDigit,p=h===void 0?0:h,v=c.isDisplaySnapDigit,g=v===void 0?!0:v,_=c.snapDistFormat,m=_===void 0?function(A){return A}:_,b=c.zoom,y=t==="horizontal"?"X":"Y",w=t==="vertical"?"height":"width",C=Math.abs(a),T=g?parseFloat(C.toFixed(p)):0;return u.createElement("div",{key:t+"-"+r+"-guideline-"+n,className:Ht("guideline-group",t),style:(f={left:i[0]+"px",top:i[1]+"px"},f[w]=C+"px",f)},$v({direction:t,classNames:[Ht(r),s],size:"100%",posValue:[0,0],sizeValue:C,zoom:b},u),u.createElement("div",{className:Ht("size-value","gap"),style:{transform:"translate"+y+"(-50%) scale("+b+")"}},T>0?m(T):""))}function Xut(e,t,r,n){var a=e==="vertical"?0:1,i=e==="vertical"?1:0,s=a?_a:ma,u=r[s.start],f=r[s.end];return sut(t,function(c){return c.pos[a]}).map(function(c){var h=[],p=[],v=[];return c.forEach(function(g){var _,m,b=g.element,y=g.elementRect.rect;if(y[s.end]<u)h.push(g);else if(f<y[s.start])p.push(g);else if(y[s.start]<=u&&f<=y[s.end]&&n){var w=g.pos,C={element:b,rect:Q(Q({},y),(_={},_[s.end]=y[s.start],_))},T={element:b,rect:Q(Q({},y),(m={},m[s.start]=y[s.end],m))},A=[0,0],x=[0,0];A[a]=w[a],A[i]=w[i],x[a]=w[a],x[i]=w[i]+g.size,h.push({type:e,pos:A,size:0,elementRect:C}),p.push({type:e,pos:x,size:0,elementRect:T})}}),h.sort(function(g,_){return _.pos[i]-g.pos[i]}),p.sort(function(g,_){return g.pos[i]-_.pos[i]}),{total:c,start:h,end:p,inner:v}})}function Vut(e,t,r,n,a){var i=e.props.isDisplayInnerSnapDigit,s=[];return["vertical","horizontal"].forEach(function(u){var f=t.filter(function(b){return b.type===u}),c=u==="vertical"?1:0,h=c?0:1,p=Xut(u,f,n,i),v=c?ma:_a,g=c?_a:ma,_=n[v.start],m=n[v.end];p.forEach(function(b){var y=b.total,w=b.start,C=b.end,T=b.inner,A=r[h]+y[0].pos[h]-n[g.start],x=n;w.forEach(function(I){var B=I.elementRect.rect,P=x[v.start]-B[v.end];if(P>0){var L=[0,0];L[c]=r[c]+x[v.start]-_-P,L[h]=A,s.push(Bs(e,u,"dashed",s.length,P,L,I.className,a))}x=B}),x=n,C.forEach(function(I){var B=I.elementRect.rect,P=B[v.start]-x[v.end];if(P>0){var L=[0,0];L[c]=r[c]+x[v.end]-_,L[h]=A,s.push(Bs(e,u,"dashed",s.length,P,L,I.className,a))}x=B}),T.forEach(function(I){var B=I.elementRect.rect,P=_-B[v.start],L=B[v.end]-m,G=[0,0],K=[0,0];G[c]=r[c]-P,G[h]=A,K[c]=r[c]+m-_,K[h]=A,s.push(Bs(e,u,"dashed",s.length,P,G,I.className,a)),s.push(Bs(e,u,"dashed",s.length,L,K,I.className,a))})})}),s}function Zut(e,t,r,n,a){var i=[];return["horizontal","vertical"].forEach(function(s){var u=t.filter(function(b){return b.type===s}),f=s==="vertical"?0:1,c=f?0:1,h=f?ma:_a,p=f?_a:ma,v=n[h.start],g=n[h.end],_=n[p.start],m=n[p.end];u.forEach(function(b){var y=b.gap,w=b.gapRects,C=b.className,T=Math.max.apply(Math,Rt([_],w.map(function(I){var B=I.rect;return B[p.start]}))),A=Math.min.apply(Math,Rt([m],w.map(function(I){var B=I.rect;return B[p.end]}))),x=(T+A)/2;T===A||x===(_+m)/2||w.forEach(function(I){var B=I.rect,P=[r[0],r[1]];if(B[h.end]<v)P[f]+=B[h.end]-v;else if(g<B[h.start])P[f]+=B[h.start]-v-y;else return;P[c]+=x-_,i.push(Bs(e,f?"vertical":"horizontal","gap",i.length,y,P,C,a))})})}),i}function Jut(e,t,r,n){var a=t[0]-e[0],i=t[1]-e[1];if(Math.abs(a)<Or&&(a=0),Math.abs(i)<Or&&(i=0),!a)return n?[0,0]:[0,r];if(!i)return n?[r,0]:[0,0];var s=i/a,u=e[1]-s*e[0];if(n){var f=s*(t[0]+r)+u;return[r,f-t[1]]}else{var c=(t[1]+r-u)/s;return[c-t[0],r]}}function Ih(e,t,r,n,a){var i=Jut(e,t,r,n);if(!i)return{isOutside:!1,offset:[0,0]};var s=Gn(e,t),u=Gn(i,e),f=Gn(i,t),c=u>s||f>s,h=On({datas:a,distX:i[0],distY:i[1]}),p=h[0],v=h[1];return{offset:[p,v],isOutside:c}}function ku(e,t){return e.isBound?e.offset:t.isSnap?xh(t).offset:0}function Qut(e,t,r,n,a){var i=t[0],s=t[1],u=r[0],f=r[1],c=n[0],h=n[1],p=a[0],v=a[1],g=-p,_=-v;if(e&&i&&s){g=0,_=0;var m=[];if(u&&f?m.push([0,v],[p,0]):u?m.push([p,0]):f?m.push([0,v]):c&&h?m.push([0,v],[p,0]):c?m.push([p,0]):h&&m.push([0,v]),m.length){m.sort(function(C,T){return en(Gt([i,s],C))-en(Gt([i,s],T))});var b=m[0];if(b[0]&&Math.abs(i)>Or)g=-b[0],_=s*Math.abs(i+g)/Math.abs(i)-s;else if(b[1]&&Math.abs(s)>Or){var y=s;_=-b[1],g=i*Math.abs(s+_)/Math.abs(y)-i}if(e&&f&&u)if(Math.abs(g)>Or&&Math.abs(g)<Math.abs(p)){var w=Math.abs(p)/Math.abs(g);g*=w,_*=w}else if(Math.abs(_)>Or&&Math.abs(_)<Math.abs(v)){var w=Math.abs(v)/Math.abs(_);g*=w,_*=w}else g=zi(-p,g),_=zi(-v,_)}}else g=i||u?-p:0,_=s||f?-v:0;return[g,_]}function tft(e,t,r,n,a,i){if(!us(e,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var s=vv(i.absolutePoses,[t,r]),u=kr(s),f=u.left,c=u.right,h=u.top,p=u.bottom,v={horizontal:s.map(function(et){return et[1]}),vertical:s.map(function(et){return et[0]})},g=gv(e.props.snapDirections),_=_v(g,{left:f,right:c,top:h,bottom:p,center:(f+c)/2,middle:(h+p)/2}),m=Lf(e,a,_,v),b=m.vertical,y=m.horizontal,w=Gut(e,s,i),C=w.vertical,T=w.horizontal,A=b.isSnap,x=y.isSnap,I=b.isBound||C.isBound,B=y.isBound||T.isBound,P=zi(b.offset,C.offset),L=zi(y.offset,T.offset),G=Qut(n,[t,r],[I,B],[A,x],[P,L]),K=G[0],at=G[1];return[{isBound:I,isSnap:A,offset:K},{isBound:B,isSnap:x,offset:at}]}function Lf(e,t,r,n){n===void 0&&(n=r);var a=mv(Bf(e),n.vertical,n.horizontal),i=a.horizontal,s=a.vertical,u=t?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Rf(e,r.vertical,r.horizontal),f=u.horizontal,c=u.vertical,h=ku(i[0],f),p=ku(s[0],c),v=Math.abs(h),g=Math.abs(p);return{horizontal:{isBound:i[0].isBound,isSnap:f.isSnap,snapIndex:f.index,offset:h,dist:v,bounds:i,snap:f},vertical:{isBound:s[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:p,dist:g,bounds:s,snap:c}}}function Rm(e,t,r,n,a){var i=mv(t,r,n),s=i.horizontal,u=i.vertical,f=$w(e,r,n,a),c=f.horizontal,h=f.vertical,p=ku(s[0],c),v=ku(u[0],h),g=Math.abs(p),_=Math.abs(v);return{horizontal:{isBound:s[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:p,dist:g,bounds:s,snap:c},vertical:{isBound:u[0].isBound,isSnap:h.isSnap,snapIndex:h.index,offset:v,dist:_,bounds:u,snap:h}}}function eft(e,t,r,n){var a=Ce(e,t)/Math.PI*180,i=r.vertical,s=i.isBound,u=i.isSnap,f=i.dist,c=r.horizontal,h=c.isBound,p=c.isSnap,v=c.dist,g=a%180,_=g<3||g>177,m=g>87&&g<93;return v<f&&(s||u&&!m&&(!n||!_))?"vertical":h||p&&!_&&(!n||!m)?"horizontal":""}function rft(e,t,r,n,a,i){return r.map(function(s){var u=s[0],f=s[1],c=or(t,u),h=or(t,f),p=n?nft(e,c,h,a):Lf(e,a,{vertical:[h[0]],horizontal:[h[1]]}),v=p.horizontal,g=v.offset,_=v.isBound,m=v.isSnap,b=p.vertical,y=b.offset,w=b.isBound,C=b.isSnap,T=Gt(f,u);if(!y&&!g)return{isBound:w||_,isSnap:C||m,sign:T,offset:[0,0]};var A=eft(c,h,p,n);if(!A)return{sign:T,isBound:!1,isSnap:!1,offset:[0,0]};var x=A==="vertical",I=Ih(c,h,-(x?y:g),x,i).offset.map(function(B,P){return B*(T[P]?2/T[P]:0)});return{sign:T,isBound:x?w:_,isSnap:x?C:m,offset:I}})}function Bm(e,t){return e.isBound?e.offset:t.isSnap?t.offset:0}function nft(e,t,r,n){var a=Hut(e,t,r),i=a.horizontal,s=a.vertical,u=n?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:But(e,t,r),f=u.horizontal,c=u.vertical,h=Bm(i,f),p=Bm(s,c),v=Math.abs(h),g=Math.abs(p);return{horizontal:{isBound:i.isBound,isSnap:f.isSnap,offset:h,dist:v},vertical:{isBound:s.isBound,isSnap:c.isSnap,offset:p,dist:g}}}function aft(e,t,r,n,a){var i=[-r[0],-r[1]],s=e.state,u=s.width,f=s.height,c=e.props.bounds,h=1/0,p=1/0;if(c){var v=[[r[0],-r[1]],[-r[0],r[1]]],g=c.left,_=g===void 0?-1/0:g,m=c.top,b=m===void 0?-1/0:m,y=c.right,w=y===void 0?1/0:y,C=c.bottom,T=C===void 0?1/0:C;v.forEach(function(A){var x=A[0]!==i[0],I=A[1]!==i[1],B=or(t,A),P=Ce(n,B)*360/Math.PI;if(I){var L=B.slice();(Math.abs(P-360)<2||Math.abs(P-180)<2)&&(L[1]=n[1]);var G=Ih(n,L,(n[1]<B[1]?T:b)-B[1],!1,a),K=G.offset,at=K[1],et=G.isOutside;isNaN(at)||(p=f+(et?1:-1)*Math.abs(at))}if(x){var L=B.slice();(Math.abs(P-90)<2||Math.abs(P-270)<2)&&(L[0]=n[0]);var rt=Ih(n,L,(n[0]<B[0]?w:_)-B[0],!0,a),gt=rt.offset[0],Z=rt.isOutside;isNaN(gt)||(h=u+(Z?1:-1)*Math.abs(gt))}})}return{maxWidth:h,maxHeight:p}}function Sc(e){var t=e.state;if(!(t.guidelines&&t.guidelines.length)){var r=e.state.container,n=e.props.snapContainer||r,a=t.containerClientRect,i={left:0,top:0,bottom:0,right:0};if(r!==n){var s=Af(n,!0);if(s){var u=xu(s),f=Sm(t,[u.left-a.left,u.top-a.top]),c=Sm(t,[u.right-a.right,u.bottom-a.bottom]);i.left=re(f[0],.1),i.top=re(f[1],.1),i.right=re(c[0],.1),i.bottom=re(c[1],.1)}}t.snapOffset=i,t.guidelines=Ph(e),t.enableSnap=!0}}function Cw(e,t,r,n,a,i){var s=wo(e,t,r,i?4:3),u=but(s,a);return vv(s,Gt(n,u))}function ift(e,t,r,n,a,i){var s=Fut(r,n),u=Ew(t,r,n),f=Rt(Rt([],rft(e,t,s,n,a,i)),Sw(e,u,or(t,[0,0]),i)),c=Uu(f,0),h=Uu(f,1);return{width:{isBound:c.isBound,offset:c.offset[0]},height:{isBound:h.isBound,offset:h.offset[1]}}}function sft(e,t,r,n,a,i,s,u,f){var c=or(t,s),h=Lf(e,u,{vertical:[c[0]],horizontal:[c[1]]}),p=h.horizontal.offset,v=h.vertical.offset;if(v||p){var g=On({datas:f,distX:-v,distY:-p}),_=g[0],m=g[1],b=Math.min(a||1/0,r+s[0]*_),y=Math.min(i||1/0,n+s[1]*m);return[b-r,y-n]}return[0,0]}function Ow(e,t,r,n,a,i,s,u){for(var f=Cn(e.state),c=e.props.keepRatio,h=0,p=0,v=0;v<2;++v){var g=t(h,p),_=ift(e,g,a,c,s,u),m=_.width,b=_.height,y=m.isBound,w=b.isBound,C=m.offset,T=b.offset;if(v===1&&(y||(C=0),w||(T=0)),v===0&&s&&!y&&!w)return[0,0];if(c){var A=Math.abs(C)*(r?1/r:1),x=Math.abs(T)*(n?1/n:1),I=y&&w?A<x:w||!y&&A<x;I?C=r*T/n:T=n*C/r}h+=C,p+=T}if(a[0]&&a[1]){var B=aft(e,f,a,i,u),P=B.maxWidth,L=B.maxHeight,G=sft(e,t(h,p).map(function(et){return et.map(function(rt){return re(rt,kot)})}),r+h,n+p,P,L,a,s,u),C=G[0],T=G[1];h+=C,p+=T}return[h,p]}function Aw(e,t,r,n){if(!us(e,"rotatable"))return n;var a=t.pos1,i=t.pos2,s=t.pos3,u=t.pos4,f=n*Math.PI/180,c=[a,i,s,u].map(function(v){return Gt(v,r)}),h=c.map(function(v){return ua(v,f)}),p=Rt(Rt([],Kut(e,c,h,r,n)),Uut(e,c,h,r,n));return p.sort(function(v,g){return Math.abs(v-n)-Math.abs(g-n)}),p.length?p[0]:n}function oft(e,t,r,n,a,i,s){if(!us(e,"resizable"))return[0,0];var u=e.state,f=u.allMatrix,c=u.is3d;return Ow(e,function(h,p){return Cw(f,t+h,r+p,a,n,c)},t,r,n,a,i,s)}function uft(e,t,r,n,a){var i=a.width,s=a.height,u=a.fixedPosition;if(!us(e,"scalable"))return[0,0];var f=a.is3d,c=Ow(e,function(h,p){return Cw(Sut(a,Vt(t,[h/i,p/s])),i,s,u,r,f)},i,s,r,u,n,a);return[c[0]/i,c[1]/s]}function fft(e,t){t.absolutePoses=Cn(e.state)}function Lm(e){var t=[];return e.forEach(function(r){r.guidelineInfos.forEach(function(n){var a=n.guideline;t.indexOf(a)>-1||t.push(a)})}),t}function Fm(e,t,r,n,a,i){var s=mv(Bf(e,i),t,r),u=s.vertical,f=s.horizontal;u.forEach(function(v){v.isBound&&n.push({type:"bounds",pos:v.pos})}),f.forEach(function(v){v.isBound&&a.push({type:"bounds",pos:v.pos})});var c=kut(e),h=c.vertical,p=c.horizontal;h.forEach(function(v){nn(n,function(g){var _=g.type,m=g.pos;return _==="bounds"&&m===v})>=0||n.push({type:"bounds",pos:v})}),p.forEach(function(v){nn(a,function(g){var _=g.type,m=g.pos;return _==="bounds"&&m===v})>=0||a.push({type:"bounds",pos:v})})}var lft={name:"snappable",dragRelation:"strong",props:{snappable:[Boolean,Array],snapContainer:Object,snapDirections:[Boolean,Object],elementSnapDirections:[Boolean,Object],snapGap:Boolean,snapGridWidth:Number,snapGridHeight:Number,isDisplaySnapDigit:Boolean,isDisplayInnerSnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[`:host {
|
|
--bounds-color: #d66;
|
|
}
|
|
.guideline {
|
|
pointer-events: none;
|
|
z-index: 2;
|
|
}
|
|
.guideline.bounds {
|
|
background: #d66;
|
|
background: var(--bounds-color);
|
|
}
|
|
.guideline-group {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
}
|
|
.guideline-group .size-value {
|
|
position: absolute;
|
|
color: #f55;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
}
|
|
.guideline-group.horizontal .size-value {
|
|
transform-origin: 50% 100%;
|
|
transform: translateX(-50%);
|
|
left: 50%;
|
|
bottom: 5px;
|
|
}
|
|
.guideline-group.vertical .size-value {
|
|
transform-origin: 0% 50%;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
left: 5px;
|
|
}
|
|
.guideline.gap {
|
|
background: #f55;
|
|
}
|
|
.size-value.gap {
|
|
color: #f55;
|
|
}
|
|
`],render:function(e,t){var r=e.state,n=r.top,a=r.left,i=r.pos1,s=r.pos2,u=r.pos3,f=r.pos4,c=r.snapRenderInfo;if(!c||!us(e,""))return[];r.guidelines=Ph(e);var h=Math.min(i[0],s[0],u[0],f[0]),p=Math.min(i[1],s[1],u[1],f[1]),v=c.externalPoses||[],g=Cn(e.state),_=[],m=[],b=[],y=[],w=[],C=kr(g),T=C.width,A=C.height,x=C.top,I=C.left,B=C.bottom,P=C.right,L={left:I,right:P,top:x,bottom:B,center:(I+P)/2,middle:(x+B)/2},G=v.length>0,K=G?kr(v):{};if(!c.request){if(c.direction&&w.push(Lut(e,g,c.direction)),c.snap){var at=kr(g);c.center&&(at.middle=(at.top+at.bottom)/2,at.center=(at.left+at.right)/2),w.push(Cm(e,at,1))}G&&(c.center&&(K.middle=(K.top+K.bottom)/2,K.center=(K.left+K.right)/2),w.push(Cm(e,K,1))),w.forEach(function(Z){var it=Z.vertical.posInfos,ct=Z.horizontal.posInfos;_.push.apply(_,it.filter(function(lt){var dt=lt.guidelineInfos;return dt.some(function(Ut){var Lt=Ut.guideline;return!Lt.hide})}).map(function(lt){return{type:"snap",pos:lt.pos}})),m.push.apply(m,ct.filter(function(lt){var dt=lt.guidelineInfos;return dt.some(function(Ut){var Lt=Ut.guideline;return!Lt.hide})}).map(function(lt){return{type:"snap",pos:lt.pos}})),b.push.apply(b,Lm(it)),y.push.apply(y,Lm(ct))})}Fm(e,[I,P],[x,B],_,m),G&&Fm(e,[K.left,K.right],[K.top,K.bottom],_,m,c.externalBounds);var et=Rt(Rt([],b),y),rt=et.filter(function(Z){return Z.element&&!Z.gapRects}),gt=et.filter(function(Z){return Z.gapRects});return Et(e,"onSnap",{guidelines:et.filter(function(Z){var it=Z.element;return!it}),elements:rt,gaps:gt},!0),Rt(Rt(Rt(Rt(Rt(Rt([],Vut(e,rt,[h,p],L,t)),Zut(e,gt,[h,p],L,t)),Dm(e,"horizontal",y,[a,n],L,t)),Dm(e,"vertical",b,[a,n],L,t)),Im(e,"horizontal",m,h,n,T,0,t)),Im(e,"vertical",_,p,a,A,1,t))},dragStart:function(e,t){e.state.snapRenderInfo={request:t.isRequest,snap:!0,center:!0},Sc(e)},drag:function(e){var t=e.state;t.guidelines=Ph(e)},pinchStart:function(e){this.unset(e)},dragEnd:function(e){this.unset(e)},dragControlCondition:function(e,t){if(ro(e,t)||Dh(e,t))return!0;if(!t.isRequest&&t.inputEvent)return tn(t.inputEvent.target,Ht("snap-control"))},dragControlStart:function(e){e.state.snapRenderInfo=null,Sc(e)},dragControl:function(e){this.drag(e)},dragControlEnd:function(e){this.unset(e)},dragGroupStart:function(e,t){this.dragStart(e,t)},dragGroup:function(e){this.drag(e)},dragGroupEnd:function(e){this.unset(e)},dragGroupControlStart:function(e){e.state.snapRenderInfo=null,Sc(e)},dragGroupControl:function(e){this.drag(e)},dragGroupControlEnd:function(e){this.unset(e)},unset:function(e){var t=e.state;t.enableSnap=!1,t.guidelines=[],t.snapRenderInfo=null,t.elementRects=[]}},ir={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(e,t){var r=e.props,n=r.throttleDragRotate,a=r.zoom,i=e.state,s=i.dragInfo,u=i.beforeOrigin;if(!n||!s)return[];var f=s.dist;if(!f[0]&&!f[1])return[];var c=en(f),h=Ce(f,[0,0]);return[t.createElement("div",{className:Ht("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:c+"px",transform:"translate("+u[0]+"px, "+u[1]+"px) rotate("+h+"rad) scaleY("+a+")"}})]},dragStart:function(e,t){var r=t.datas,n=t.parentEvent,a=t.parentGesto,i=e.state,s=i.target,u=i.gesto;if(u)return!1;i.gesto=a||e.targetGesto;var f=dr(s);r.datas={},r.left=parseFloat(f.left||"")||0,r.top=parseFloat(f.top||"")||0,r.bottom=parseFloat(f.bottom||"")||0,r.right=parseFloat(f.right||"")||0,r.startValue=[0,0],ii(e,t),Df(t,"translate"),fft(e,r),r.prevDist=[0,0],r.prevBeforeDist=[0,0],r.isDrag=!1,r.deltaOffset=[0,0],r.distOffset=[0,0];var c=Zt(e,t,Q({set:function(p){r.startValue=p}},If(t))),h=n||Et(e,"onDragStart",c);return h!==!1?(r.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(i.gesto=null,r.isPinch=!1),r.isDrag?c:!1},drag:function(e,t){if(!!t){Mf(t,"translate");var r=t.datas,n=t.parentEvent,a=t.parentFlag,i=t.isPinch,s=t.isRequest,u=t.distX,f=t.distY,c=r.isDrag,h=r.prevDist,p=r.prevBeforeDist,v=r.startValue,g=r.distOffset;if(!!c){u+=g[0],f+=g[1];var _=e.props,m=_.parentMoveable,b=n?0:_.throttleDrag||0,y=n?0:_.throttleDragRotate||0,w=!1,C=0;if(!n&&y>0&&(u||f)){var T=_.startDragRotate||0,A=re(T+Ce([0,0],[u,f])*180/Math.PI,y)-T,x=f*Math.abs(Math.cos((A-90)/180*Math.PI)),I=u*Math.abs(Math.cos(A/180*Math.PI)),B=en([I,x]);C=A*Math.PI/180,u=B*Math.cos(C),f=B*Math.sin(C)}if(!i&&!n&&!a&&(!y||u||f)){var P=tft(e,u,f,y,s,r),L=P[0],G=P[1],K=L.isSnap,at=L.isBound,et=L.offset,rt=G.isSnap,gt=G.isBound,Z=G.offset;w=K||rt||at||gt,u+=et,f+=Z}var it=Vt(cw({datas:r,distX:u,distY:f}),v),ct=Vt(_ut({datas:r,distX:u,distY:f}),v);!y&&!w&&(fm(ct,b),fm(it,b));var lt=Gt(it,v),dt=Gt(ct,v),Ut=Gt(dt,h),Lt=Gt(lt,p);r.prevDist=dt,r.prevBeforeDist=lt,r.passDelta=Ut,r.passDist=dt;var ve=r.left+lt[0],bt=r.top+lt[1],Nt=r.right-lt[0],de=r.bottom-lt[1],Jt=Pf(r,"translate("+ct[0]+"px, "+ct[1]+"px)","translate("+dt[0]+"px, "+dt[1]+"px)");if(dv(t,Jt),e.state.dragInfo.dist=n?[0,0]:dt,!(!n&&!m&&Ut.every(function(Kt){return!Kt})&&Lt.some(function(Kt){return!Kt}))){var Tt=e.state,Ie=Tt.width,Oe=Tt.height,ge=Zt(e,t,{transform:Jt,dist:dt,delta:Ut,translate:ct,beforeDist:lt,beforeDelta:Lt,beforeTranslate:it,left:ve,top:bt,right:Nt,bottom:de,width:Ie,height:Oe,isPinch:i});return!n&&Et(e,"onDrag",ge),ge}}}},dragAfter:function(e,t){var r=t.datas,n=t.datas,a=n.deltaOffset,i=n.distOffset;return a[0]||a[1]?(r.deltaOffset=[0,0],i[0]=a[0],i[1]=a[1],this.drag(e,t)):!1},dragEnd:function(e,t){var r=t.parentEvent,n=t.datas;if(e.state.gesto=null,e.state.dragInfo=null,!!n.isDrag){n.isDrag=!1;var a=Pr(e,t,{});return!r&&Et(e,"onDragEnd",a),a}},dragGroupStart:function(e,t){var r=t.datas,n=t.clientX,a=t.clientY,i=this.dragStart(e,t);if(!i)return!1;var s=wc(e,this,"dragStart",[n||0,a||0],t,!1),u=Q(Q({},i),{targets:e.props.targets,events:s}),f=Et(e,"onDragGroupStart",u);return r.isDrag=f!==!1,r.isDrag?i:!1},dragGroup:function(e,t){var r=t.datas;if(!!r.isDrag){var n=this.drag(e,t),a=t.datas.passDelta,i=wc(e,this,"drag",a,t,!1);if(!!n){var s=Q({targets:e.props.targets,events:i},n);return Et(e,"onDragGroup",s),s}}},dragGroupEnd:function(e,t){var r=t.isDrag,n=t.datas;if(!!n.isDrag){this.dragEnd(e,t);var a=wc(e,this,"dragEnd",[0,0],t,!1);return Et(e,"onDragGroupEnd",Pr(e,t,{targets:e.props.targets,events:a})),r}},request:function(e){var t={},r=e.getRect(),n=0,a=0;return{isControl:!1,requestStart:function(){return{datas:t}},request:function(i){return"x"in i?n=i.x-r.left:"deltaX"in i&&(n+=i.deltaX),"y"in i?a=i.y-r.top:"deltaY"in i&&(a+=i.deltaY),{datas:t,distX:n,distY:a}},requestEnd:function(){return{datas:t,isDrag:!0}}}},unset:function(e){e.state.dragInfo=null}};function bv(e,t,r,n){n===void 0&&(n="");var a=e.state,i=a.renderPoses,s=a.rotation,u=a.direction,f=e.props,c=f.renderDirections,h=c===void 0?t:c,p=f.zoom,v={};if(!h)return[];var g=u>0?1:-1,_=h===!0?tw:h,m=s/Math.PI*180;return _.forEach(function(b){v[b]=!0}),_.map(function(b){var y=Hot[b];if(!y||!v[b])return null;var w=(re(m,15)+g*Wot[b]+720)%180;return r.createElement("div",{className:Ht("control","direction",b,n),"data-rotation":w,"data-direction":b,key:"direction-"+b,style:aw.apply(void 0,Rt([s,p],y.map(function(C){return i[C]})))})})}function Ii(e,t,r,n,a,i){for(var s=[],u=6;u<arguments.length;u++)s[u-6]=arguments[u];var f=Ce(r,n),c=t?re(f/Math.PI*180,15)%180:-1;return e.createElement("div",{key:"line"+i,className:Ht.apply(void 0,Rt(["line","direction",t],s)),"data-rotation":c,"data-line-index":i,"data-direction":t,style:Rs(r,n,a,f)})}function yv(e,t){return bv(e,tw,t)}function Tw(e,t){return bv(e,["nw","ne","sw","se"],t)}function Ec(e,t,r,n,a,i){var s=e.state.is3d?4:3,u=Je(e.state.rootMatrix,a,s),f=Vt([i.left,i.top],u);t.startAbsoluteOrigin=f,t.prevDeg=Ce(f,[r,n])/Math.PI*180,t.prevSnapDeg=t.prevDeg,t.startDeg=t.prevDeg,t.loop=0}function Cc(e,t,r,n,a,i){var s=r.prevDeg,u=Aw(e,t,r.origin,n);r.prevDeg=u;var f=u-s;return[f,u,i+u]}function Iu(e,t,r,n,a,i,s,u){var f=r.prevDeg,c=r.prevSnapDeg,h=r.startDeg,p=r.loop;f>n&&f>270&&n<90?++r.loop:f<n&&f<90&&n>270&&--r.loop;var v=r.loop,g=p*360+c-h+i,_=v*360+n-h+i;r.prevDeg=_-v*360+h-i,_=re(_,s);var m=a*(_-i);u&&(m=Aw(e,t,r.origin,m),_=m/a+i),r.prevSnapDeg=_-v*360+h-i;var b=a*(_-g);return[b,m,i+m]}function Oc(e,t,r,n,a,i,s,u){return Iu(e,t,r,Ce(r.startAbsoluteOrigin,[a,i])/Math.PI*180,n,s,u,!0)}function cft(e,t,r){var n=t[0],a=t[1],i=t[2],s=t[3];if(e!=="none"){var u=(e||"top").split("-"),f=u[0],c=u[1],h=[n,a];f==="left"?h=[i,n]:f==="right"?h=[a,s]:f==="bottom"&&(h=[s,i]);var p=[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2],v=sw(h,r);if(c){var g=c==="top"||c==="left",_=f==="bottom"||f==="left";p=h[g&&!_||!g&&_?0:1]}return[p,v]}}function Dh(e,t){if(t.isRequest)return t.requestAble==="rotatable";var r=t.inputEvent.target;if(tn(r,Ht("rotation-control")))return!0;var n=e.props.rotationTarget;return n?uw(n,!0).some(function(a){return a?r===a||r.contains(a):!1}):!1}var hft={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number,renderDirections:Object,rotationTarget:Object},events:{onRotateStart:"rotateStart",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[`.rotation {
|
|
position: absolute;
|
|
height: 40px;
|
|
width: 1px;
|
|
transform-origin: 50% 100%;
|
|
height: calc(40px * var(--zoom));
|
|
top: auto;
|
|
left: 0;
|
|
bottom: 100%;
|
|
will-change: transform;
|
|
}
|
|
.rotation .rotation-line {
|
|
display: block;
|
|
width: 100%;
|
|
height: 100%;
|
|
transform-origin: 50% 50%;
|
|
}
|
|
.rotation .rotation-control {
|
|
border-color: #4af;
|
|
border-color: var(--moveable-color);
|
|
background:#fff;
|
|
cursor: alias;
|
|
}`],render:function(e,t){var r=e.props,n=r.rotatable,a=r.rotationPosition,i=r.zoom,s=r.renderDirections,u=e.state,f=u.renderPoses,c=u.direction;if(!n)return null;var h=cft(a,f,c),p=[];if(h){var v=h[0],g=h[1];p.push(t.createElement("div",{key:"rotation",className:Ht("rotation"),style:{transform:"translate(-50%) translate("+v[0]+"px, "+v[1]+"px) rotate("+g+"rad)"}},t.createElement("div",{className:Ht("line rotation-line"),style:{transform:"scaleX("+i+")"}}),t.createElement("div",{className:Ht("control rotation-control"),style:{transform:"translate(0.5px) scale("+i+")"}})))}return s&&p.push.apply(p,bv(e,[],t)),p},dragControlCondition:Dh,dragControlStart:function(e,t){var r=t.datas,n=t.clientX,a=t.clientY,i=t.parentRotate,s=t.parentFlag,u=t.isPinch,f=t.isRequest,c=e.state,h=c.target,p=c.left,v=c.top,g=c.origin,_=c.beforeOrigin,m=c.direction,b=c.beforeDirection,y=c.targetTransform,w=c.moveableClientRect;if(!f&&!h)return!1;var C=e.getRect();if(r.rect=C,r.transform=y,r.left=p,r.top=v,r.fixedPosition=_w(e,gw(e)),r.absoluteInfo={origin:C.origin,startValue:C.rotation},Ec(e,r.absoluteInfo,n,a,g,w),f||u||s){var T=i||0;r.beforeInfo={origin:C.beforeOrigin,prevDeg:T,startDeg:T,prevSnapDeg:T,loop:0},r.afterInfo={origin:C.origin,prevDeg:T,startDeg:T,prevSnapDeg:T,loop:0}}else r.beforeInfo={origin:C.beforeOrigin},r.afterInfo={origin:C.origin},Ec(e,r.beforeInfo,n,a,_,w),Ec(e,r.afterInfo,n,a,g,w);r.direction=m,r.beforeDirection=b,r.startValue=0,r.datas={},Df(t,"rotate");var A=Zt(e,t,Q(Q({set:function(I){r.startValue=I*Math.PI/180}},If(t)),{dragStart:ir.dragStart(e,new So().dragStart([0,0],t))})),x=Et(e,"onRotateStart",A);return r.isRotate=x!==!1,e.state.snapRenderInfo={request:t.isRequest},r.isRotate?A:!1},dragControl:function(e,t){var r,n,a,i,s,u,f,c,h,p=t.datas,v=t.clientX,g=t.clientY,_=t.parentRotate,m=t.parentFlag,b=t.isPinch,y=t.groupDelta,w=p.beforeDirection,C=p.beforeInfo,T=p.afterInfo,A=p.absoluteInfo,x=p.isRotate,I=p.startValue,B=p.rect;if(!!x){Mf(t,"rotate");var P=gut(t),L=w*P,G=e.props,K=G.throttleRotate,at=K===void 0?0:K,et=G.parentMoveable,rt,gt,Z,it,ct,lt,dt,Ut,Lt,ve=180/Math.PI*I,bt=A.startValue;if(!m&&"parentDist"in t){var Nt=t.parentDist;r=Cc(e,B,T,Nt,L,ve),rt=r[0],gt=r[1],Z=r[2],n=Cc(e,B,C,Nt,w,ve),it=n[0],ct=n[1],lt=n[2],a=Cc(e,B,A,Nt,L,bt),dt=a[0],Ut=a[1],Lt=a[2]}else b||m?(i=Iu(e,B,T,_,L,ve,at),rt=i[0],gt=i[1],Z=i[2],s=Iu(e,B,C,_,w,ve,at),it=s[0],ct=s[1],lt=s[2],u=Iu(e,B,A,_,L,bt,at),dt=u[0],Ut=u[1],Lt=u[2]):(f=Oc(e,B,T,L,v,g,ve,at),rt=f[0],gt=f[1],Z=f[2],c=Oc(e,B,C,w,v,g,ve,at),it=c[0],ct=c[1],lt=c[2],h=Oc(e,B,A,L,v,g,bt,at),dt=h[0],Ut=h[1],Lt=h[2]);if(!(!dt&&!rt&&!it&&!et)){var de=Pf(p,"rotate("+Z+"deg)","rotate("+gt+"deg)"),Jt=Cut(e,gt,p.fixedPosition,p),Tt=Gt(Vt(y||[0,0],Jt),p.prevInverseDist||[0,0]);p.prevInverseDist=Jt;var Ie=Zt(e,t,Q({delta:rt,dist:gt,rotate:Z,beforeDist:ct,beforeDelta:it,beforeRotate:lt,absoluteDist:Ut,absoluteDelta:dt,absoluteRotate:Lt,isPinch:!!b},vw(e,de,Tt,b,t)));return Et(e,"onRotate",Ie),Ie}}},dragControlEnd:function(e,t){var r=t.datas;if(!!r.isRotate){r.isRotate=!1;var n=Pr(e,t,{});return Et(e,"onRotateEnd",n),n}},dragGroupControlCondition:Dh,dragGroupControlStart:function(e,t){var r=t.datas,n=e.state,a=n.left,i=n.top,s=n.beforeOrigin,u=this.dragControlStart(e,t);if(!u)return!1;u.set(r.beforeDirection*e.rotation);var f=jn(e,this,"dragControlStart",t,function(p,v){var g=p.state,_=g.left,m=g.top,b=g.beforeOrigin,y=Vt(Gt([_,m],[a,i]),Gt(b,s));return v.datas.groupClient=y,Q(Q({},v),{parentRotate:0})}),c=Q(Q({},u),{targets:e.props.targets,events:f}),h=Et(e,"onRotateGroupStart",c);return r.isRotate=h!==!1,r.isRotate?u:!1},dragGroupControl:function(e,t){var r=t.datas;if(!!r.isRotate){var n=this.dragControl(e,t);if(!!n){var a=r.beforeDirection,i=n.beforeDist,s=n.beforeDelta,u=s/180*Math.PI,f=jn(e,this,"dragControl",t,function(h,p){var v=p.datas.groupClient,g=v[0],_=v[1],m=ua([g,_],u*a),b=m[0],y=m[1],w=[b-g,y-_];return p.datas.groupClient=[b,y],Q(Q({},p),{parentRotate:i,groupDelta:w})});e.rotation=a*n.beforeRotate;var c=Q({targets:e.props.targets,events:f,set:function(h){e.rotation=h}},n);return Et(e,"onRotateGroup",c),c}}},dragGroupControlEnd:function(e,t){var r=t.isDrag,n=t.datas;if(!!n.isRotate){this.dragControlEnd(e,t);var a=jn(e,this,"dragControlEnd",t),i=Pr(e,t,{targets:e.props.targets,events:a});return Et(e,"onRotateGroupEnd",i),r}},request:function(e){var t={},r=0,n=e.getRotation();return{isControl:!0,requestStart:function(){return{datas:t}},request:function(a){return"deltaRotate"in a?r+=a.deltaRotate:"rotate"in a&&(r=a.rotate-n),{datas:t,parentDist:r}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},pft={name:"resizable",ableGroup:"size",canPinch:!0,props:{resizable:Boolean,throttleResize:Number,renderDirections:Array,keepRatio:Boolean},events:{onResizeStart:"resizeStart",onResize:"resize",onResizeEnd:"resizeEnd",onResizeGroupStart:"resizeGroupStart",onResizeGroup:"resizeGroup",onResizeGroupEnd:"resizeGroupEnd"},render:function(e,t){var r=e.props,n=r.resizable,a=r.edge;if(n)return a?Tw(e,t):yv(e,t)},dragControlCondition:ro,dragControlStart:function(e,t){var r,n=t.inputEvent,a=t.isPinch,i=t.parentDirection,s=t.datas,u=t.parentFlag,f=i||(a?[0,0]:pv(n.target)),c=e.state,h=c.target,p=c.width,v=c.height;if(!f||!h)return!1;!a&&ii(e,t),s.datas={},s.direction=f,s.startOffsetWidth=p,s.startOffsetHeight=v,s.prevWidth=0,s.prevHeight=0,r=nut(h),s.startWidth=r[0],s.startHeight=r[1];var g=[Math.max(0,p-s.startWidth),Math.max(0,v-s.startHeight)];if(s.minSize=g,s.maxSize=[1/0,1/0],!u){var _=dr(h),m=_.position,b=_.minWidth,y=_.minHeight,w=_.maxWidth,C=_.maxHeight,T=m==="static"||m==="relative",A=T?h.parentElement:h.offsetParent,x=p,I=v;if(A&&(x=A.clientWidth,I=A.clientHeight,T)){var B=dr(A);x-=parseFloat(B.paddingLeft)||0,I-=parseFloat(B.paddingTop)||0}s.minSize=Vt([Ze(b,x)||0,Ze(y,I)||0],g),s.maxSize=Vt([Ze(w,x)||1/0,Ze(C,I)||1/0],g)}var P=e.props.transformOrigin||"% %";s.transformOrigin=P&&rn(P)?P.split(" "):P,s.isWidth=!f[0]&&!f[1]||f[0]||!f[1];function L(et){s.ratio=et&&isFinite(et)?et:0}function G(et){s.fixedDirection=et,s.fixedPosition=Bi(e,et)}L(p/v),G([-f[0],-f[1]]);var K=Zt(e,t,{direction:f,set:function(et){var rt=et[0],gt=et[1];s.startWidth=rt,s.startHeight=gt},setMin:function(et){s.minSize=et},setMax:function(et){s.maxSize=[et[0]||1/0,et[1]||1/0]},setRatio:L,setFixedDirection:G,setOrigin:function(et){s.transformOrigin=et},dragStart:ir.dragStart(e,new So().dragStart([0,0],t))}),at=Et(e,"onResizeStart",K);return at!==!1&&(s.isResize=!0,e.state.snapRenderInfo={request:t.isRequest,direction:f}),s.isResize?K:!1},dragControl:function(e,t){var r,n=t.datas,a=t.distX,i=t.distY,s=t.parentFlag,u=t.isPinch,f=t.parentDistance,c=t.parentScale,h=t.parentKeepRatio,p=t.dragClient,v=t.parentDist,g=t.isRequest,_=n.isResize,m=n.transformOrigin,b=n.fixedDirection,y=n.startWidth,w=n.startHeight,C=n.prevWidth,T=n.prevHeight,A=n.minSize,x=n.maxSize,I=n.ratio,B=n.isWidth,P=n.startOffsetWidth,L=n.startOffsetHeight;if(!!_){var G=e.props,K=G.throttleResize,at=K===void 0?0:K,et=G.parentMoveable,rt=G.snapThreshold,gt=rt===void 0?5:rt,Z=n.direction,it=Z,ct=0,lt=0;!Z[0]&&!Z[1]&&(it=[1,1]);var dt=I&&(e.props.keepRatio||h),Ut=p;if(p||(!s&&u?Ut=Bi(e,[0,0]):Ut=n.fixedPosition),v)ct=v[0],lt=v[1],dt&&(ct?lt||(lt=ct/I):ct=lt*I);else if(c)ct=(c[0]-1)*P,lt=(c[1]-1)*L;else if(u)f&&(ct=f,lt=f*L/P);else{var Lt=On({datas:n,distX:a,distY:i});if(ct=it[0]*Lt[0],lt=it[1]*Lt[1],dt&&P&&L){var ve=Ce([0,0],Lt),bt=Ce([0,0],it),Nt=en([ct,lt]),de=Math.cos(ve-bt)*Nt;if(!it[0])lt=de,ct=lt/I;else if(!it[1])ct=de,lt=ct*I;else{var Jt=it[0]*2*P,Tt=it[1]*2*L,Ie=en([Jt+Lt[0],Tt+Lt[1]])-en([Jt,Tt]),Oe=Ce([0,0],[I,1]);ct=Math.cos(Oe)*Ie,lt=Math.sin(Oe)*Ie}}else if(!dt){var ge=Rt([],Z);P||(Lt[0]<0?ge[0]=-1:Lt[0]>0&&(ge[0]=1)),L||(Lt[1]<0?ge[1]=-1:Lt[1]>0&&(ge[1]=1)),Z=ge,it=ge,ct=it[0]*Lt[0],lt=it[1]*Lt[1]}}var Kt=it[0]||dt?Math.max(P+ct,Mr):P,wt=it[1]||dt?Math.max(L+lt,Mr):L;dt&&P&&L&&(B?wt=Kt/I:Kt=wt*I);var St=[0,0];if(u||(St=oft(e,Kt,wt,Z,Ut,g,n)),v&&(!v[0]&&(St[0]=0),!v[1]&&(St[1]=0)),dt){it[0]&&it[1]&&St[0]&&St[1]&&(Math.abs(St[0])>Math.abs(St[1])?St[1]=0:St[0]=0);var Ae=!St[0]&&!St[1];Ae&&(B?Kt=re(Kt,at):wt=re(wt,at)),it[0]&&!it[1]||St[0]&&!St[1]||Ae&&B?(Kt+=St[0],wt=Kt/I):(!it[0]&&it[1]||!St[0]&&St[1]||Ae&&!B)&&(wt+=St[1],Kt=wt*I)}else P+ct<-gt&&(St[0]=0),P+lt<-gt&&(St[1]=0),Kt+=St[0],wt+=St[1],St[0]||(Kt=re(Kt,at)),St[1]||(wt=re(wt,at));r=Cst([Kt,wt],A,x,dt),Kt=r[0],wt=r[1],Kt=Math.round(Kt),wt=Math.round(wt),ct=Kt-P,lt=wt-L;var be=[ct-C,lt-T];n.prevWidth=ct,n.prevHeight=lt;var jt=Out(e,Kt,wt,b,Ut,m);if(!(!et&&be.every(function(Le){return!Le})&&jt.every(function(Le){return!Le}))){var Ft=Zt(e,t,{width:y+ct,height:w+lt,offsetWidth:Kt,offsetHeight:wt,direction:Z,dist:[ct,lt],delta:be,isPinch:!!u,drag:ir.drag(e,Tf(t,e.state,jt,!!u,!1))});return Et(e,"onResize",Ft),Ft}}},dragControlAfter:function(e,t){var r=t.datas,n=r.isResize,a=r.startOffsetWidth,i=r.startOffsetHeight,s=r.prevWidth,u=r.prevHeight;if(!!n){var f=e.state,c=f.width,h=f.height,p=c-(a+s),v=h-(i+u),g=Math.abs(p)>3,_=Math.abs(v)>3;if(g&&(r.startWidth+=p,r.startOffsetWidth+=p,r.prevWidth+=p),_&&(r.startHeight+=v,r.startOffsetHeight+=v,r.prevHeight+=v),g||_)return this.dragControl(e,t)}},dragControlEnd:function(e,t){var r=t.datas;if(!!r.isResize){r.isResize=!1;var n=Pr(e,t,{});return Et(e,"onResizeEnd",n),n}},dragGroupControlCondition:ro,dragGroupControlStart:function(e,t){var r=t.datas,n=this.dragControlStart(e,t);if(!n)return!1;var a=ga(e,"resizable",t);function i(c,h){var p=r.fixedDirection,v=r.fixedPosition,g=Bi(c,p),_=sr(Fi(-e.rotation/180*Math.PI,3),[g[0]-v[0],g[1]-v[1],1],3),m=_[0],b=_[1];return h.datas.originalX=m,h.datas.originalY=b,h}var s=jn(e,this,"dragControlStart",t,function(c,h){return i(c,h)}),u=Q(Q({},n),{targets:e.props.targets,events:s,setFixedDirection:function(c){n.setFixedDirection(c),s.forEach(function(h,p){h.setFixedDirection(c),i(e.moveables[p],a[p])})}}),f=Et(e,"onResizeGroupStart",u);return r.isResize=f!==!1,r.isResize?n:!1},dragGroupControl:function(e,t){var r=t.datas;if(!!r.isResize){var n=this.dragControl(e,t);if(!!n){var a=n.offsetWidth,i=n.offsetHeight,s=n.dist,u=e.props.keepRatio,f=[a/(a-s[0]),i/(i-s[1])],c=r.fixedPosition,h=jn(e,this,"dragControl",t,function(v,g){var _=sr(Fi(e.rotation/180*Math.PI,3),[g.datas.originalX*f[0],g.datas.originalY*f[1],1],3),m=_[0],b=_[1];return Q(Q({},g),{parentDist:null,parentScale:f,dragClient:Vt(c,[m,b]),parentKeepRatio:u})}),p=Q({targets:e.props.targets,events:h},n);return Et(e,"onResizeGroup",p),p}}},dragGroupControlEnd:function(e,t){var r=t.isDrag,n=t.datas;if(!!n.isResize){this.dragControlEnd(e,t);var a=jn(e,this,"dragControlEnd",t),i=Pr(e,t,{targets:e.props.targets,events:a});return Et(e,"onResizeGroupEnd",i),r}},request:function(e){var t={},r=0,n=0,a=e.getRect();return{isControl:!0,requestStart:function(i){return{datas:t,parentDirection:i.direction||[1,1]}},request:function(i){return"offsetWidth"in i?r=i.offsetWidth-a.offsetWidth:"deltaWidth"in i&&(r+=i.deltaWidth),"offsetHeight"in i?n=i.offsetHeight-a.offsetHeight:"deltaHeight"in i&&(n+=i.deltaHeight),{datas:t,parentDist:[r,n]}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},vft={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(e,t){var r=e.props,n=r.resizable,a=r.scalable,i=r.edge;if(!n&&a)return i?Tw(e,t):yv(e,t)},dragControlCondition:ro,dragControlStart:function(e,t){var r=t.datas,n=t.isPinch,a=t.inputEvent,i=t.parentDirection,s=i||(n?[0,0]:pv(a.target)),u=e.state,f=u.width,c=u.height,h=u.targetTransform,p=u.target,v=u.pos1,g=u.pos2,_=u.pos4;if(!s||!p)return!1;n||ii(e,t),r.datas={},r.transform=h,r.prevDist=[1,1],r.direction=s,r.width=f,r.height=c,r.startValue=[1,1];var m=Gn(v,g),b=Gn(g,_),y=!s[0]&&!s[1]||s[0]||!s[1];r.scaleWidth=m,r.scaleHeight=b,r.scaleXRatio=m/f,r.scaleYRatio=b/c,Df(t,"scale"),r.isWidth=y;function w(x){r.ratio=x&&isFinite(x)?x:0}function C(x){r.fixedDirection=x,r.fixedPosition=Bi(e,x)}w(Gn(v,g)/Gn(g,_)),C([-s[0],-s[1]]);var T=Zt(e,t,Q(Q({direction:s,set:function(x){r.startValue=x},setRatio:w,setFixedDirection:C},If(t)),{dragStart:ir.dragStart(e,new So().dragStart([0,0],t))})),A=Et(e,"onScaleStart",T);return A!==!1&&(r.isScale=!0,e.state.snapRenderInfo={request:t.isRequest,direction:s}),r.isScale?T:!1},dragControl:function(e,t){Mf(t,"scale");var r=t.datas,n=t.distX,a=t.distY,i=t.parentScale,s=t.parentDistance,u=t.parentKeepRatio,f=t.parentFlag,c=t.isPinch,h=t.dragClient,p=t.parentDist,v=t.isRequest,g=r.prevDist,_=r.direction,m=r.width,b=r.height,y=r.isScale,w=r.startValue,C=r.isWidth,T=r.ratio,A=r.fixedDirection,x=r.scaleXRatio,I=r.scaleYRatio;if(!y)return!1;var B=e.props,P=B.throttleScale,L=B.parentMoveable,G=_;!_[0]&&!_[1]&&(G=[1,1]);var K=T&&(e.props.keepRatio||u),at=e.state,et=1,rt=1,gt=h;if(h||(!f&&c?gt=Bi(e,[0,0]):gt=r.fixedPosition),p)et=(m+p[0])/m,rt=(b+p[1])/b;else if(i)et=i[0],rt=i[1];else if(c)s&&(et=(m+s)/m,rt=(b+s*b/m)/b);else{var Z=On({datas:r,distX:n,distY:a}),it=G[0]*Z[0]*x,ct=G[1]*Z[1]*I;if(K&&m&&b)if(!G[0])it=ct*T;else if(!G[1])ct=it/T;else{var lt=en([it,ct]),dt=Ce([0,0],Z),Ut=Ce([0,0],G),Lt=Math.cos(dt-Ut)*lt,ve=Ce([0,0],[T,1]);it=Math.cos(ve)*Lt,ct=Math.sin(ve)*Lt}et=(m+it/x)/m,rt=(b+ct/I)/b}et=G[0]||K?et*w[0]:w[0],rt=G[1]||K?rt*w[1]:w[1],et===0&&(et=(g[0]>0?1:-1)*$u),rt===0&&(rt=(g[1]>0?1:-1)*$u);var bt=[et/w[0],rt/w[1]],Nt=[et,rt];if(!c&&e.props.groupable){var de=at.snapRenderInfo||{},Jt=de.direction;ni(Jt)&&(Jt[0]||Jt[1])&&(at.snapRenderInfo={direction:_,request:t.isRequest})}var Tt=[0,0];if(c||(Tt=uft(e,bt,_,v,r)),K){G[0]&&G[1]&&Tt[0]&&Tt[1]&&(Math.abs(Tt[0]*m)>Math.abs(Tt[1]*b)?Tt[1]=0:Tt[0]=0);var Ie=!Tt[0]&&!Tt[1];if(Ie&&(C?bt[0]=re(bt[0]*w[0],P)/w[0]:bt[1]=re(bt[1]*w[1],P)/w[1]),G[0]&&!G[1]||Tt[0]&&!Tt[1]||Ie&&C){bt[0]+=Tt[0];var Oe=m*bt[0]*w[0]/T;bt[1]=Oe/b/w[1]}else if(!G[0]&&G[1]||!Tt[0]&&Tt[1]||Ie&&!C){bt[1]+=Tt[1];var ge=b*bt[1]*w[1]*T;bt[0]=ge/m/w[0]}}else bt[0]+=Tt[0],bt[1]+=Tt[1],Tt[0]||(bt[0]=re(bt[0]*w[0],P)/w[0]),Tt[1]||(bt[1]=re(bt[1]*w[1],P)/w[1]);bt[0]===0&&(bt[0]=(g[0]>0?1:-1)*$u),bt[1]===0&&(bt[1]=(g[1]>0?1:-1)*$u);var Kt=[bt[0]/g[0],bt[1]/g[1]];Nt=Kot(bt,w);var wt=Eut(e,bt,A,gt,r),St=Gt(wt,r.prevInverseDist||[0,0]);if(r.prevDist=bt,r.prevInverseDist=wt,et===g[0]&&rt===g[1]&&St.every(function(jt){return!jt})&&!L)return!1;var Ae=Pf(r,"scale("+Nt.join(", ")+")","scale("+bt.join(", ")+")"),be=Zt(e,t,Q({offsetWidth:m,offsetHeight:b,direction:_,scale:Nt,dist:bt,delta:Kt,isPinch:!!c},vw(e,Ae,St,c,t)));return Et(e,"onScale",be),be},dragControlEnd:function(e,t){var r=t.datas,n=t.isDrag;return r.isScale?(r.isScale=!1,Et(e,"onScaleEnd",Pr(e,t,{})),n):!1},dragGroupControlCondition:ro,dragGroupControlStart:function(e,t){var r=t.datas,n=this.dragControlStart(e,t);if(!n)return!1;var a=ga(e,"resizable",t);function i(c,h){var p=r.fixedDirection,v=r.fixedPosition,g=Bi(c,p),_=sr(Fi(-e.rotation/180*Math.PI,3),[g[0]-v[0],g[1]-v[1],1],3),m=_[0],b=_[1];return h.datas.originalX=m,h.datas.originalY=b,h}r.moveableScale=e.scale;var s=jn(e,this,"dragControlStart",t,function(c,h){return i(c,h)}),u=Q(Q({},n),{targets:e.props.targets,events:s,setFixedDirection:function(c){n.setFixedDirection(c),s.forEach(function(h,p){h.setFixedDirection(c),i(e.moveables[p],a[p])})}}),f=Et(e,"onScaleGroupStart",u);return r.isScale=f!==!1,r.isScale?u:!1},dragGroupControl:function(e,t){var r=t.datas;if(!!r.isScale){var n=this.dragControl(e,t);if(!!n){var a=r.moveableScale;e.scale=[n.scale[0]*a[0],n.scale[1]*a[1]];var i=e.props.keepRatio,s=n.dist,u=n.scale,f=r.fixedPosition,c=jn(e,this,"dragControl",t,function(p,v){var g=sr(Fi(e.rotation/180*Math.PI,3),[v.datas.originalX*s[0],v.datas.originalY*s[1],1],3),_=g[0],m=g[1];return Q(Q({},v),{parentDist:null,parentScale:u,parentKeepRatio:i,dragClient:Vt(f,[_,m])})}),h=Q({targets:e.props.targets,events:c},n);return Et(e,"onScaleGroup",h),h}}},dragGroupControlEnd:function(e,t){var r=t.isDrag,n=t.datas;if(!!n.isScale){this.dragControlEnd(e,t);var a=jn(e,this,"dragControlEnd",t),i=Pr(e,t,{targets:e.props.targets,events:a});return Et(e,"onScaleGroupEnd",i),r}},request:function(){var e={},t=0,r=0;return{isControl:!0,requestStart:function(n){return{datas:e,parentDirection:n.direction||[1,1]}},request:function(n){return t+=n.deltaWidth,r+=n.deltaHeight,{datas:e,parentDist:[t,r]}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function ia(e,t){return e.map(function(r,n){return $st(r,t[n],1,2)})}function zm(e,t,r){var n=Ce(e,t),a=Ce(e,r),i=a-n;return i>=0?i:i+2*Math.PI}function dft(e,t){var r=zm(e[0],e[1],e[2]),n=zm(t[0],t[1],t[2]),a=Math.PI;return!(r>=a&&n<=a||r<=a&&n>=a)}var gft={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var r=e.props,n=r.resizable,a=r.scalable,i=r.warpable,s=r.zoom;if(n||a||!i)return[];var u=e.state,f=u.pos1,c=u.pos2,h=u.pos3,p=u.pos4,v=ia(f,c),g=ia(c,f),_=ia(f,h),m=ia(h,f),b=ia(h,p),y=ia(p,h),w=ia(c,p),C=ia(p,c);return Rt([t.createElement("div",{className:Ht("line"),key:"middeLine1",style:Rs(v,b,s)}),t.createElement("div",{className:Ht("line"),key:"middeLine2",style:Rs(g,y,s)}),t.createElement("div",{className:Ht("line"),key:"middeLine3",style:Rs(_,w,s)}),t.createElement("div",{className:Ht("line"),key:"middeLine4",style:Rs(m,C,s)})],yv(e,t))},dragControlCondition:function(e,t){return t.isRequest?!1:tn(t.inputEvent.target,Ht("direction"))},dragControlStart:function(e,t){var r=t.datas,n=t.inputEvent,a=e.props.target,i=n.target,s=pv(i);if(!s||!a)return!1;var u=e.state,f=u.transformOrigin,c=u.is3d,h=u.targetTransform,p=u.targetMatrix,v=u.width,g=u.height,_=u.left,m=u.top;r.datas={},r.targetTransform=h,r.warpTargetMatrix=c?p:Un(p,3,4),r.targetInverseMatrix=Uy(gn(r.warpTargetMatrix,4),3,4),r.direction=s,r.left=_,r.top=m,r.poses=[[0,0],[v,0],[0,g],[v,g]].map(function(w){return Gt(w,f)}),r.nextPoses=r.poses.map(function(w){var C=w[0],T=w[1];return sr(r.warpTargetMatrix,[C,T,0,1],4)}),r.startValue=Pe(4),r.prevMatrix=Pe(4),r.absolutePoses=Cn(u),r.posIndexes=hw(s),ii(e,t),Df(t,"matrix3d"),u.snapRenderInfo={request:t.isRequest,direction:s};var b=Zt(e,t,Q({set:function(w){r.startValue=w}},If(t))),y=Et(e,"onWarpStart",b);return y!==!1&&(r.isWarp=!0),r.isWarp},dragControl:function(e,t){var r=t.datas,n=t.isRequest,a=t.distX,i=t.distY,s=r.targetInverseMatrix,u=r.prevMatrix,f=r.isWarp,c=r.startValue,h=r.poses,p=r.posIndexes,v=r.absolutePoses;if(!f)return!1;if(Mf(t,"matrix3d"),us(e,"warpable")){var g=p.map(function(P){return v[P]});g.length>1&&g.push([(g[0][0]+g[1][0])/2,(g[0][1]+g[1][1])/2]);var _=Lf(e,n,{horizontal:g.map(function(P){return P[1]+i}),vertical:g.map(function(P){return P[0]+a})}),m=_.horizontal,b=_.vertical;i-=m.offset,a-=b.offset}var y=On({datas:r,distX:a,distY:i},!0),w=r.nextPoses.slice();if(p.forEach(function(P){w[P]=Vt(w[P],y)}),!Uot.every(function(P){return dft(P.map(function(L){return h[L]}),P.map(function(L){return w[L]}))}))return!1;var C=fv(h[0],h[2],h[1],h[3],w[0],w[2],w[1],w[3]);if(!C.length)return!1;var T=pe(s,C,4),A=lw(r,T,!0),x=pe(gn(u,4),A,4);r.prevMatrix=A;var I=pe(c,A,4),B=Pf(r,"matrix3d("+I.join(", ")+")","matrix3d("+A.join(", ")+")");return dv(t,B),Et(e,"onWarp",Zt(e,t,{delta:x,matrix:I,dist:A,multiply:pe,transform:B})),!0},dragControlEnd:function(e,t){var r=t.datas,n=t.isDrag;return r.isWarp?(r.isWarp=!1,Et(e,"onWarpEnd",Pr(e,t,{})),n):!1}},_ft=Ht("area-pieces"),wu=Ht("area-piece"),Mw=Ht("avoid");function Ac(e){var t=e.areaElement,r=e.state,n=r.width,a=r.height;Mst(t,Mw),t.style.cssText+="left: 0px; top: 0px; width: "+n+"px; height: "+a+"px"}function Gm(e){return e.createElement("div",{key:"area_pieces",className:_ft},e.createElement("div",{className:wu}),e.createElement("div",{className:wu}),e.createElement("div",{className:wu}),e.createElement("div",{className:wu}))}var Pw={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var r=e.props,n=r.target,a=r.dragArea,i=r.groupable,s=r.passDragArea,u=e.state,f=u.width,c=u.height,h=u.renderPoses,p=s?Ht("area","pass"):Ht("area");if(i)return[t.createElement("div",{key:"area",ref:pn(e,"areaElement"),className:p}),Gm(t)];if(!n||!a)return[];var v=fv([0,0],[f,0],[0,c],[f,c],h[0],h[1],h[2],h[3]),g=v.length?Of(v,!0):"none";return[t.createElement("div",{key:"area",ref:pn(e,"areaElement"),className:p,style:{top:"0px",left:"0px",width:f+"px",height:c+"px",transformOrigin:"0 0",transform:g}}),Gm(t)]},dragStart:function(e,t){var r=t.datas,n=t.clientX,a=t.clientY,i=t.inputEvent;if(!i)return!1;r.isDragArea=!1;var s=e.areaElement,u=e.state,f=u.moveableClientRect,c=u.renderPoses,h=u.rootMatrix,p=u.is3d,v=f.left,g=f.top,_=kr(c),m=_.left,b=_.top,y=_.width,w=_.height,C=p?4:3,T=Ri(h,[n-v,a-g],C),A=T[0],x=T[1];A-=m,x-=b;var I=[{left:m,top:b,width:y,height:x-10},{left:m,top:b,width:A-10,height:w},{left:m,top:b+x+10,width:y,height:w-x-10},{left:m+A+10,top:b,width:y-A-10,height:w}],B=[].slice.call(s.nextElementSibling.children);I.forEach(function(P,L){B[L].style.cssText="left: "+P.left+"px;top: "+P.top+"px; width: "+P.width+"px; height: "+P.height+"px;"}),Tst(s,Mw),u.disableNativeEvent=!0},drag:function(e,t){var r=t.datas,n=t.inputEvent;if(this.enableNativeEvent(e),!n)return!1;r.isDragArea||(r.isDragArea=!0,Ac(e))},dragEnd:function(e,t){this.enableNativeEvent(e);var r=t.inputEvent,n=t.datas;if(!r)return!1;n.isDragArea||Ac(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){Ac(e),e.state.disableNativeEvent=!1},enableNativeEvent:function(e){var t=e.state;t.disableNativeEvent&&rv(function(){t.disableNativeEvent=!1})}},mft=yo("origin",{render:function(e,t){var r=e.props.zoom,n=e.state,a=n.beforeOrigin,i=n.rotation;return[t.createElement("div",{className:Ht("control","origin"),style:aw(i,r,a),key:"beforeOrigin"})]}});function $ft(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var bft={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragRelation:"strong",dragStart:function(e,t){var r=e.props,n=r.scrollContainer,a=n===void 0?e.getContainer():n,i=new yot,s=Af(a,!0);t.datas.dragScroll=i;var u=t.isControl?"controlGesto":"targetGesto",f=t.targets;i.on("scroll",function(c){var h=c.container,p=c.direction,v=Zt(e,t,{scrollContainer:h,direction:p}),g=f?"onScrollGroup":"onScroll";f&&(v.targets=f),Et(e,g,v)}).on("move",function(c){var h=c.offsetX,p=c.offsetY;e[u].scrollBy(h,p,t.inputEvent,!1)}),i.dragStart(t,{container:s})},checkScroll:function(e,t){var r=t.datas.dragScroll;if(!!r){var n=e.props,a=n.scrollContainer,i=a===void 0?e.getContainer():a,s=n.scrollThreshold,u=s===void 0?0:s,f=n.getScrollPosition,c=f===void 0?$ft:f;return r.drag(t,{container:i,threshold:u,getScrollPosition:function(h){return c({scrollContainer:h.container,direction:h.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,Q(Q({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,Q(Q({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,Q(Q({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,Q(Q({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,Q(Q({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,Q(Q({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,Q(Q({},t),{targets:e.props.targets}))}},xw={name:"",props:{target:Object,dragTarget:Object,container:Object,portalContainer:Object,rootContainer:Object,useResizeObserver:Boolean,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,hideDefaultLines:Boolean,props:Object},events:{}},yft=yo("padding",{render:function(e,t){var r=e.props;if(r.dragArea)return[];var n=r.padding||{},a=n.left,i=a===void 0?0:a,s=n.top,u=s===void 0?0:s,f=n.right,c=f===void 0?0:f,h=n.bottom,p=h===void 0?0:h,v=e.state,g=v.renderPoses,_=v.pos1,m=v.pos2,b=v.pos3,y=v.pos4,w=[_,m,b,y],C=[];return i>0&&C.push([0,2]),u>0&&C.push([0,1]),c>0&&C.push([1,3]),p>0&&C.push([2,3]),C.map(function(T,A){var x=T[0],I=T[1],B=w[x],P=w[I],L=g[x],G=g[I],K=fv([0,0],[100,0],[0,100],[100,100],B,P,L,G);if(!!K.length)return t.createElement("div",{key:"padding"+A,className:Ht("padding"),style:{transform:Of(K,!0)}})})}}),Nm=["nw","ne","se","sw"];function Su(e,t){var r=e[0]+e[1],n=r>t?t/r:1;return e[0]*=n,e[1]=t-e[1]*n,e}var wft=[1,2,5,6],Sft=[0,3,4,7],ja=[1,-1,-1,1],qa=[1,1,-1,-1];function wv(e,t,r,n,a,i,s,u,f){i===void 0&&(i=0),s===void 0&&(s=0),u===void 0&&(u=n),f===void 0&&(f=a);var c=[],h=!1,p=e.map(function(v,g){var _=t[g],m=_.horizontal,b=_.vertical;if(b&&!h&&(h=!0,c.push("/")),h){var y=Math.max(0,b===1?v[1]-s:f-v[1]);return c.push(Qr(y,a,r)),y}else{var y=Math.max(0,m===1?v[0]-i:u-v[0]);return c.push(Qr(y,n,r)),y}});return{styles:c,raws:p}}function Iw(e){for(var t=[0,0],r=[0,0],n=e.length,a=0;a<n;++a){var i=e[a];!i.sub||(i.horizontal&&(t[1]===0&&(t[0]=a),t[1]=a-t[0]+1,r[0]=a+1),i.vertical&&(r[1]===0&&(r[0]=a),r[1]=a-r[0]+1))}return{horizontalRange:t,verticalRange:r}}function Dw(e,t,r,n,a,i){var s,u,f,c;i===void 0&&(i=[0,0]);var h=e.indexOf("/"),p=(h>-1?e.slice(0,h):e).length,v=e.slice(0,p),g=e.slice(p+1),_=v[0],m=_===void 0?"0px":_,b=v[1],y=b===void 0?m:b,w=v[2],C=w===void 0?m:w,T=v[3],A=T===void 0?y:T,x=g[0],I=x===void 0?m:x,B=g[1],P=B===void 0?I:B,L=g[2],G=L===void 0?I:L,K=g[3],at=K===void 0?P:K,et=[m,y,C,A].map(function(lt){return Ze(lt,t)}),rt=[I,P,G,at].map(function(lt){return Ze(lt,r)}),gt=et.slice(),Z=rt.slice();s=Su([gt[0],gt[1]],t),gt[0]=s[0],gt[1]=s[1],u=Su([gt[3],gt[2]],t),gt[3]=u[0],gt[2]=u[1],f=Su([Z[0],Z[3]],r),Z[0]=f[0],Z[3]=f[1],c=Su([Z[1],Z[2]],r),Z[1]=c[0],Z[2]=c[1];var it=gt.slice(0,Math.max(i[0],v.length)),ct=Z.slice(0,Math.max(i[1],g.length));return Rt(Rt([],it.map(function(lt,dt){var Ut=Nm[dt];return{horizontal:ja[dt],vertical:0,pos:[n+lt,a+(qa[dt]===-1?r:0)],sub:!0,raw:et[dt],direction:Ut}})),ct.map(function(lt,dt){var Ut=Nm[dt];return{horizontal:0,vertical:qa[dt],pos:[n+(ja[dt]===-1?t:0),a+lt],sub:!0,raw:rt[dt],direction:Ut}}))}function Rw(e,t,r,n,a){a===void 0&&(a=t.length);var i=Iw(e.slice(n)),s=i.horizontalRange,u=i.verticalRange,f=r-n,c=0;if(f===0)c=a;else if(f>0&&f<s[1])c=s[1]-f;else if(f>=u[0])c=u[0]+u[1]-f;else return;e.splice(r,c),t.splice(r,c)}function Bw(e,t,r,n,a,i,s,u,f,c,h){c===void 0&&(c=0),h===void 0&&(h=0);var p=Iw(e.slice(r)),v=p.horizontalRange,g=p.verticalRange;if(n>-1)for(var _=ja[n]===1?i-c:u-i,m=v[1];m<=n;++m){var b=qa[m]===1?h:f,y=0;if(n===m?y=i:m===0?y=c+_:ja[m]===-1&&(y=u-(t[r][0]-c)),e.splice(r+m,0,{horizontal:ja[m],vertical:0,pos:[y,b]}),t.splice(r+m,0,[y,b]),m===0)break}else if(a>-1){var w=qa[a]===1?s-h:f-s;if(v[1]===0&&g[1]===0){var C=[c+w,h];e.push({horizontal:ja[0],vertical:0,pos:C}),t.push(C)}for(var T=g[0],m=g[1];m<=a;++m){var y=ja[m]===1?c:u,b=0;if(a===m?b=s:m===0?b=h+w:qa[m]===1?b=t[r+T][1]:qa[m]===-1&&(b=f-(t[r+T][1]-h)),e.push({horizontal:0,vertical:qa[m],pos:[y,b]}),t.push([y,b]),m===0)break}}}function Lw(e,t){t===void 0&&(t=e.map(function(a){return a.raw}));var r=e.map(function(a,i){return a.horizontal?t[i]:null}).filter(function(a){return a!=null}),n=e.map(function(a,i){return a.vertical?t[i]:null}).filter(function(a){return a!=null});return{horizontals:r,verticals:n}}var Eft=[[0,-1,"n"],[1,0,"e"]],Cft=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function Sv(e,t,r){var n=e.props.clipRelative,a=e.state,i=a.width,s=a.height,u=t,f=u.type,c=u.poses,h=f==="rect",p=f==="circle";if(f==="polygon")return r.map(function(x){return Qr(x[0],i,n)+" "+Qr(x[1],s,n)});if(h||f==="inset"){var v=r[1][1],g=r[3][0],_=r[7][0],m=r[5][1];if(h)return[v,g,m,_].map(function(x){return x+"px"});var b=[v,i-g,s-m,_].map(function(x,I){return Qr(x,I%2?i:s,n)});if(r.length>8){var y=Gt(r[4],r[0]),w=y[0],C=y[1];b.push.apply(b,Rt(["round"],wv(r.slice(8),c.slice(8),n,w,C,_,v,g,m).styles))}return b}else if(p||f==="ellipse"){var T=r[0],A=Qr(Math.abs(r[1][1]-T[1]),p?Math.sqrt((i*i+s*s)/2):s,n),b=p?[A]:[Qr(Math.abs(r[2][0]-T[0]),i,n),A];return b.push("at",Qr(T[0],i,n),Qr(T[1],s,n)),b}}function jm(e,t,r,n){var a=[n,(n+t)/2,t],i=[e,(e+r)/2,r];return Cft.map(function(s){var u=s[0],f=s[1],c=s[2],h=a[u+1],p=i[f+1];return{vertical:Math.abs(f),horizontal:Math.abs(u),direction:c,pos:[h,p]}})}function qm(e,t,r,n,a){var i,s,u,f,c,h,p,v=a;if(!v){var g=dr(e),_=g.clipPath;v=_!=="none"?_:g.clip}if(!((!v||v==="none"||v==="auto")&&(v=n,!v))){var m=ev(v),b=m.prefix,y=b===void 0?v:b,w=m.value,C=w===void 0?"":w,T=y==="circle",A=" ";if(y==="polygon"){var x=Ua(C||"0% 0%, 100% 0%, 100% 100%, 0% 100%");A=",";var I=x.map(function(be){var jt=be.split(" "),Ft=jt[0],Le=jt[1];return{vertical:1,horizontal:1,pos:[Ze(Ft,t),Ze(Le,r)]}});return{type:y,clipText:v,poses:I,splitter:A}}else if(T||y==="ellipse"){var B="",P="",L=0,G=0,x=da(C);if(T){var K="";i=x[0],K=i===void 0?"50%":i,s=x[2],B=s===void 0?"50%":s,u=x[3],P=u===void 0?"50%":u,L=Ze(K,Math.sqrt((t*t+r*r)/2)),G=L}else{var at="",et="";f=x[0],at=f===void 0?"50%":f,c=x[1],et=c===void 0?"50%":c,h=x[3],B=h===void 0?"50%":h,p=x[4],P=p===void 0?"50%":p,L=Ze(at,t),G=Ze(et,r)}var rt=[Ze(B,t),Ze(P,r)],I=Rt([{vertical:1,horizontal:1,pos:rt,direction:"nesw"}],Eft.slice(0,T?1:2).map(function(Ft){return{vertical:Math.abs(Ft[1]),horizontal:Ft[0],direction:Ft[2],sub:!0,pos:[rt[0]+Ft[0]*L,rt[1]+Ft[1]*G]}}));return{type:y,clipText:v,radiusX:L,radiusY:G,left:rt[0]-L,top:rt[1]-G,poses:I,splitter:A}}else if(y==="inset"){var x=da(C||"0 0 0 0"),gt=x.indexOf("round"),Z=(gt>-1?x.slice(0,gt):x).length,it=x.slice(Z+1),ct=x.slice(0,Z),lt=ct[0],dt=ct[1],Ut=dt===void 0?lt:dt,Lt=ct[2],ve=Lt===void 0?lt:Lt,bt=ct[3],Nt=bt===void 0?Ut:bt,de=[lt,ve].map(function(Ft){return Ze(Ft,r)}),Jt=de[0],Tt=de[1],Ie=[Nt,Ut].map(function(Ft){return Ze(Ft,t)}),Oe=Ie[0],ge=Ie[1],Kt=t-ge,wt=r-Tt,St=Dw(it,Kt-Oe,wt-Jt,Oe,Jt),I=Rt(Rt([],jm(Jt,Kt,wt,Oe)),St);return{type:"inset",clipText:v,poses:I,top:Jt,left:Oe,right:Kt,bottom:wt,radius:it,splitter:A}}else if(y==="rect"){var x=Ua(C||"0px, "+t+"px, "+r+"px, 0px");A=",";var Ae=x.map(function(Dr){var Kn=go(Dr).value;return Kn}),Jt=Ae[0],ge=Ae[1],Tt=Ae[2],Oe=Ae[3],I=jm(Jt,ge,Tt,Oe);return{type:"rect",clipText:v,poses:I,top:Jt,right:ge,bottom:Tt,left:Oe,values:x,splitter:A}}}}function Oft(e,t){var r=fw(e,t),n=r[0],a=r[1],i=t.datas,s=i.clipPath,u=i.index,f=s,c=f.type,h=f.poses,p=f.splitter,v=h.map(function(y){return y.pos});if(c==="polygon")v.splice(u,0,[n,a]);else if(c==="inset"){var g=wft.indexOf(u),_=Sft.indexOf(u),m=h.length;if(Bw(h,v,8,g,_,n,a,v[4][0],v[4][1],v[0][0],v[0][1]),m===h.length)return}else return;var b=Sv(e,s,v);Et(e,"onClip",Zt(e,t,{clipEventType:"added",clipType:c,poses:v,clipStyles:b,clipStyle:c+"("+b.join(p)+")",distX:0,distY:0}))}function Aft(e,t){var r=t.datas,n=r.clipPath,a=r.index,i=n,s=i.type,u=i.poses,f=i.splitter,c=u.map(function(v){return v.pos}),h=c.length;if(s==="polygon")u.splice(a,1),c.splice(a,1);else if(s==="inset"){if(a<8||(Rw(u,c,a,8,h),h===u.length))return}else return;var p=Sv(e,n,c);Et(e,"onClip",Zt(e,t,{clipEventType:"removed",clipType:s,poses:c,clipStyles:p,clipStyle:s+"("+p.join(f)+")",distX:0,distY:0}))}var Tft={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[`.control.clip-control {
|
|
background: #6d6;
|
|
cursor: pointer;
|
|
}
|
|
.control.clip-control.clip-radius {
|
|
background: #d66;
|
|
}
|
|
.line.clip-line {
|
|
background: #6e6;
|
|
cursor: move;
|
|
z-index: 1;
|
|
}
|
|
.clip-area {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
}
|
|
.clip-ellipse {
|
|
position: absolute;
|
|
cursor: move;
|
|
border: 1px solid #6d6;
|
|
border: var(--zoompx) solid #6d6;
|
|
border-radius: 50%;
|
|
transform-origin: 0px 0px;
|
|
}`,`:host {
|
|
--bounds-color: #d66;
|
|
}`,`.guideline {
|
|
pointer-events: none;
|
|
z-index: 2;
|
|
}`,`.line.guideline.bounds {
|
|
background: #d66;
|
|
background: var(--bounds-color);
|
|
}`],render:function(e,t){var r=e.props,n=r.customClipPath,a=r.defaultClipPath,i=r.clipArea,s=r.zoom,u=e.state,f=u.target,c=u.width,h=u.height,p=u.allMatrix,v=u.is3d,g=u.left,_=u.top,m=u.pos1,b=u.pos2,y=u.pos3,w=u.pos4,C=u.clipPathState,T=u.snapBoundInfos,A=u.rotation;if(!f)return[];var x=qm(f,c,h,a||"inset",C||n);if(!x)return[];var I=v?4:3,B=x.type,P=x.poses,L=P.map(function(wt){var St=Je(p,wt.pos,I);return[St[0]-g,St[1]-_]}),G=[],K=[],at=B==="rect",et=B==="inset",rt=B==="polygon";if(at||et||rt){var gt=et?L.slice(0,8):L;K=gt.map(function(wt,St){var Ae=St===0?gt[gt.length-1]:gt[St-1],be=Ce(Ae,wt),jt=nw(Ae,wt);return t.createElement("div",{key:"clipLine"+St,className:Ht("line","clip-line","snap-control"),"data-clip-index":St,style:{width:jt+"px",transform:"translate("+Ae[0]+"px, "+Ae[1]+"px) rotate("+be+"rad) scaleY("+s+")"}})})}if(G=L.map(function(wt,St){return t.createElement("div",{key:"clipControl"+St,className:Ht("control","clip-control","snap-control"),"data-clip-index":St,style:{transform:"translate("+wt[0]+"px, "+wt[1]+"px) rotate("+A+"rad) scale("+s+")"}})}),et&&G.push.apply(G,L.slice(8).map(function(wt,St){return t.createElement("div",{key:"clipRadiusControl"+St,className:Ht("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+St,style:{transform:"translate("+wt[0]+"px, "+wt[1]+"px) rotate("+A+"rad) scale("+s+")"}})})),B==="circle"||B==="ellipse"){var Z=x.left,it=x.top,ct=x.radiusX,lt=x.radiusY,dt=Gt(Je(p,[Z,it],I),Je(p,[0,0],I)),Ut=dt[0],Lt=dt[1],ve="none";if(!i){for(var bt=Math.max(10,ct/5,lt/5),Nt=[],de=0;de<=bt;++de){var Jt=Math.PI*2/bt*de;Nt.push([ct+(ct-s)*Math.cos(Jt),lt+(lt-s)*Math.sin(Jt)])}Nt.push([ct,-2]),Nt.push([-2,-2]),Nt.push([-2,lt*2+2]),Nt.push([ct*2+2,lt*2+2]),Nt.push([ct*2+2,-2]),Nt.push([ct,-2]),ve="polygon("+Nt.map(function(wt){return wt[0]+"px "+wt[1]+"px"}).join(", ")+")"}G.push(t.createElement("div",{key:"clipEllipse",className:Ht("clip-ellipse","snap-control"),style:{width:ct*2+"px",height:lt*2+"px",clipPath:ve,transform:"translate("+(-g+Ut)+"px, "+(-_+Lt)+"px) "+Of(p)}}))}if(i){var Tt=kr(Rt([m,b,y,w],L)),Ie=Tt.width,Oe=Tt.height,ge=Tt.left,Kt=Tt.top;if(rt||at||et){var Nt=et?L.slice(0,8):L;G.push(t.createElement("div",{key:"clipArea",className:Ht("clip-area","snap-control"),style:{width:Ie+"px",height:Oe+"px",transform:"translate("+ge+"px, "+Kt+"px)",clipPath:"polygon("+Nt.map(function(St){return St[0]-ge+"px "+(St[1]-Kt)+"px"}).join(", ")+")"}}))}}return T&&["vertical","horizontal"].forEach(function(wt){var St=T[wt],Ae=wt==="horizontal";St.isSnap&&K.push.apply(K,St.snap.posInfos.map(function(be,jt){var Ft=be.pos,Le=Gt(Je(p,Ae?[0,Ft]:[Ft,0],I),[g,_]),Fe=Gt(Je(p,Ae?[c,Ft]:[Ft,h],I),[g,_]);return Ii(t,"",Le,Fe,s,"clip"+wt+"snap"+jt,"guideline")})),St.isBound&&K.push.apply(K,St.bounds.map(function(be,jt){var Ft=be.pos,Le=Gt(Je(p,Ae?[0,Ft]:[Ft,0],I),[g,_]),Fe=Gt(Je(p,Ae?[c,Ft]:[Ft,h],I),[g,_]);return Ii(t,"",Le,Fe,s,"clip"+wt+"bounds"+jt,"guideline","bounds","bold")}))}),Rt(Rt([],G),K)},dragControlCondition:function(e,t){return t.inputEvent&&(t.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var r=e.props,n=r.dragWithClip,a=n===void 0?!0:n;return a?!1:this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,t)},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var r=e.state,n=e.props,a=n.defaultClipPath,i=n.customClipPath,s=r.target,u=r.width,f=r.height,c=t.inputEvent?t.inputEvent.target:null,h=c&&c.getAttribute("class")||"",p=t.datas,v=qm(s,u,f,a||"inset",i);if(!v)return!1;var g=v.clipText,_=v.type,m=v.poses,b=Et(e,"onClipStart",Zt(e,t,{clipType:_,clipStyle:g,poses:m.map(function(y){return y.pos})}));return b===!1?(p.isClipStart=!1,!1):(p.isControl=h&&h.indexOf("clip-control")>-1,p.isLine=h.indexOf("clip-line")>-1,p.isArea=h.indexOf("clip-area")>-1||h.indexOf("clip-ellipse")>-1,p.index=c?parseInt(c.getAttribute("data-clip-index"),10):-1,p.clipPath=v,p.isClipStart=!0,r.clipPathState=g,ii(e,t),!0)},dragControl:function(e,t){var r,n=t.datas,a=t.originalDatas;if(!n.isClipStart)return!1;var i=n,s=i.isControl,u=i.isLine,f=i.isArea,c=i.index,h=i.clipPath;if(!h)return!1;var p=On(t),v=p[0],g=p[1],_=e.props,m=e.state,b=m.width,y=m.height,w=!f&&!s&&!u,C=h.type,T=h.poses,A=h.splitter,x=T.map(function(jt){return jt.pos});w&&(v=-v,g=-g);var I=!s||T[c].direction==="nesw",B=C==="inset"||C==="rect",P=T.map(function(){return[0,0]});if(s&&!I){var L=T[c],G=L.horizontal,K=L.vertical,at=[v*Math.abs(G),g*Math.abs(K)];P=fut(T,c,at,B)}else I&&(P=x.map(function(){return[v,g]}));var et=x.map(function(jt,Ft){return Vt(jt,P[Ft])}),rt=Rt([],et);m.snapBoundInfos=null;var gt=h.type==="circle",Z=h.type==="ellipse";if(gt||Z){var it=kr(et),ct=Math.abs(it.bottom-it.top),lt=Math.abs(Z?it.right-it.left:ct),dt=et[0][1]+ct,Ut=et[0][0]-lt,Lt=et[0][0]+lt;gt&&(rt.push([Lt,it.bottom]),P.push([1,0])),rt.push([it.left,dt]),P.push([0,1]),rt.push([Ut,it.bottom]),P.push([1,0])}var ve=mw((_.clipHorizontalGuidelines||[]).map(function(jt){return Ze(""+jt,y)}),(_.clipVerticalGuidelines||[]).map(function(jt){return Ze(""+jt,b)}),b,y),bt=[],Nt=[];if(gt||Z)bt=[rt[4][0],rt[2][0]],Nt=[rt[1][1],rt[3][1]];else if(B){var de=[rt[0],rt[2],rt[4],rt[6]],Jt=[P[0],P[2],P[4],P[6]];bt=de.filter(function(jt,Ft){return Jt[Ft][0]}).map(function(jt){return jt[0]}),Nt=de.filter(function(jt,Ft){return Jt[Ft][1]}).map(function(jt){return jt[1]})}else bt=rt.filter(function(jt,Ft){return P[Ft][0]}).map(function(jt){return jt[0]}),Nt=rt.filter(function(jt,Ft){return P[Ft][1]}).map(function(jt){return jt[1]});for(var Tt=[0,0],Ie=function(jt){var Ft=Rm(ve,_.clipTargetBounds&&{left:0,top:0,right:b,bottom:y},bt,Nt,5),Le=Ft.horizontal,Fe=Ft.vertical,Kr=Le.offset,Dr=Fe.offset;if(Le.isBound&&(Tt[1]+=Kr),Fe.isBound&&(Tt[0]+=Dr),(Z||gt)&&P[0][0]===0&&P[0][1]===0){var Kn=kr(et),gr=Kn.bottom-Kn.top,Ea=Z?Kn.right-Kn.left:gr,Ca=Fe.isBound?Math.abs(Dr):Fe.snapIndex===0?-Dr:Dr,Yn=Le.isBound?Math.abs(Kr):Le.snapIndex===0?-Kr:Kr;Ea-=Ca,gr-=Yn,gt&&(gr=bw(Fe,Le)>0?gr:Ea,Ea=gr);var Xn=rt[0];rt[1][1]=Xn[1]-gr,rt[2][0]=Xn[0]+Ea,rt[3][1]=Xn[1]+gr,rt[4][0]=Xn[0]-Ea}else return rt.forEach(function(si,fs){var oi=P[fs];oi[0]&&(si[0]-=Dr),oi[1]&&(si[1]-=Kr)}),"break"},Oe=0;Oe<2;++Oe){var ge=Ie();if(ge==="break")break}var Kt=Sv(e,h,et),wt=C+"("+Kt.join(A)+")";if(m.clipPathState=wt,gt||Z)bt=[rt[4][0],rt[2][0]],Nt=[rt[1][1],rt[3][1]];else if(B){var de=[rt[0],rt[2],rt[4],rt[6]];bt=de.map(function(Ft){return Ft[0]}),Nt=de.map(function(Ft){return Ft[1]})}else bt=rt.map(function(jt){return jt[0]}),Nt=rt.map(function(jt){return jt[1]});if(m.snapBoundInfos=Rm(ve,_.clipTargetBounds&&{left:0,top:0,right:b,bottom:y},bt,Nt,1),a.draggable){var St=m.is3d,Ae=m.allMatrix,be=St?4:3;r=pe(Ae,[Tt[0],Tt[1],0,0],be),Tt[0]=r[0],Tt[1]=r[1],a.draggable.deltaOffset=Tt}return Et(e,"onClip",Zt(e,t,{clipEventType:"changed",clipType:C,poses:et,clipStyle:wt,clipStyles:Kt,distX:v,distY:g})),!0},dragControlEnd:function(e,t){this.unset(e);var r=t.isDrag,n=t.datas,a=t.isDouble,i=n.isLine,s=n.isClipStart,u=n.isControl;return s?(Et(e,"onClipEnd",Pr(e,t,{})),a&&(u?Aft(e,t):i&&Oft(e,t)),a||r):!1},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},Mft={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[`:host[data-able-origindraggable] .control.origin {
|
|
pointer-events: auto;
|
|
}`],dragControlCondition:function(e,t){return t.isRequest?t.requestAble==="originDraggable":tn(t.inputEvent.target,Ht("origin"))},dragControlStart:function(e,t){var r=t.datas;ii(e,t);var n=Zt(e,t,{dragStart:ir.dragStart(e,new So().dragStart([0,0],t))}),a=Et(e,"onDragOriginStart",n);return r.startOrigin=e.state.transformOrigin,r.startTargetOrigin=e.state.targetOrigin,r.prevOrigin=[0,0],r.isDragOrigin=!0,a===!1?(r.isDragOrigin=!1,!1):n},dragControl:function(e,t){var r=t.datas,n=t.isPinch,a=t.isRequest;if(!r.isDragOrigin)return!1;var i=On(t),s=i[0],u=i[1],f=e.state,c=f.width,h=f.height,p=f.offsetMatrix,v=f.targetMatrix,g=f.is3d,_=e.props.originRelative,m=_===void 0?!0:_,b=g?4:3,y=[s,u];if(a){var w=t.distOrigin;(w[0]||w[1])&&(y=w)}var C=Vt(r.startOrigin,y),T=Vt(r.startTargetOrigin,y),A=Gt(y,r.prevOrigin),x=xf(p,v,C,b),I=e.getRect(),B=kr(wo(x,c,h,b)),P=[I.left-B.left,I.top-B.top];r.prevOrigin=y;var L=[Qr(T[0],c,m),Qr(T[1],h,m)].join(" "),G=Zt(e,t,{width:c,height:h,origin:C,dist:y,delta:A,transformOrigin:L,drag:ir.drag(e,Tf(t,e.state,P,!!n,!1))});return Et(e,"onDragOrigin",G),G},dragControlEnd:function(e,t){var r=t.datas;return r.isDragOrigin?(Et(e,"onDragOriginEnd",Pr(e,t,{})),!0):!1},dragGroupControlCondition:function(e,t){return this.dragControlCondition(e,t)},dragGroupControlStart:function(e,t){var r=this.dragControlStart(e,t);return!!r},dragGroupControl:function(e,t){var r=this.dragControl(e,t);return r?(e.transformOrigin=r.transformOrigin,!0):!1},request:function(e){var t={},r=e.getRect(),n=0,a=0,i=r.transformOrigin,s=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(u){return"deltaOrigin"in u?(s[0]+=u.deltaOrigin[0],s[1]+=u.deltaOrigin[1]):"origin"in u?(s[0]=u.origin[0]-i[0],s[1]=u.origin[1]-i[1]):("x"in u?n=u.x-r.left:"deltaX"in u&&(n+=u.deltaX),"y"in u?a=u.y-r.top:"deltaY"in u&&(a+=u.deltaY)),{datas:t,distX:n,distY:a,distOrigin:s}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function Pft(e,t,r,n,a,i,s){var u=Lw(e),f=u.horizontals,c=u.verticals,h=f.length,p=c.length,v=-1,g=-1;r===0?h===0?v=0:h===1&&(v=1):r===3&&(h<=2?v=2:h<=3&&(v=3)),r===2?p===0?g=0:p<4&&(g=3):r===1&&(p<=1?g=1:p<=2&&(g=2)),Bw(e,t,0,v,g,n,a,i,s)}function Um(e,t,r,n,a){n===void 0&&(n=[0,0]);var i,s=[];if(a)i=a;else{var u=dr(e);i=u&&u.borderRadius||""}return!i||!a&&i==="0px"?s=[]:s=da(i),Dw(s,t,r,0,0,n)}function km(e,t,r,n,a,i){var s=e.state,u=s.width,f=s.height,c=wv(i,a,e.props.roundRelative,u,f),h=c.raws,p=c.styles,v=Lw(a,h),g=v.horizontals,_=v.verticals,m=p.join(" ");s.borderRadiusState=m,Et(e,"onRound",Zt(e,t,{horizontals:g,verticals:_,borderRadius:m,width:u,height:f,delta:n,dist:r}))}var xft={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[`.control.border-radius {
|
|
background: #d66;
|
|
cursor: pointer;
|
|
}`,`:host[data-able-roundable] .line.direction {
|
|
cursor: pointer;
|
|
}`],render:function(e,t){var r=e.state,n=r.target,a=r.width,i=r.height,s=r.allMatrix,u=r.is3d,f=r.left,c=r.top,h=r.borderRadiusState,p=e.props,v=p.minRoundControls,g=v===void 0?[0,0]:v,_=p.maxRoundControls,m=_===void 0?[4,4]:_,b=p.zoom;if(!n)return null;var y=u?4:3,w=Um(n,a,i,g,h);if(!w)return null;var C=0,T=0;return w.map(function(A,x){T+=Math.abs(A.horizontal),C+=Math.abs(A.vertical);var I=Gt(Je(s,A.pos,y),[f,c]),B=A.vertical?C<=m[1]:T<=m[0];return t.createElement("div",{key:"borderRadiusControl"+x,className:Ht("control","border-radius"),"data-radius-index":x,style:{display:B?"block":"none",transform:"translate("+I[0]+"px, "+I[1]+"px) scale("+b+")"}})})},dragControlCondition:function(e,t){if(!t.inputEvent||t.isRequest)return!1;var r=t.inputEvent.target.getAttribute("class")||"";return r.indexOf("border-radius")>-1||r.indexOf("moveable-line")>-1&&r.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var r=t.inputEvent,n=t.datas,a=r.target,i=a.getAttribute("class")||"",s=i.indexOf("border-radius")>-1,u=i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1,f=s?parseInt(a.getAttribute("data-radius-index"),10):-1,c=u?parseInt(a.getAttribute("data-line-index"),10):-1;if(!s&&!u)return!1;var h=Et(e,"onRoundStart",Zt(e,t,{}));if(h===!1)return!1;n.lineIndex=c,n.controlIndex=f,n.isControl=s,n.isLine=u,ii(e,t);var p=e.props,v=p.roundRelative,g=p.minRoundControls,_=g===void 0?[0,0]:g,m=e.state,b=m.target,y=m.width,w=m.height;n.isRound=!0,n.prevDist=[0,0];var C=Um(b,y,w,_)||[];return n.controlPoses=C,m.borderRadiusState=wv(C.map(function(T){return T.pos}),C,v,y,w).styles.join(" "),!0},dragControl:function(e,t){var r=t.datas;if(!r.isRound||!r.isControl||!r.controlPoses.length)return!1;var n=r.controlIndex,a=r.controlPoses,i=On(t),s=i[0],u=i[1],f=[s,u],c=Gt(f,r.prevDist),h=e.props.maxRoundControls,p=h===void 0?[4,4]:h,v=e.state,g=v.width,_=v.height,m=a[n],b=m.vertical,y=m.horizontal,w=a.map(function(T){var A=T.horizontal,x=T.vertical,I=[A*y*f[0],x*b*f[1]];if(A){if(p[0]===1)return I;if(p[0]<4&&A!==y)return I}else{if(p[1]===0)return I[1]=x*y*f[0]/g*_,I;if(b){if(p[1]===1)return I;if(p[1]<4&&x!==b)return I}}return[0,0]});w[n]=f;var C=a.map(function(T,A){return Vt(T.pos,w[A])});return r.prevDist=[s,u],km(e,t,f,c,a,C),!0},dragControlEnd:function(e,t){var r=e.state;r.borderRadiusState="";var n=t.datas,a=t.isDouble;if(!n.isRound)return!1;var i=r.width,s=r.height,u=n.isControl,f=n.controlIndex,c=n.isLine,h=n.lineIndex,p=n.controlPoses,v=p.map(function(C){return C.pos}),g=v.length,_=e.props.roundClickable,m=_===void 0?!0:_;if(a&&m){if(u)Rw(p,v,f,0);else if(c){var b=fw(e,t),y=b[0],w=b[1];Pft(p,v,h,y,w,i,s)}g!==p.length&&km(e,t,[0,0],[0,0],p,v)}return Et(e,"onRoundEnd",Pr(e,t,{})),r.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}};function Ift(e,t){var r=t?"matrix3d("+Pe(4):"matrix("+Pe(3)+")";return e===r||e==="matrix(1,0,0,1,0,0)"}var Fw={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},dragRelation:"weak",setTransform:function(e,t){var r=e.state,n=r.is3d,a=r.target,i=r.targetMatrix,s=a==null?void 0:a.style.transform,u=n?"matrix3d("+i.join(",")+")":"matrix("+ky(i,!0)+")",f=!s||s==="none"?u:s;t.datas.startTransforms=Ift(f,n)?[]:da(f)},resetTransform:function(e){e.datas.nextTransforms=e.datas.startTransforms,e.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return Zt(e,t,{setTransform:function(r){t.datas.startTransforms=ni(r)?r:da(r)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return Zt(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),Et(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(t),Et(e,"onBeforeRender",Zt(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){Et(e,"onBeforeRenderEnd",Zt(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var r=this;this.dragStart(e,t);var n=ga(e,"beforeRenderable",t),a=e.moveables,i=n.map(function(s,u){var f=a[u];return r.setTransform(f,s),r.fillDragStartParams(f,s)});Et(e,"onBeforeRenderGroupStart",Zt(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:i}))},dragGroup:function(e,t){var r=this;this.drag(e,t);var n=ga(e,"beforeRenderable",t),a=e.moveables,i=n.map(function(s,u){var f=a[u];return r.resetTransform(s),r.fillDragParams(f,s)});Et(e,"onBeforeRenderGroup",Zt(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:i}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),Et(e,"onBeforeRenderGroupEnd",Zt(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},zw={name:"renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragRelation:"weak",dragStart:function(e,t){Et(e,"onRenderStart",Zt(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){Et(e,"onRender",this.fillDragParams(e,t))},dragAfter:function(e,t){if(t.resultCount)return this.drag(e,t)},dragEnd:function(e,t){Et(e,"onRenderEnd",this.fillDragEndParams(e,t))},dragGroupStart:function(e,t){Et(e,"onRenderGroupStart",Zt(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){var r=this,n=ga(e,"beforeRenderable",t),a=e.moveables,i=n.map(function(s,u){var f=a[u];return r.fillDragParams(f,s)});Et(e,"onRenderGroup",Zt(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,transform:Em(t),events:i}))},dragGroupEnd:function(e,t){var r=this,n=ga(e,"beforeRenderable",t),a=e.moveables,i=n.map(function(s,u){var f=a[u];return r.fillDragEndParams(f,s)});Et(e,"onRenderGroupEnd",Zt(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets,events:i}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlAfter:function(e,t){return this.dragAfter(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)},fillDragParams:function(e,t){return Zt(e,t,{isPinch:!!t.isPinch,transform:Em(t)})},fillDragEndParams:function(e,t){return Zt(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag})}};function Ns(e,t,r,n,a,i,s){var u=a==="Start",f=e.state.target,c=i.isRequest;if(!f||u&&n.indexOf("Control")>-1&&!c&&e.areaElement===i.inputEvent.target)return!1;var h=""+r+n+a,p=""+r+n+"Condition",v=a==="End",g=a==="After",_=u&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());_&&e.updateRect(a,!0,!1),a===""&&!c&&ow(e.state,i);var m=Rt([],e[t]);if(c){var b=i.requestAble;m.some(function(P){return P.name===b})||m.push.apply(m,e.props.ables.filter(function(P){return P.name===b}))}if(!m.length)return!1;var y=Rt(Rt([Fw],m),[zw]).filter(function(P){return P[h]}),w=i.datas;_&&y.forEach(function(P){P.unset&&P.unset(e)});var C=i.inputEvent,T;v&&C&&(T=document.elementFromPoint(i.clientX,i.clientY)||C.target);var A=0,x=y.filter(function(P){var L=P.name,G=w[L]||(w[L]={});if(u&&(G.isEventStart=!P[p]||P[p](e,i)),G.isEventStart){var K=P[h](e,Q(Q({},i),{resultCount:A,datas:G,originalDatas:w,inputTarget:T}));return u&&K===!1&&(G.isEventStart=!1),A+=K?1:0,K}return!1}),I=x.length,B=!1;return u&&y.length&&!I&&(B=y.filter(function(P){var L=P.name,G=w[L];return G.isEventStart?P.dragRelation==="strong"?(G.isEventStart=!1,!1):!0:!1}).length===0),(v||B)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach(function(P){P.state.gesto=null})),_&&B&&y.forEach(function(P){P.unset&&P.unset(e)}),u&&!c&&I&&(i==null||i.preventDefault()),e.isUnmounted||B?!1:((!u&&I&&!s||v)&&(e.updateRect(v?a:"",!0,!1),e.forceUpdate()),!u&&!v&&!g&&I&&!s&&Ns(e,t,r,n,a+"After",i),!0)}function Gw(e,t,r){var n=e.controlBox.getElement(),a=[];a.push(n),(!e.props.dragArea||e.props.dragTarget)&&a.push(t);var i=function(s){var u=s.inputEvent.target,f=e.areaElement;return u===f||!e.isMoveableElement(u)&&!e.controlBox.getElement().contains(u)||tn(u,"moveable-area")||tn(u,"moveable-padding")};return Ev(e,a,"targetAbles",r,{dragStart:i,pinchStart:i})}function Ev(e,t,r,n,a){a===void 0&&(a={});var i=e.props,s=i.pinchOutside,u=i.pinchThreshold,f={preventDefault:!1,container:window,pinchThreshold:u,pinchOutside:s},c=new Aot(t,f);return["drag","pinch"].forEach(function(h){["Start","","End"].forEach(function(p){c.on(""+h+p,function(v){var g=v.eventType;if(a[g]&&!a[g](v)){v.stop();return}var _=Ns(e,r,h,n,p,v);_||v.stop()})})}),c}var Dft=function(){function e(r,n,a){var i=this;this.target=r,this.moveable=n,this.eventName=a,this.ables=[],this.onEvent=function(s){var u=i.eventName,f=i.moveable;f.state.disableNativeEvent||i.ables.forEach(function(c){c[u](f,{inputEvent:s})})},this.target.addEventListener(this.eventName.toLowerCase(),this.onEvent)}var t=e.prototype;return t.setAbles=function(r){this.ables=r},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this.onEvent),this.target=null,this.moveable=null},e}(),Gi=function(e){bo(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state=Q({container:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1},Ah(null)),n.enabledAbles=[],n.targetAbles=[],n.controlAbles=[],n.rotation=0,n.scale=[1,1],n.isUnmounted=!1,n.events={mouseEnter:null,mouseLeave:null},n._prevTarget=null,n._prevDragArea=!1,n._observer=null,n._observerId=0,n.onPreventClick=function(a){a.stopPropagation(),hr(window,"click",n.onPreventClick,!0)},n.checkUpdateRect=function(){if(!n.isDragging()){var a=n.props.parentMoveable;if(a){a.checkUpdateRect();return}Sst(n._observerId),n._observerId=rv(function(){n.isDragging()||n.updateRect()})}},n}var r=t.prototype;return r.render=function(){var n=this.props,a=this.state,i=n.parentPosition,s=n.className,u=n.target,f=n.zoom,c=n.cspNonce,h=n.translateZ,p=n.cssStyled,v=n.portalContainer;this.checkUpdate(),this.updateRenderPoses();var g=i||{left:0,top:0},_=g.left,m=g.top,b=a.left,y=a.top,w=a.target,C=a.direction,T=n.targets,A=(T&&T.length||u)&&w,x=this.isDragging(),I={};return this.getEnabledAbles().forEach(function(B){I["data-able-"+B.name.toLowerCase()]=!0}),Ur(p,Q({cspNonce:c,ref:pn(this,"controlBox"),className:Ht("control-box",C===-1?"reverse":"",x?"dragging":"")+" "+s},I,{onClick:this.onPreventClick,portalContainer:v,style:{position:"absolute",display:A?"block":"none",transform:"translate3d("+(b-_)+"px, "+(y-m)+"px, "+h+")","--zoom":f,"--zoompx":f+"px"}}),this.renderAbles(),this._renderLines())},r.componentDidMount=function(){this.controlBox.getElement();var n=this.props,a=n.parentMoveable,i=n.container,s=n.wrapperMoveable;this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),!i&&!a&&!s&&this.updateRect("",!1,!0),this.updateCheckInput(),this._updateObserver(this.props)},r.componentDidUpdate=function(n){this._updateNativeEvents(),this._updateEvents(),this._updateTargets(),this.updateCheckInput(),this._updateObserver(n)},r.componentWillUnmount=function(){this.isUnmounted=!0,Pi(this,"targetGesto"),Pi(this,"controlGesto");var n=this.events;for(var a in n){var i=n[a];i&&i.destroy()}},r.getContainer=function(){var n=this.props,a=n.parentMoveable,i=n.wrapperMoveable,s=n.container;return s||i&&i.getContainer()||a&&a.getContainer()||this.controlBox.getElement().parentElement},r.isMoveableElement=function(n){return n&&(n.getAttribute("class")||"").indexOf(lv)>-1},r.dragStart=function(n){return this.targetGesto&&this.targetGesto.triggerDragStart(n),this},r.hitTest=function(n){var a=this.state,i=a.target,s=a.pos1,u=a.pos2,f=a.pos3,c=a.pos4,h=a.targetClientRect;if(!i)return 0;var p;if(n instanceof Element){var v=n.getBoundingClientRect();p={left:v.left,top:v.top,width:v.width,height:v.height}}else p=Q({width:0,height:0},n);var g=p.left,_=p.top,m=p.width,b=p.height,y=gm([s,u,c,f],h),w=dot(y,[[g,_],[g+m,_],[g+m,_+b],[g,_+b]]),C=Ky(y);return!w||!C?0:Math.min(100,w/C*100)},r.isInside=function(n,a){var i=this.state,s=i.target,u=i.pos1,f=i.pos2,c=i.pos3,h=i.pos4,p=i.targetClientRect;return s?dh([n,a],gm([u,f,h,c],p)):!1},r.updateRect=function(n,a,i){i===void 0&&(i=!0);var s=this.props,u=s.parentMoveable,f=this.state,c=f.target||this.props.target,h=this.getContainer(),p=u?u.props.rootContainer:s.rootContainer;this.updateState(Ah(this.controlBox&&this.controlBox.getElement(),c,h,h,p||h),u?!1:i)},r.isDragging=function(){return(this.targetGesto?this.targetGesto.isFlag():!1)||(this.controlGesto?this.controlGesto.isFlag():!1)},r.updateTarget=function(n){this.updateRect(n,!0)},r.getRect=function(){var n=this.state,a=Cn(this.state),i=a[0],s=a[1],u=a[2],f=a[3],c=kr(a),h=n.width,p=n.height,v=c.width,g=c.height,_=c.left,m=c.top,b=[n.left,n.top],y=Vt(b,n.origin),w=Vt(b,n.beforeOrigin),C=n.transformOrigin;return{width:v,height:g,left:_,top:m,pos1:i,pos2:s,pos3:u,pos4:f,offsetWidth:h,offsetHeight:p,beforeOrigin:w,origin:y,transformOrigin:C,rotation:this.getRotation()}},r.getManager=function(){return this},r.getRotation=function(){var n=this.state,a=n.pos1,i=n.pos2,s=n.direction;return vut(a,i,s)},r.request=function(n,a,i){a===void 0&&(a={});var s=this.props,u=s.ables,f=s.groupable,c=u.filter(function(b){return b.name===n})[0];if(this.isDragging()||!c||!c.request)return{request:function(){return this},requestEnd:function(){return this}};var h=this,p=c.request(this),v=i||a.isInstant,g=p.isControl?"controlAbles":"targetAbles",_=(f?"Group":"")+(p.isControl?"Control":""),m={request:function(b){return Ns(h,g,"drag",_,"",Q(Q({},p.request(b)),{requestAble:n,isRequest:!0}),v),this},requestEnd:function(){return Ns(h,g,"drag",_,"End",Q(Q({},p.requestEnd()),{requestAble:n,isRequest:!0}),v),this}};return Ns(h,g,"drag",_,"Start",Q(Q({},p.requestStart(a)),{requestAble:n,isRequest:!0}),v),v?m.request(a).requestEnd():m},r.destroy=function(){this.componentWillUnmount()},r.updateRenderPoses=function(){var n=this.state,a=this.props,i=n.originalBeforeOrigin,s=n.transformOrigin,u=n.allMatrix,f=n.is3d,c=n.pos1,h=n.pos2,p=n.pos3,v=n.pos4,g=n.left,_=n.top,m=a.padding||{},b=m.left,y=b===void 0?0:b,w=m.top,C=w===void 0?0:w,T=m.bottom,A=T===void 0?0:T,x=m.right,I=x===void 0?0:x,B=f?4:3,P=a.groupable?i:Vt(i,[g,_]);n.renderPoses=[Vt(c,yu(u,[-y,-C],s,P,B)),Vt(h,yu(u,[I,-C],s,P,B)),Vt(p,yu(u,[-y,A],s,P,B)),Vt(v,yu(u,[I,A],s,P,B))]},r.checkUpdate=function(){var n=this.props,a=n.target,i=n.container,s=n.parentMoveable,u=this.state,f=u.target,c=u.container;if(!(!f&&!a)){this.updateAbles();var h=!Th(f,a)||!Th(c,i);if(!!h){var p=i||this.controlBox;p&&this.unsetAbles(),this.updateState({target:a,container:i}),!s&&p&&this.updateRect("End",!1,!1)}}},r.triggerEvent=function(n,a){var i=this.props[n];return i&&i(a)},r.useCSS=function(n,a){var i=this.props.customStyledMap,s=n+a;return i[s]||(i[s]=Zy(n,a)),i[s]},r.unsetAbles=function(){var n=this;this.targetAbles.forEach(function(a){a.unset&&a.unset(n)})},r.updateAbles=function(n,a){n===void 0&&(n=this.props.ables),a===void 0&&(a="");var i=this.props,s=i.triggerAblesSimultaneously,u=n.filter(function(g){return g&&(g.always&&i[g.name]!==!1||i[g.name])}),f="drag"+a+"Start",c="pinch"+a+"Start",h="drag"+a+"ControlStart",p=bu(u,[f,c],s),v=bu(u,[h],s);this.enabledAbles=u,this.targetAbles=p,this.controlAbles=v},r.updateState=function(n,a){if(a)this.setState(n);else{var i=this.state;for(var s in n)i[s]=n[s]}},r.getEnabledAbles=function(){var n=this.props,a=n.ables;return a.filter(function(i){return i&&n[i.name]})},r.renderAbles=function(){var n=this,a=this.props,i=a.triggerAblesSimultaneously,s={createElement:Ur};return out(uut(bu(this.getEnabledAbles(),["render"],i).map(function(u){var f=u.render;return f(n,s)||[]})).filter(function(u){return u}),function(u){var f=u.key;return f}).map(function(u){return u[0]})},r.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},r._updateObserver=function(n){var a,i=this.props,s=i.target;if(!window.ResizeObserver||!s||!i.useResizeObserver){(a=this._observer)===null||a===void 0||a.disconnect();return}if(!(n.target===s&&this._observer)){var u=new ResizeObserver(this.checkUpdateRect);u.observe(s,{box:"border-box"}),this._observer=u}},r._updateEvents=function(){var n=this.controlBox.getElement(),a=this.targetAbles.length,i=this.controlAbles.length,s=this.props,u=s.dragTarget||s.target,f=!a&&this.targetGesto||this._isTargetChanged(!0);f&&(Pi(this,"targetGesto"),this.updateState({gesto:null})),i||Pi(this,"controlGesto"),u&&a&&!this.targetGesto&&(this.targetGesto=Gw(this,u,"")),!this.controlGesto&&i&&(this.controlGesto=Ev(this,n,"controlAbles","Control"))},r._updateTargets=function(){var n=this.props;this._prevTarget=n.dragTarget||n.target,this._prevDragArea=n.dragArea},r._renderLines=function(){var n=this.props,a=n.edge,i=n.zoom,s=n.hideDefaultLines;if(s)return[];var u=this.state.renderPoses,f={createElement:Ur};return[Ii(f,a?"n":"",u[0],u[1],i,0),Ii(f,a?"e":"",u[1],u[3],i,1),Ii(f,a?"w":"",u[0],u[2],i,2),Ii(f,a?"s":"",u[2],u[3],i,3)]},r._isTargetChanged=function(n){var a=this.props,i=a.dragTarget||a.target,s=this._prevTarget,u=this._prevDragArea,f=a.dragArea,c=!f&&s!==i,h=(n||f)&&u!==f;return c||h},r._updateNativeEvents=function(){var n=this,a=this.props,i=a.dragArea?this.areaElement:this.state.target,s=this.events,u=Iy(s);if(this._isTargetChanged())for(var f in s){var c=s[f];c&&c.destroy(),s[f]=null}if(!!i){var h=this.enabledAbles;u.forEach(function(p){var v=bu(h,[p]),g=v.length>0,_=s[p];if(!g){_&&(_.destroy(),s[p]=null);return}_||(_=new Dft(i,n,p),s[p]=_),_.setAbles(v)})}},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,portalContainer:null,useResizeObserver:!1,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{}},t}(sv),Cv={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var r=e.props.targets||[];e.moveables=[];var n=e.state,a=n.left,i=n.top,s={left:a,top:i},u=e.props;return r.map(function(f,c){return t.createElement(Gi,{key:"moveable"+c,ref:Cy(e,"moveables",c),target:f,origin:!1,cssStyled:u.cssStyled,customStyledMap:u.customStyledMap,useResizeObserver:u.useResizeObserver,parentMoveable:e,parentPosition:s})})}},Rft=yo("clickable",{props:{clickable:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragRelation:"weak",dragStart:function(e,t){t.isRequest||Jr(window,"click",e.onPreventClick,!0)},dragControlStart:function(e,t){this.dragStart(e,t)},dragGroupStart:function(e,t){this.dragStart(e,t),t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){this.endEvent(e);var r=e.state.target,n=t.inputEvent,a=t.inputTarget,i=e.isMoveableElement(a),s=!i&&e.controlBox.getElement().contains(a);if((!t.isDrag||s)&&this.unset(e),!(!n||!a||t.isDrag||e.isMoveableElement(a)||s)){var u=r.contains(a);Et(e,"onClick",Zt(e,t,{isDouble:t.isDouble,inputTarget:a,isTarget:r===a,containsTarget:u}))}},dragGroupEnd:function(e,t){this.endEvent(e);var r=t.inputEvent,n=t.inputTarget;if(!(!r||!n||t.isDrag||e.isMoveableElement(n)||t.datas.inputTarget===n)){var a=e.props.targets,i=a.indexOf(n),s=i>-1,u=!1;i===-1&&(i=nn(a,function(f){return f.contains(n)}),u=i>-1),Et(e,"onClickGroup",Zt(e,t,{isDouble:t.isDouble,targets:a,inputTarget:n,targetIndex:i,isTarget:s,containsTarget:u}))}},dragControlEnd:function(e,t){this.dragEnd(e,t)},dragGroupControlEnd:function(e,t){this.dragEnd(e,t)},endEvent:function(e){var t=this;rv(function(){t.unset(e)})},unset:function(e){hr(window,"click",e.onPreventClick,!0)}});function Si(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),Q(Q({},e),{datas:t})}var Bft=yo("edgeDraggable",{dragControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var r=t.inputEvent.target;return tn(r,Ht("direction"))&&tn(r,Ht("line"))},dragControlStart:function(e,t){return ir.dragStart(e,Si(t))},dragControl:function(e,t){return ir.drag(e,Si(t))},dragControlEnd:function(e,t){return ir.dragEnd(e,Si(t))},dragGroupControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var r=t.inputEvent.target;return tn(r,Ht("direction"))&&tn(r,Ht("line"))},dragGroupControlStart:function(e,t){return ir.dragGroupStart(e,Si(t))},dragGroupControl:function(e,t){return ir.dragGroup(e,Si(t))},dragGroupControlEnd:function(e,t){return ir.dragGroupEnd(e,Si(t))},unset:function(e){return ir.unset(e)}}),Nw={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},Ov=[Fw,xw,lft,dut,ir,Bft,hft,pft,vft,gft,bft,yft,mft,Mft,Tft,xft,Cv,Nw,Rft,Pw,zw],Lft=Ov.reduce(function(e,t){return Q(Q({},e),"events"in t?t.events:{})},{}),Fft=Ov.reduce(function(e,t){return Q(Q({},e),t.props)},{}),zft=lut(Lft),Gft=Object.keys(zft),Nft=Object.keys(Fft);function Eu(e,t){return Math.max.apply(Math,e.map(function(r){var n=r[0],a=r[1],i=r[2],s=r[3];return Math.max(n[t],a[t],i[t],s[t])}))}function Cu(e,t){return Math.min.apply(Math,e.map(function(r){var n=r[0],a=r[1],i=r[2],s=r[3];return Math.min(n[t],a[t],i[t],s[t])}))}function jft(e,t){if(!e.length)return[0,0,0,0];var r=e.map(function(m){var b=m.state;return Cn(b)}),n=Ds,a=Ds,i=0,s=0,u=re(t,Mr);if(u%90){var f=u/180*Math.PI,c=Math.tan(f),h=-1/c,p=[bm,Ds],v=[bm,Ds];r.forEach(function(m){m.forEach(function(b){var y=b[1]-c*b[0],w=b[1]-h*b[0];p[0]=Math.max(p[0],y),p[1]=Math.min(p[1],y),v[0]=Math.max(v[0],w),v[1]=Math.min(v[1],w)})}),p.forEach(function(m){v.forEach(function(b){var y=(b-m)/(c-h),w=c*y+m;n=Math.min(n,y),a=Math.min(a,w)})});var g=r.map(function(m){var b=m[0],y=m[1],w=m[2],C=m[3];return[ua(b,-f),ua(y,-f),ua(w,-f),ua(C,-f)]});i=Eu(g,0)-Cu(g,0),s=Eu(g,1)-Cu(g,1)}else if(n=Cu(r,0),a=Cu(r,1),i=Eu(r,0)-n,s=Eu(r,1)-a,u%180){var _=i;i=s,s=_}return[n,a,i,s]}var qft=function(e){bo(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.differ=new hot,n.moveables=[],n.transformOrigin="50% 50%",n}var r=t.prototype;return r.checkUpdate=function(){this.updateAbles()},r.updateRect=function(n,a,i){if(i===void 0&&(i=!0),!!this.controlBox){this.moveables.forEach(function(at){at.updateRect(n,!1,!1)});var s=this.state,u=this.props,f=s.target||u.target;(!a||n!==""&&u.updateGroup)&&(this.rotation=u.defaultGroupRotate,this.transformOrigin=u.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var c=this.rotation,h=this.scale,p=jft(this.moveables,c),v=p[0],g=p[1],_=p[2],m=p[3],b="rotate("+c+"deg) scale("+(h[0]>=0?1:-1)+", "+(h[1]>=0?1:-1)+")";f.style.cssText+="left:0px;top:0px; transform-origin: "+this.transformOrigin+"; width:"+_+"px; height:"+m+"px;"+("transform:"+b),s.width=_,s.height=m;var y=this.getContainer(),w=Ah(this.controlBox.getElement(),f,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||y),C=[w.left,w.top],T=Cn(w),A=T[0],x=T[1],I=T[2],B=T[3],P=Cf([A,x,I,B]),L=[P.minX,P.minY];w.pos1=Gt(A,L),w.pos2=Gt(x,L),w.pos3=Gt(I,L),w.pos4=Gt(B,L),w.left=v-w.left+L[0],w.top=g-w.top+L[1],w.origin=Gt(Vt(C,w.origin),L),w.beforeOrigin=Gt(Vt(C,w.beforeOrigin),L),w.originalBeforeOrigin=Vt(C,w.originalBeforeOrigin);var G=w.targetClientRect,K=h[0]*h[1]>0?1:-1;G.top+=w.top-s.top,G.left+=w.left-s.left,f.style.transform="translate("+-L[0]+"px, "+-L[1]+"px) "+b,this.updateState(Q(Q({},w),{direction:K,beforeDirection:K}),i)}},r.getRect=function(){return Q(Q({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.triggerEvent=function(n,a,i){if(i||n.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,n,a)},r.updateAbles=function(){e.prototype.updateAbles.call(this,Rt(Rt([],this.props.ables),[Cv]),"Group")},r._updateTargets=function(){e.prototype._updateTargets.call(this),this._prevTarget=this.props.dragTarget||this.areaElement},r._updateEvents=function(){var n=this.state,a=this.props,i=this._prevTarget,s=a.dragTarget||this.areaElement;i!==s&&(Pi(this,"targetGesto"),Pi(this,"controlGesto"),n.target=null),n.target||(n.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=Gw(this,s,"Group"),this.controlGesto=Ev(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var u=!Th(n.container,a.container);u&&(n.container=a.container);var f=this.differ.update(a.targets),c=f.added,h=f.changed,p=f.removed;(u||c.length||h.length||p.length)&&this.updateRect()},r._updateObserver=function(){},t.defaultProps=Q(Q({},Gi.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(Gi),Uft=function(e){bo(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.moveables=[],n}var r=t.prototype;return r.render=function(){var n=this,a=this.props,i=a.cspNonce,s=a.cssStyled,u=a.targets;return Ur(s,{cspNonce:i,ref:pn(this,"controlBox"),className:Ht("control-box")},u.map(function(f,c){return Ur(Gi,Q({key:"moveable"+c,ref:Cy(n,"moveables",c)},n.props,{target:f,wrapperMoveable:n}))}))},r.componentDidUpdate=function(){},r.updateRect=function(n,a,i){i===void 0&&(i=!0),this.moveables.forEach(function(s){s.updateRect(n,a,i)})},r.getRect=function(){return Q(Q({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(n){return n.getRect()})})},r.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},r.dragStart=function(){return this},r.hitTest=function(){return 0},r.isInside=function(){return!1},r.isDragging=function(){return!1},r.updateRenderPoses=function(){},r.checkUpdate=function(){},r.triggerEvent=function(){},r.updateAbles=function(){},r._updateEvents=function(){},r._updateObserver=function(){},t}(Gi),kft=function(e){bo(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.refTargets=[],n.selectorMap={},n}var r=t.prototype;return t.makeStyled=function(){var n={},a=this.getTotalAbles();a.forEach(function(s){var u=s.css;!u||u.forEach(function(f){n[f]=!0})});var i=Iy(n).join(`
|
|
`);this.defaultStyled=Zy("div",ist(lv,qot+i))},t.getTotalAbles=function(){return Rt([xw,Cv,Nw,Pw],this.defaultAbles)},r.render=function(){var n=this.constructor;n.defaultStyled||n.makeStyled();var a=this.props,i=a.ables,s=a.props,u=Fot(a,["ables","props"]),f=this._updateRefs(!0),c=put(f,this.selectorMap),h=c.length>1,p=n.getTotalAbles(),v=Rt(Rt([],p),i||[]),g=Q(Q(Q({},u),s||{}),{ables:v,cssStyled:n.defaultStyled,customStyledMap:n.customStyledMap});return h?u.individualGroupable?Ur(Uft,Q({key:"individual-group",ref:pn(this,"moveable")},g,{target:null,targets:c})):Ur(qft,Q({key:"group",ref:pn(this,"moveable")},g,{target:null,targets:c})):Ur(Gi,Q({key:"single",ref:pn(this,"moveable")},g,{target:c[0]}))},r.componentDidMount=function(){this._updateRefs()},r.componentDidUpdate=function(){this._updateRefs()},r.getManager=function(){return this.moveable},r._updateRefs=function(n){var a=this.refTargets,i=uw(this.props.target||this.props.targets),s=typeof document!="undefined",u=a.length!==i.length||a.some(function(h,p){var v=i[p];return!h&&!v?!1:h!==v}),f=this.selectorMap,c={};return this.refTargets.forEach(function(h){rn(h)&&(!f[h]&&s?(u=!0,c[h]=[].slice.call(document.querySelectorAll(h))):c[h]=f[h])}),this.refTargets=i,this.selectorMap=c,!n&&u&&this.forceUpdate(),i},t.defaultAbles=[],t.customStyledMap={},t.defaultStyled=null,zot([sst(ew)],t.prototype,"moveable",void 0),t}(sv),Hft=function(e){bo(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.defaultAbles=Ov,t}(kft);/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Rh=function(e,t){return Rh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])},Rh(e,t)};function Av(e,t){Rh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var no=function(){return no=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},no.apply(this,arguments)};function Wft(e,t,r,n){var a=arguments.length,i=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(i=(a<3?s(i):a>3?s(t,r,i):s(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i}var Kft=function(e){Av(t,e);function t(n){var a=e.call(this,n)||this;return a.state={},a.state=a.props,a}var r=t.prototype;return r.render=function(){return qst(Ur(Hft,no({ref:pn(this,"moveable")},this.state)),this.state.parentElement)},t}(iv),jw=Nft,qw=ew,Uw=Gft;/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Bh=function(){return Bh=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Bh.apply(this,arguments)};function Yft(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,u=i.length;s<u;s++,a++)n[a]=i[s];return n}var Xft=function(){function e(){this._events={}}var t=e.prototype;return t.on=function(r,n){if(va(r))for(var a in r)this.on(a,r[a]);else this._addEvent(r,n,{});return this},t.off=function(r,n){if(!r)this._events={};else if(va(r))for(var a in r)this.off(a);else if(!n)this._events[r]=[];else{var i=this._events[r];if(i){var s=nn(i,function(u){return u.listener===n});s>-1&&i.splice(s,1)}}return this},t.once=function(r,n){var a=this;return n&&this._addEvent(r,n,{once:!0}),new Promise(function(i){a._addEvent(r,i,{once:!0})})},t.emit=function(r,n){var a=this;n===void 0&&(n={});var i=this._events[r];if(!r||!i)return!0;var s=!1;return n.eventType=r,n.stop=function(){s=!0},n.currentTarget=this,Yft(i).forEach(function(u){u.listener(n),u.once&&a.off(r,u.listener)}),!s},t.trigger=function(r,n){return n===void 0&&(n={}),this.emit(r,n)},t._addEvent=function(r,n,a){var i=this._events;i[r]=i[r]||[];var s=i[r];s.push(Bh({listener:n},a))},e}(),Vft=function(e){Av(t,e);function t(n,a){a===void 0&&(a={});var i=e.call(this)||this;i.tempElement=document.createElement("div");var s=no({},a),u={};Uw.forEach(function(c){u[xy("on "+c)]=function(h){return i.trigger(c,h)}}),vm(Ur(Kft,no({ref:pn(i,"innerMoveable"),parentElement:n},s,u)),i.tempElement);var f=s.target;return ni(f)&&f.length>1&&i.updateRect(),i}var r=t.prototype;return r.setState=function(n,a){this.innerMoveable.setState(n,a)},r.destroy=function(){vm(null,this.tempElement),this.off(),this.tempElement=null,this.innerMoveable=null},r.getMoveable=function(){return this.innerMoveable.moveable},t=Wft([om(qw,function(n,a){n[a]||(n[a]=function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];var u=this.getMoveable();if(!(!u||!u[a]))return u[a].apply(u,i)})}),om(jw,function(n,a){Object.defineProperty(n,a,{get:function(){return this.getMoveable().props[a]},set:function(i){var s;this.setState((s={},s[a]=i,s))},enumerable:!0,configurable:!0})})],t),t}(Xft),Zft=function(e){Av(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Vft);function Jft(e,t,r){const n=Wa();let a={},i,s;PM(()=>{const f=t;a={},jw.forEach(c=>{c in f&&(a[c]=f[c])}),i=a.container||t.container||document.body,s&&DM().then(()=>{s.setState(tc(wi({},a),{container:i,parentElement:i}))})}),xM(()=>{s=new Zft(i||document.body,a),Uw.forEach(f=>{const c=xy(`on ${f}`);s.on(f,h=>{const p=t[c]&&t[c](h),v=n(f,h);return Ha(p)?Ha(v)?void 0:v:p})})}),IM(()=>{s&&s.destroy()});function u(){return s}return e.$$set=f=>{r(5,t=Bt(Bt({},t),Li(f)))},t=Li(t),[u]}class Tc extends Ct{constructor(t){super();Ot(this,t,Jft,null,At,{getInstance:0})}get getInstance(){return this.$$.ctx[0]}}var Qft=(()=>{const e=Tc.prototype;return e&&qw.forEach(t=>{e[t]=function(...r){const n=this.getInstance(),a=n[t](...r);return a===n?this:a}}),Tc})();function tlt(e){let t,r;return t=new Qft({props:{target:e[0],originDraggable:!0,originRelative:!0,draggable:!0,throttleDrag:0,zoom:1,origin:!1,padding:{left:0,top:0,right:0,bottom:0}}}),t.$on("dragOriginStart",e[2]),t.$on("dragOrigin",e[3]),t.$on("dragStart",e[4]),t.$on("drag",e[5]),t.$on("render",e[6]),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,[a]){const i={};a&1&&(i.target=n[0]),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function elt(e,t,r){let{target:n}=t,a={translate:[0,0],rotate:0,transformOrigin:"50% 50%"};const i=({detail:h})=>{h.dragStart&&h.dragStart.set(a.translate)},s=({detail:h})=>{r(1,a.translate=h.drag.beforeTranslate,a),r(1,a.transformOrigin=h.transformOrigin,a)},u=({detail:h})=>{h.set(a.translate)},f=({detail:h})=>{r(1,a.translate=h.beforeTranslate,a)},c=({detail:h})=>{const{translate:p,rotate:v,transformOrigin:g}=a;h.target.style.transformOrigin=g,h.target.style.transform=`translate(${p[0]}px, ${p[1]}px) rotate(${v}deg)`};return e.$$set=h=>{"target"in h&&r(0,n=h.target)},[n,a,i,s,u,f,c]}class Tv extends Ct{constructor(t){super();Ot(this,t,elt,tlt,At,{target:0})}}function Hm(e){let t,r,n,a,i,s=e[2]&&Wm(e);return{c(){t=k("img"),n=ht(),s&&s.c(),a=je(),this.h()},l(u){t=H(u,"IMG",{class:!0,src:!0,alt:!0}),n=pt(u),s&&s.l(u),a=je(),this.h()},h(){F(t,"class","ftl svelte-1kuvs8v"),kn(t.src,r=yn+"/icons/ftl-drive.svg")||F(t,"src",r),F(t,"alt","ftl drive")},m(u,f){q(u,t,f),e[6](t),q(u,n,f),s&&s.m(u,f),q(u,a,f),i=!0},p(u,f){u[2]?s?(s.p(u,f),f&4&&W(s,1)):(s=Wm(u),s.c(),W(s,1),s.m(a.parentNode,a)):s&&(pr(),X(s,1,1,()=>{s=null}),vr())},i(u){i||(W(s),i=!0)},o(u){X(s),i=!1},d(u){u&&M(t),e[6](null),u&&M(n),s&&s.d(u),u&&M(a)}}}function Wm(e){let t,r;return t=new Tv({props:{target:e[3]}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&8&&(i.target=n[3]),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Km(e){let t,r,n,a,i,s=e[2]&&Ym(e);return{c(){t=k("div"),r=mt(e[1]),n=ht(),s&&s.c(),a=je(),this.h()},l(u){t=H(u,"DIV",{class:!0,style:!0});var f=V(t);r=$t(f,e[1]),f.forEach(M),n=pt(u),s&&s.l(u),a=je(),this.h()},h(){F(t,"class","thrust svelte-1kuvs8v"),Ln(t,"background-image","url("+yn+"/icons/standard-drive.svg)")},m(u,f){q(u,t,f),j(t,r),e[7](t),q(u,n,f),s&&s.m(u,f),q(u,a,f),i=!0},p(u,f){(!i||f&2)&&er(r,u[1]),u[2]?s?(s.p(u,f),f&4&&W(s,1)):(s=Ym(u),s.c(),W(s,1),s.m(a.parentNode,a)):s&&(pr(),X(s,1,1,()=>{s=null}),vr())},i(u){i||(W(s),i=!0)},o(u){X(s),i=!1},d(u){u&&M(t),e[7](null),u&&M(n),s&&s.d(u),u&&M(a)}}}function Ym(e){let t,r;return t=new Tv({props:{target:e[5]}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&32&&(i.target=n[5]),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Xm(e){let t,r;return t=new Tv({props:{target:e[4]}}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p(n,a){const i={};a&16&&(i.target=n[4]),t.$set(i)},i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function rlt(e){let t,r,n,a,i,s,u,f=e[0]!=="none"&&Hm(e),c=e[1]>0&&Km(e),h=e[2]&&Xm(e);return{c(){t=k("div"),f&&f.c(),r=ht(),c&&c.c(),n=ht(),a=k("img"),s=ht(),h&&h.c(),this.h()},l(p){t=H(p,"DIV",{class:!0});var v=V(t);f&&f.l(v),r=pt(v),c&&c.l(v),n=pt(v),a=H(v,"IMG",{class:!0,src:!0,alt:!0}),s=pt(v),h&&h.l(v),v.forEach(M),this.h()},h(){F(a,"class","internal svelte-1kuvs8v"),kn(a.src,i=yn+"/icons/internal-systems.svg")||F(a,"src",i),F(a,"alt","internal systems"),F(t,"class","main_systems svelte-1kuvs8v")},m(p,v){q(p,t,v),f&&f.m(t,null),j(t,r),c&&c.m(t,null),j(t,n),j(t,a),e[8](a),j(t,s),h&&h.m(t,null),u=!0},p(p,[v]){p[0]!=="none"?f?(f.p(p,v),v&1&&W(f,1)):(f=Hm(p),f.c(),W(f,1),f.m(t,r)):f&&(pr(),X(f,1,1,()=>{f=null}),vr()),p[1]>0?c?(c.p(p,v),v&2&&W(c,1)):(c=Km(p),c.c(),W(c,1),c.m(t,n)):c&&(pr(),X(c,1,1,()=>{c=null}),vr()),p[2]?h?(h.p(p,v),v&4&&W(h,1)):(h=Xm(p),h.c(),W(h,1),h.m(t,null)):h&&(pr(),X(h,1,1,()=>{h=null}),vr())},i(p){u||(W(f),W(c),W(h),u=!0)},o(p){X(f),X(c),X(h),u=!1},d(p){p&&M(t),f&&f.d(),c&&c.d(),e[8](null),h&&h.d()}}}function nlt(e,t,r){let{ftl:n="none"}=t,{engine:a=0}=t,{movable:i=!1}=t,s,u,f;function c(v){Nn[v?"unshift":"push"](()=>{s=v,r(3,s)})}function h(v){Nn[v?"unshift":"push"](()=>{f=v,r(5,f)})}function p(v){Nn[v?"unshift":"push"](()=>{u=v,r(4,u)})}return e.$$set=v=>{"ftl"in v&&r(0,n=v.ftl),"engine"in v&&r(1,a=v.engine),"movable"in v&&r(2,i=v.movable)},[n,a,i,s,u,f,c,h,p]}class alt extends Ct{constructor(t){super();Ot(this,t,nlt,rlt,At,{ftl:0,engine:1,movable:2})}}function Vm(e,t,r){const n=e.slice();return n[7]=t[r],n[9]=r,n}function Zm(e,t,r){const n=e.slice();return n[10]=t[r],n[12]=r,n}function Jm(e){let t,r;return{c(){t=k("img"),this.h()},l(n){t=H(n,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h(){kn(t.src,r=yn+"/icons/crew-star.svg")||F(t,"src",r),F(t,"alt","crew loss threshold"),F(t,"class","svelte-1uhhjap")},m(n,a){q(n,t,a)},p:se,d(n){n&&M(t)}}}function Qm(e,t){let r,n=t[10]&&Jm();return{key:e,first:null,c(){r=k("div"),n&&n.c(),this.h()},l(a){r=H(a,"DIV",{class:!0});var i=V(r);n&&n.l(i),i.forEach(M),this.h()},h(){F(r,"class","cell svelte-1uhhjap"),this.first=r},m(a,i){q(a,r,i),n&&n.m(r,null)},p(a,i){t=a,t[10]?n?n.p(t,i):(n=Jm(),n.c(),n.m(r,null)):n&&(n.d(1),n=null)},d(a){a&&M(r),n&&n.d()}}}function t$(e,t){let r,n=[],a=new Map,i,s=t[7];const u=f=>f[12];for(let f=0;f<s.length;f+=1){let c=Zm(t,s,f),h=u(c);a.set(h,n[f]=Qm(h,c))}return{key:e,first:null,c(){r=k("div");for(let f=0;f<n.length;f+=1)n[f].c();i=ht(),this.h()},l(f){r=H(f,"DIV",{class:!0});var c=V(r);for(let h=0;h<n.length;h+=1)n[h].l(c);i=pt(c),c.forEach(M),this.h()},h(){F(r,"class","row svelte-1uhhjap"),this.first=r},m(f,c){q(f,r,c);for(let h=0;h<n.length;h+=1)n[h].m(r,null);j(r,i)},p(f,c){t=f,c&1&&(s=t[7],n=Hr(n,c,u,1,t,s,a,r,$a,Qm,i,Zm))},d(f){f&&M(r);for(let c=0;c<n.length;c+=1)n[c].d()}}}function ilt(e){let t,r=[],n=new Map,a=e[0];const i=s=>s[9];for(let s=0;s<a.length;s+=1){let u=Vm(e,a,s),f=i(u);n.set(f,r[s]=t$(f,u))}return{c(){t=k("div");for(let s=0;s<r.length;s+=1)r[s].c()},l(s){t=H(s,"DIV",{});var u=V(t);for(let f=0;f<r.length;f+=1)r[f].l(u);u.forEach(M)},m(s,u){q(s,t,u);for(let f=0;f<r.length;f+=1)r[f].m(t,null)},p(s,[u]){u&1&&(a=s[0],r=Hr(r,u,i,1,s,a,n,t,$a,t$,null,Vm))},i:se,o:se,d(s){s&&M(t);for(let u=0;u<r.length;u+=1)r[u].d()}}}function Lh(e,t){if(t<=1)return[e];let r=e.length/t;return e.length%t&&r++,[e.slice(0,r),...Lh(e.slice(r),t-1)]}function slt(e,t,r){let{shipMass:n=0}=t,{rating:a=0}=t,{advanced:i=!1}=t,s,u,f,c=[];return e.$$set=h=>{"shipMass"in h&&r(1,n=h.shipMass),"rating"in h&&r(2,a=h.rating),"advanced"in h&&r(3,i=h.advanced)},e.$$.update=()=>{e.$$.dirty&8&&r(4,s=i?3:4),e.$$.dirty&4&&r(5,u=Array(a).fill(!1)),e.$$.dirty&2&&r(6,f=Math.ceil(n/20)),e.$$.dirty&96&&r(5,u=Lh(u,f).map(h=>(h[h.length-1]=!0,h)).flat()),e.$$.dirty&48&&r(0,c=Lh(u,s))},[c,n,a,i,s,u,f]}class olt extends Ct{constructor(t){super();Ot(this,t,slt,ilt,At,{shipMass:1,rating:2,advanced:3})}}function e$(e,t,r){const n=e.slice();return n[1]=t[r],n[3]=r,n}function r$(e,t,r){const n=e.slice();return n[4]=t[r],n}function n$(e){let t;return{c(){t=k("div"),this.h()},l(r){t=H(r,"DIV",{class:!0}),V(t).forEach(M),this.h()},h(){F(t,"class","cell svelte-86wmvt")},m(r,n){q(r,t,n)},d(r){r&&M(t)}}}function a$(e,t){let r,n,a=Array.from({length:t[1]}),i=[];for(let s=0;s<a.length;s+=1)i[s]=n$(r$(t,a,s));return{key:e,first:null,c(){r=k("div");for(let s=0;s<i.length;s+=1)i[s].c();n=ht(),this.h()},l(s){r=H(s,"DIV",{class:!0});var u=V(r);for(let f=0;f<i.length;f+=1)i[f].l(u);n=pt(u),u.forEach(M),this.h()},h(){F(r,"class","layer"),this.first=r},m(s,u){q(s,r,u);for(let f=0;f<i.length;f+=1)i[f].m(r,null);j(r,n)},p(s,u){if(t=s,u&1){const f=a.length;a=Array.from({length:t[1]});let c;for(c=f;c<a.length;c+=1)r$(t,a,c),i[c]||(i[c]=n$(),i[c].c(),i[c].m(r,n));for(c=a.length;c<f;c+=1)i[c].d(1);i.length=a.length}},d(s){s&&M(r),qs(i,s)}}}function ult(e){let t,r=[],n=new Map,a=e[0];const i=s=>s[3];for(let s=0;s<a.length;s+=1){let u=e$(e,a,s),f=i(u);n.set(f,r[s]=a$(f,u))}return{c(){t=k("div");for(let s=0;s<r.length;s+=1)r[s].c();this.h()},l(s){t=H(s,"DIV",{class:!0});var u=V(t);for(let f=0;f<r.length;f+=1)r[f].l(u);u.forEach(M),this.h()},h(){F(t,"class","layers svelte-86wmvt")},m(s,u){q(s,t,u);for(let f=0;f<r.length;f+=1)r[f].m(t,null)},p(s,[u]){u&1&&(a=s[0],r=Hr(r,u,i,1,s,a,n,t,$a,a$,null,e$))},i:se,o:se,d(s){s&&M(t);for(let u=0;u<r.length;u+=1)r[u].d()}}}function flt(e,t,r){let{armor:n=[]}=t;return console.log(n),e.$$set=a=>{"armor"in a&&r(0,n=a.armor)},[n]}class llt extends Ct{constructor(t){super();Ot(this,t,flt,ult,At,{armor:0})}}function clt(e){let t,r,n,a,i;return r=new llt({props:{armour:e[0].armour}}),a=new olt({props:{rating:e[0].hull.rating,advanced:e[0].hull.advanced,ship_mass:e[1]}}),{c(){t=k("div"),st(r.$$.fragment),n=ht(),st(a.$$.fragment)},l(s){t=H(s,"DIV",{});var u=V(t);ft(r.$$.fragment,u),n=pt(u),ft(a.$$.fragment,u),u.forEach(M)},m(s,u){q(s,t,u),ot(r,t,null),j(t,n),ot(a,t,null),i=!0},p(s,[u]){const f={};u&1&&(f.armour=s[0].armour),r.$set(f);const c={};u&1&&(c.rating=s[0].hull.rating),u&1&&(c.advanced=s[0].hull.advanced),u&2&&(c.ship_mass=s[1]),a.$set(c)},i(s){i||(W(r.$$.fragment,s),W(a.$$.fragment,s),i=!0)},o(s){X(r.$$.fragment,s),X(a.$$.fragment,s),i=!1},d(s){s&&M(t),ut(r),ut(a)}}}function hlt(e,t,r){let{structure:n={}}=t,{ship_mass:a=0}=t;return e.$$set=i=>{"structure"in i&&r(0,n=i.structure),"ship_mass"in i&&r(1,a=i.ship_mass)},[n,a]}class plt extends Ct{constructor(t){super();Ot(this,t,hlt,clt,At,{structure:0,ship_mass:1})}}function vlt(e){let t,r;return{c(){t=Fn("text"),r=mt(e[0]),this.h()},l(n){t=zn(n,"text",{x:!0,y:!0,class:!0});var a=V(t);r=$t(a,e[0]),a.forEach(M),this.h()},h(){F(t,"x","50%"),F(t,"y","50%"),F(t,"class","svelte-1u8rlr5")},m(n,a){q(n,t,a),j(t,r)},p(n,a){a&1&&er(r,n[0])},d(n){n&&M(t)}}}function dlt(e){let t,r,n;return r=new Sf({props:{selected:e[1],size:"40",$$slots:{default:[vlt]},$$scope:{ctx:e}}}),{c(){t=k("div"),st(r.$$.fragment),this.h()},l(a){t=H(a,"DIV",{class:!0});var i=V(t);ft(r.$$.fragment,i),i.forEach(M),this.h()},h(){F(t,"class","svelte-1u8rlr5")},m(a,i){q(a,t,i),ot(r,t,null),n=!0},p(a,[i]){const s={};i&2&&(s.selected=a[1]),i&5&&(s.$$scope={dirty:i,ctx:a}),r.$set(s)},i(a){n||(W(r.$$.fragment,a),n=!0)},o(a){X(r.$$.fragment,a),n=!1},d(a){a&&M(t),ut(r)}}}function glt(e,t,r){let{weaponClass:n=1}=t,{arcs:a=[]}=t;return e.$$set=i=>{"weaponClass"in i&&r(0,n=i.weaponClass),"arcs"in i&&r(1,a=i.arcs)},[n,a]}class _lt extends Ct{constructor(t){super();Ot(this,t,glt,dlt,At,{weaponClass:0,arcs:1})}}function i$(e,t,r){const n=e.slice();return n[2]=t[r],n}function s$(e){let t,r;const n=[e[2]];let a={};for(let i=0;i<n.length;i+=1)a=Bt(a,n[i]);return t=new _lt({props:a}),{c(){st(t.$$.fragment)},l(i){ft(t.$$.fragment,i)},m(i,s){ot(t,i,s),r=!0},p(i,s){const u=s&1?ne(n,[ue(i[2])]):{};t.$set(u)},i(i){r||(W(t.$$.fragment,i),r=!0)},o(i){X(t.$$.fragment,i),r=!1},d(i){ut(t,i)}}}function mlt(e){let t,r,n,a=e[0],i=[];for(let u=0;u<a.length;u+=1)i[u]=s$(i$(e,a,u));const s=u=>X(i[u],1,1,()=>{i[u]=null});return{c(){t=k("div"),r=k("div");for(let u=0;u<i.length;u+=1)i[u].c();this.h()},l(u){t=H(u,"DIV",{class:!0});var f=V(t);r=H(f,"DIV",{class:!0});var c=V(r);for(let h=0;h<i.length;h+=1)i[h].l(c);c.forEach(M),f.forEach(M),this.h()},h(){F(r,"class","beams svelte-18nuiwu"),F(t,"class","weapons svelte-18nuiwu")},m(u,f){q(u,t,f),j(t,r);for(let c=0;c<i.length;c+=1)i[c].m(r,null);n=!0},p(u,[f]){if(f&1){a=u[0];let c;for(c=0;c<a.length;c+=1){const h=i$(u,a,c);i[c]?(i[c].p(h,f),W(i[c],1)):(i[c]=s$(h),i[c].c(),W(i[c],1),i[c].m(r,null))}for(pr(),c=a.length;c<i.length;c+=1)s(c);vr()}},i(u){if(!n){for(let f=0;f<a.length;f+=1)W(i[f]);n=!0}},o(u){i=i.filter(Boolean);for(let f=0;f<i.length;f+=1)X(i[f]);n=!1},d(u){u&&M(t),qs(i,u)}}}function $lt(e,t,r){let{weapons:n=[]}=t,a=[];return e.$$set=i=>{"weapons"in i&&r(1,n=i.weapons)},e.$$.update=()=>{e.$$.dirty&2&&r(0,a=n.filter(({type:i})=>i==="beam"))},[a,n]}class blt extends Ct{constructor(t){super();Ot(this,t,$lt,mlt,At,{weapons:1})}}function Di(e,t){return t===void 0&&(t=e,e=0),Array.from({length:1+t-e}).map((r,n)=>n+e)}function o$(e,t,r){const n=e.slice();return n[1]=t[r],n}function u$(e){let t,r;return{c(){t=k("img"),this.h()},l(n){t=H(n,"IMG",{class:!0,src:!0,alt:!0}),this.h()},h(){F(t,"class","firecon svelte-d2fjdl"),kn(t.src,r=yn+"/icons/firecon.svg")||F(t,"src",r),F(t,"alt","firecon")},m(n,a){q(n,t,a)},p:se,d(n){n&&M(t)}}}function ylt(e){let t,r=Di(1,e[0]),n=[];for(let a=0;a<r.length;a+=1)n[a]=u$(o$(e,r,a));return{c(){t=k("div");for(let a=0;a<n.length;a+=1)n[a].c();this.h()},l(a){t=H(a,"DIV",{class:!0});var i=V(t);for(let s=0;s<n.length;s+=1)n[s].l(i);i.forEach(M),this.h()},h(){F(t,"class","svelte-d2fjdl")},m(a,i){q(a,t,i);for(let s=0;s<n.length;s+=1)n[s].m(t,null)},p(a,[i]){if(i&1){r=Di(1,a[0]);let s;for(s=0;s<r.length;s+=1){const u=o$(a,r,s);n[s]?n[s].p(u,i):(n[s]=u$(),n[s].c(),n[s].m(t,null))}for(;s<n.length;s+=1)n[s].d(1);n.length=r.length}},i:se,o:se,d(a){a&&M(t),qs(n,a)}}}function wlt(e,t,r){let{firecons:n=0}=t;return e.$$set=a=>{"firecons"in a&&r(0,n=a.firecons)},[n]}class Slt extends Ct{constructor(t){super();Ot(this,t,wlt,ylt,At,{firecons:0})}}function f$(e,t,r){const n=e.slice();return n[2]=t[r],n}function l$(e,t,r){const n=e.slice();return n[2]=t[r],n}function c$(e){let t,r;return{c(){t=k("img"),this.h()},l(n){t=H(n,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h(){kn(t.src,r=yn+"/icons/screen.svg")||F(t,"src",r),F(t,"alt","screen"),F(t,"class","svelte-kh7po5")},m(n,a){q(n,t,a)},p:se,d(n){n&&M(t)}}}function h$(e){let t,r;return{c(){t=k("img"),this.h()},l(n){t=H(n,"IMG",{src:!0,alt:!0,class:!0}),this.h()},h(){kn(t.src,r=yn+"/icons/screen-advanced.svg")||F(t,"src",r),F(t,"alt","advanced screen"),F(t,"class","svelte-kh7po5")},m(n,a){q(n,t,a)},p:se,d(n){n&&M(t)}}}function Elt(e){let t,r,n=Di(1,e[0]),a=[];for(let u=0;u<n.length;u+=1)a[u]=c$(l$(e,n,u));let i=Di(1,e[1]),s=[];for(let u=0;u<i.length;u+=1)s[u]=h$(f$(e,i,u));return{c(){t=k("div");for(let u=0;u<a.length;u+=1)a[u].c();r=ht();for(let u=0;u<s.length;u+=1)s[u].c();this.h()},l(u){t=H(u,"DIV",{class:!0});var f=V(t);for(let c=0;c<a.length;c+=1)a[c].l(f);r=pt(f);for(let c=0;c<s.length;c+=1)s[c].l(f);f.forEach(M),this.h()},h(){F(t,"class","svelte-kh7po5")},m(u,f){q(u,t,f);for(let c=0;c<a.length;c+=1)a[c].m(t,null);j(t,r);for(let c=0;c<s.length;c+=1)s[c].m(t,null)},p(u,[f]){if(f&1){n=Di(1,u[0]);let c;for(c=0;c<n.length;c+=1){const h=l$(u,n,c);a[c]?a[c].p(h,f):(a[c]=c$(),a[c].c(),a[c].m(t,r))}for(;c<a.length;c+=1)a[c].d(1);a.length=n.length}if(f&2){i=Di(1,u[1]);let c;for(c=0;c<i.length;c+=1){const h=f$(u,i,c);s[c]?s[c].p(h,f):(s[c]=h$(),s[c].c(),s[c].m(t,null))}for(;c<s.length;c+=1)s[c].d(1);s.length=i.length}},i:se,o:se,d(u){u&&M(t),qs(a,u),qs(s,u)}}}function Clt(e,t,r){let{standard:n=0}=t,{advanced:a=0}=t;return e.$$set=i=>{"standard"in i&&r(0,n=i.standard),"advanced"in i&&r(1,a=i.advanced)},[n,a]}class Olt extends Ct{constructor(t){super();Ot(this,t,Clt,Elt,At,{standard:0,advanced:1})}}function Alt(e){let t,r,n,a,i;r=new Slt({props:{firecons:e[0]}});const s=[e[1]];let u={};for(let f=0;f<s.length;f+=1)u=Bt(u,s[f]);return a=new Olt({props:u}),{c(){t=k("div"),st(r.$$.fragment),n=ht(),st(a.$$.fragment),this.h()},l(f){t=H(f,"DIV",{class:!0});var c=V(t);ft(r.$$.fragment,c),n=pt(c),ft(a.$$.fragment,c),c.forEach(M),this.h()},h(){F(t,"class","svelte-pscno5")},m(f,c){q(f,t,c),ot(r,t,null),j(t,n),ot(a,t,null),i=!0},p(f,[c]){const h={};c&1&&(h.firecons=f[0]),r.$set(h);const p=c&2?ne(s,[ue(f[1])]):{};a.$set(p)},i(f){i||(W(r.$$.fragment,f),W(a.$$.fragment,f),i=!0)},o(f){X(r.$$.fragment,f),X(a.$$.fragment,f),i=!1},d(f){f&&M(t),ut(r),ut(a)}}}function Tlt(e,t,r){let{firecons:n=0}=t,{screens:a={}}=t;return e.$$set=i=>{"firecons"in i&&r(0,n=i.firecons),"screens"in i&&r(1,a=i.screens)},[n,a]}class Mlt extends Ct{constructor(t){super();Ot(this,t,Tlt,Alt,At,{firecons:0,screens:1})}}function Plt(e){var L,G,K,at,et,rt,gt;let t,r,n,a,i,s,u,f,c,h,p,v,g,_,m,b,y,w,C,T,A,x,I,B,P;return h=new nst({props:{shipClass:e[0].identification.shipClass,shipType:e[0].identification.shipType,cost:(L=e[0].reqs)==null?void 0:L.cost,mass:(G=e[0].reqs)==null?void 0:G.mass}}),g=new plt({props:{structure:e[0].structure,shipMass:e[0].identification.mass}}),m=new Mlt({props:{firecons:e[0].weaponry.firecons.nbr,screens:e[0].structure.screens}}),y=new blt({props:{weapons:e[0].weaponry.weapons}}),C=new alt({props:{movable:e[1],ftl:(at=(K=e[0])==null?void 0:K.propulsion)==null?void 0:at.ftl,engine:(gt=(rt=(et=e[0])==null?void 0:et.propulsion)==null?void 0:rt.drive)==null?void 0:gt.rating}}),{c(){t=k("div"),r=k("label"),n=k("input"),a=mt(" enable wiggletron ("),i=k("i"),s=mt("alpha feature"),u=mt(")"),f=ht(),c=k("div"),st(h.$$.fragment),p=ht(),v=k("div"),st(g.$$.fragment),_=ht(),st(m.$$.fragment),b=ht(),st(y.$$.fragment),w=ht(),st(C.$$.fragment),T=ht(),A=k("div"),x=mt("Printing this page will only prints the ship sheet."),this.h()},l(Z){t=H(Z,"DIV",{class:!0});var it=V(t);r=H(it,"LABEL",{});var ct=V(r);n=H(ct,"INPUT",{type:!0}),a=$t(ct," enable wiggletron ("),i=H(ct,"I",{});var lt=V(i);s=$t(lt,"alpha feature"),lt.forEach(M),u=$t(ct,")"),ct.forEach(M),it.forEach(M),f=pt(Z),c=H(Z,"DIV",{class:!0});var dt=V(c);ft(h.$$.fragment,dt),p=pt(dt),v=H(dt,"DIV",{class:!0});var Ut=V(v);ft(g.$$.fragment,Ut),_=pt(Ut),ft(m.$$.fragment,Ut),Ut.forEach(M),b=pt(dt),ft(y.$$.fragment,dt),w=pt(dt),ft(C.$$.fragment,dt),dt.forEach(M),T=pt(Z),A=H(Z,"DIV",{class:!0});var Lt=V(A);x=$t(Lt,"Printing this page will only prints the ship sheet."),Lt.forEach(M),this.h()},h(){F(n,"type","checkbox"),F(t,"class","notice svelte-ow56hf"),F(v,"class","section-2 svelte-ow56hf"),F(c,"class","print-output svelte-ow56hf"),F(A,"class","notice svelte-ow56hf")},m(Z,it){q(Z,t,it),j(t,r),j(r,n),n.checked=e[1],j(r,a),j(r,i),j(i,s),j(r,u),q(Z,f,it),q(Z,c,it),ot(h,c,null),j(c,p),j(c,v),ot(g,v,null),j(v,_),ot(m,v,null),j(c,b),ot(y,c,null),j(c,w),ot(C,c,null),q(Z,T,it),q(Z,A,it),j(A,x),I=!0,B||(P=ae(n,"change",e[2]),B=!0)},p(Z,[it]){var ve,bt,Nt,de,Jt,Tt,Ie;it&2&&(n.checked=Z[1]);const ct={};it&1&&(ct.shipClass=Z[0].identification.shipClass),it&1&&(ct.shipType=Z[0].identification.shipType),it&1&&(ct.cost=(ve=Z[0].reqs)==null?void 0:ve.cost),it&1&&(ct.mass=(bt=Z[0].reqs)==null?void 0:bt.mass),h.$set(ct);const lt={};it&1&&(lt.structure=Z[0].structure),it&1&&(lt.shipMass=Z[0].identification.mass),g.$set(lt);const dt={};it&1&&(dt.firecons=Z[0].weaponry.firecons.nbr),it&1&&(dt.screens=Z[0].structure.screens),m.$set(dt);const Ut={};it&1&&(Ut.weapons=Z[0].weaponry.weapons),y.$set(Ut);const Lt={};it&2&&(Lt.movable=Z[1]),it&1&&(Lt.ftl=(de=(Nt=Z[0])==null?void 0:Nt.propulsion)==null?void 0:de.ftl),it&1&&(Lt.engine=(Ie=(Tt=(Jt=Z[0])==null?void 0:Jt.propulsion)==null?void 0:Tt.drive)==null?void 0:Ie.rating),C.$set(Lt)},i(Z){I||(W(h.$$.fragment,Z),W(g.$$.fragment,Z),W(m.$$.fragment,Z),W(y.$$.fragment,Z),W(C.$$.fragment,Z),I=!0)},o(Z){X(h.$$.fragment,Z),X(g.$$.fragment,Z),X(m.$$.fragment,Z),X(y.$$.fragment,Z),X(C.$$.fragment,Z),I=!1},d(Z){Z&&M(t),Z&&M(f),Z&&M(c),ut(h),ut(g),ut(m),ut(y),ut(C),Z&&M(T),Z&&M(A),B=!1,P()}}}function xlt(e,t,r){let{ship:n={}}=t,a=!1;function i(){a=this.checked,r(1,a)}return e.$$set=s=>{"ship"in s&&r(0,n=s.ship)},[n,a,i]}class Ilt extends Ct{constructor(t){super();Ot(this,t,xlt,Plt,At,{ship:0})}}function Dlt(e){let t,r,n,a,i,s,u,f,c,h,p,v,g,_,m,b;return a=new gnt({}),s=new Mnt({}),s.$on("changeTab",e[3]),c=new Hit({}),v=new Yit({}),m=new Ilt({props:{ship:e[1]}}),{c(){t=k("meta"),r=ht(),n=k("main"),st(a.$$.fragment),i=ht(),st(s.$$.fragment),u=ht(),f=k("div"),st(c.$$.fragment),h=ht(),p=k("div"),st(v.$$.fragment),g=ht(),_=k("div"),st(m.$$.fragment),this.h()},l(y){const w=RM('[data-svelte="svelte-wq1q9u"]',document.head);t=H(w,"META",{name:!0,content:!0}),w.forEach(M),r=pt(y),n=H(y,"MAIN",{class:!0});var C=V(n);ft(a.$$.fragment,C),i=pt(C),ft(s.$$.fragment,C),u=pt(C),f=H(C,"DIV",{class:!0});var T=V(f);ft(c.$$.fragment,T),T.forEach(M),h=pt(C),p=H(C,"DIV",{class:!0});var A=V(p);ft(v.$$.fragment,A),A.forEach(M),g=pt(C),_=H(C,"DIV",{class:!0});var x=V(_);ft(m.$$.fragment,x),x.forEach(M),C.forEach(M),this.h()},h(){F(t,"name","viewport"),F(t,"content","width=960"),F(f,"class","svelte-khn038"),Me(f,"hide",e[0]!=="editor"),F(p,"class","svelte-khn038"),Me(p,"hide",e[0]!=="json"),F(_,"class","svelte-khn038"),Me(_,"hide",e[0]!=="print"),F(n,"class","svelte-khn038")},m(y,w){j(document.head,t),q(y,r,w),q(y,n,w),ot(a,n,null),j(n,i),ot(s,n,null),j(n,u),j(n,f),ot(c,f,null),j(n,h),j(n,p),ot(v,p,null),j(n,g),j(n,_),ot(m,_,null),b=!0},p(y,[w]){w&1&&Me(f,"hide",y[0]!=="editor"),w&1&&Me(p,"hide",y[0]!=="json");const C={};w&2&&(C.ship=y[1]),m.$set(C),w&1&&Me(_,"hide",y[0]!=="print")},i(y){b||(W(a.$$.fragment,y),W(s.$$.fragment,y),W(c.$$.fragment,y),W(v.$$.fragment,y),W(m.$$.fragment,y),b=!0)},o(y){X(a.$$.fragment,y),X(s.$$.fragment,y),X(c.$$.fragment,y),X(v.$$.fragment,y),X(m.$$.fragment,y),b=!1},d(y){M(t),y&&M(r),y&&M(n),ut(a),ut(s),ut(c),ut(v),ut(m)}}}function Rlt(e,t,r){let n,a="editor";const{state:i}=Ne("ship");ao(e,i,u=>r(1,n=u));const s=({detail:u})=>r(0,a=u);return e.$$.update=()=>{e.$$.dirty&1&&console.log(a)},[a,n,i,s]}class Blt extends Ct{constructor(t){super();Ot(this,t,Rlt,Dlt,At,{})}}function Llt(e){let t,r;return t=new Blt({}),{c(){st(t.$$.fragment)},l(n){ft(t.$$.fragment,n)},m(n,a){ot(t,n,a),r=!0},p:se,i(n){r||(W(t.$$.fragment,n),r=!0)},o(n){X(t.$$.fragment,n),r=!1},d(n){ut(t,n)}}}function Flt(e){return Mc("ship",tnt()),[]}class jlt extends Ct{constructor(t){super();Ot(this,t,Flt,Llt,At,{})}}export{jlt as default};
|