@byteluck-fe/model-driven-engine 2.23.0-beta.1 → 2.23.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,27 +1,27 @@
1
- var V1=Object.defineProperty,H1=Object.defineProperties;var z1=Object.getOwnPropertyDescriptors;var Lo=Object.getOwnPropertySymbols,W1=Object.getPrototypeOf,Z1=Object.prototype.hasOwnProperty,J1=Object.prototype.propertyIsEnumerable,G1=Reflect.get;var jn=Math.pow,ko=(W,ue,ce)=>ue in W?V1(W,ue,{enumerable:!0,configurable:!0,writable:!0,value:ce}):W[ue]=ce,ie=(W,ue)=>{for(var ce in ue||(ue={}))Z1.call(ue,ce)&&ko(W,ce,ue[ce]);if(Lo)for(var ce of Lo(ue))J1.call(ue,ce)&&ko(W,ce,ue[ce]);return W},tu=(W,ue)=>H1(W,z1(ue));var qo=(W,ue,ce)=>G1(W1(W),ce,ue);var ze=(W,ue,ce)=>new Promise((Ln,tn)=>{var kn=We=>{try{Tt(ce.next(We))}catch(jt){tn(jt)}},qn=We=>{try{Tt(ce.throw(We))}catch(jt){tn(jt)}},Tt=We=>We.done?Ln(We.value):Promise.resolve(We.value).then(kn,qn);Tt((ce=ce.apply(W,ue)).next())});(function(W,ue){typeof exports=="object"&&typeof module!="undefined"?ue(exports,require("crypto")):typeof define=="function"&&define.amd?define(["exports","crypto"],ue):(W=typeof globalThis!="undefined"?globalThis:W||self,ue(W.modelDrivenEngine={},W.require$$0))})(this,function(W,ue){"use strict";function ce(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var Ln=ce(ue),tn="\u8BF7\u8F93\u5165\u4E00\u4E2A\u6570\u5B57",kn="\u8BF7\u8F93\u5165\u4E00\u4E2A\u5B57\u7B26\u4E32",qn="\u8BF7\u8F93\u5165\u4E00\u4E2A\u5BF9\u8C61",Tt="\u8BF7\u8F93\u5165\u4E00\u4E2A\u6570\u7EC4",We="\u8BF7\u8F93\u5165\u4E00\u4E2A\u5E03\u5C14",jt="{caption}\u5FC5\u586B",Uo="\u8BF7\u8F93\u5165\u6807\u9898",Vo="\u8BF7\u8F93\u5165\u6C14\u6CE1\u63D0\u793A\u8BED",Ho="\u8BF7\u8F93\u5165\u884C\u6807\u9898",zo="\u8BF7\u8F93\u5165\u63D0\u793A\u6587\u5B57",Wo="\u8BF7\u7ED1\u5B9A\u6570\u636E\u9879",Zo="\u8BF7\u7ED1\u5B9A\u8868\u5355",Jo="\u8BF7\u7ED1\u5B9A\u5217\u8868",Go="\u8BF7\u7ED1\u5B9A\u6D41\u7A0B",Xo="\u8BF7\u8F93\u5165\u663E\u793A\u503C",Ko="\u8BF7\u8F93\u5165\u5B58\u50A8\u503C",Qo="\u5355\u636E\u7F16\u53F7\u672A\u7ED1\u5B9A\u6570\u636E\u9879",Yo="\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u663E\u793A\u5B57\u6BB5\uFF01",ea="\u8BF7\u8F93\u5165\u5927\u4E8E\u7B49\u4E8E{min}\u4E14\u5C0F\u4E8E\u7B49\u4E8E{max}\u7684\u6570\u503C",ta="\u8BF7\u8F93\u5165\u5927\u4E8E\u7B49\u4E8E{min}\u7684\u6570\u503C",na="\u8BF7\u8F93\u5165\u5C0F\u4E8E\u7B49\u4E8E{max}\u7684\u6570\u503C",ra="\u6570\u503C\u8303\u56F4\u8BBE\u7F6E\u6709\u8BEF",ua="\u8BF7\u8F93\u5165\u957F\u5EA6\u5927\u4E8E\u7B49\u4E8E{min}\u4E14\u5C0F\u4E8E\u7B49\u4E8E{max}\u7684\u503C",ia="\u9644\u4EF6\u5927\u5C0F\u5FC5\u987B\u57280MB\u81F31000MB\u4E4B\u95F4",oa="\u8BF7\u586B\u5199\u603B\u5206\u8BBE\u7F6E",aa="\u603B\u5206\u4E0D\u80FD\u5C0F\u4E8E1",sa="\u9ED8\u8BA4\u503C\u5FC5\u987B\u5728{min}\u548C{max}\u4E4B\u95F4",ca="\u9644\u4EF6\u4E0A\u4F20\u7684\u6570\u91CF\u8D85\u8FC7\u4E86\u9650\u5236",la="\u8BF7\u91CD\u65B0\u9009\u62E9\u53EF\u9009\u6570\u91CF",fa="\u8BE5\u63A7\u4EF6\u6700\u5927\u957F\u5EA6\u9700\u5927\u4E8E\u6700\u5C0F\u957F\u5EA6",da="\u8BE5\u63A7\u4EF6\u6700\u5C0F\u957F\u5EA6\u9700\u5C0F\u4E8E\u6700\u5927\u957F\u5EA6",ha="\u8BF7\u9009\u62E9\u6B63\u786E\u7684\u9009\u9879\u8BBE\u7F6E",pa="\u9009\u9879ID\u4E0D\u80FD\u91CD\u590D",Da="\u8BF7\u8F93\u5165\u81F3\u5C11\u4E00\u6761\u9009\u9879",ga="\u8BF7\u7ED1\u5B9A\u4E1A\u52A1\u6A21\u578B",va="\u8BF7\u7ED1\u5B9A\u5B58\u50A8\u503C",ya="\u8BF7\u7ED1\u5B9A\u670D\u52A1",ma="\u81F3\u5C11\u7ED1\u5B9A\u4E00\u4E2A\u663E\u793A\u503C",Ea="\u8BF7\u9009\u62E9\u7701",Aa="\u8BF7\u9009\u62E9\u5E02",Ca="\u8BF7\u9009\u62E9\u533A",Fa="\u6700\u5C11\u586B\u5199\u884C\u6570\u4E0D\u80FD\u5C0F\u4E8E0",wa="\u884C\u6570\u91CF\u4E0D\u80FD\u5C0F\u4E8E{min}\u884C",ba="\u8BF7\u8F93\u5165\u5217\u5BBD",Ba="\u8BF7\u8BBE\u7F6E\u6240\u6709\u89C4\u5219\u6761\u4EF6\u7684\u903B\u8F91\u5173\u7CFB",_a="\u8BF7\u5C06\u6240\u6709\u89C4\u5219\u6761\u4EF6\u586B\u5199\u5B8C\u6574",Sa="\u8BF7\u9009\u62E9\u63A7\u4EF6",Ma="\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u663E\u793A\u5B57\u6BB5",Ia="\u8BF7\u9009\u62E9\u56DE\u586B\u8BBE\u7F6E",Na="\u8BF7\u9009\u62E9\u4EEA\u8868\u76D8",Oa="\u8BF7\u9009\u62E9\u6839\u8282\u70B9",xa="\u89C6\u56FE\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",Ra="\u8BF7\u9009\u62E9\u8BC6\u522B\u7C7B\u578B",$a="\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u5B57\u6BB5\u8FDB\u884C\u586B\u5145",Pa="\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A",Ta="\u8BF7\u8F93\u5165\u6309\u94AE\u6807\u9898",ja="\u8BF7\u5728\u6570\u636E\u8BBE\u7F6E\u4E2D\u7ED1\u5B9A\u4E1A\u52A1\u6A21\u578B",La="\u8BF7\u5728\u6570\u636E\u8BBE\u7F6E\u4E2D\u7ED1\u5B9A\u5B58\u50A8\u503C",ka="\u8BF7\u5728\u6570\u636E\u8BBE\u7F6E\u4E2D\u7ED1\u5B9A\u670D\u52A1",qa="\u8BF7\u5728\u6570\u636E\u8BBE\u7F6E\u4E2D\u81F3\u5C11\u7ED1\u5B9A\u4E00\u4E2A\u663E\u793A\u503C",Ua="\u8BF7\u5728\u6570\u636E\u8BBE\u7F6E\u4E2D\u9009\u62E9\u6839\u8282\u70B9",Va="\u8BF7\u8F93\u5165\u6700\u5927\u9AD8\u5EA6",Ha="\u8F93\u5165\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",za="\u6C34\u5370\u4E0D\u80FD\u4E3A\u7A7A",Wa="\u6587\u4EF6\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",Za="\u8BF7\u81F3\u5C11\u4E0A\u4F20\u4E00\u4E2A\u6253\u5370\u6A21\u7248\uFF01",Ja="\u8BF7\u9009\u62E9\u6307\u5B9A\u4E1A\u52A1\u90E8\u95E8",Ga="\u8BF7\u9009\u62E9\u6307\u5B9A\u5916\u90E8\u7EC4\u7EC7",Xa="\u8BF7\u8F93\u5165\u5B50\u8868\u522B\u540D",Ka="\u8BF7\u9009\u62E9\u5173\u8054\u8868\u8BBE\u7F6E\u4E1A\u52A1\u6A21\u578B",Qa="\u8BF7\u9009\u62E9\u5173\u8054\u8868\u8BBE\u7F6E\u7ED1\u5B9A\u670D\u52A1",Ya="\u8BF7\u9009\u62E9\u5173\u8054\u5B50\u8868\u5B57\u6BB5",es="\u8BF7\u9009\u62E9\u5173\u8054\u4E3B\u8868\u5B57\u6BB5",ts="\u8BF7\u9009\u62E9\u6392\u5E8F\u5B57\u6BB5",ns={isNotNumber:tn,isNotString:kn,isNotObject:qn,isNotArray:Tt,isNotBoolean:We,runtimeRequired:jt,pleaseEnterCaption:Uo,pleaseEnterCaptionTip:Vo,pleaseEnterRowCaption:Ho,pleaseEnterPlaceholder:zo,pleaseEnterFieldCode:Wo,pleaseEnterForm:Zo,pleaseEnterList:Jo,pleaseEnterProcess:Go,pleaseEnterLabel:Xo,pleaseEnterValue:Ko,bizKeyNotBindFiled:Qo,pleaseSelectOneField:Yo,pleaseEnterNumberRange:ea,pleaseEnterAValueGreaterThanMin:ta,pleaseEnterAValueLessThanMax:na,numberRangeSetError:ra,stringRangeError:ua,attachmentMaxSize:ia,pleaseEnterTotalScoreSetting:oa,theTotalScoreMustNotBeLessThan1:aa,scoreDefaultValueRange:sa,attachmentLimitError:ca,PleaseReselectTheOptionalQuantity:la,TheMaximumLengthIsGreaterThanTheMinimumLength:fa,TheMinimumLengthIsGreaterThanTheMaximumLength:da,PleaseSelectTheCorrectOptionSettings:ha,optionIdIsRepeat:pa,optionIsRequired:Da,pleaseEnterDataCode:ga,pleaseEnterValueFieldCode:va,pleaseEnterSvcCode:ya,pleaseBindAtLeastOneDisplayValue:ma,pleaseSelectProvince:Ea,pleaseSelectCity:Aa,pleaseSelectDistrict:Ca,limitRowsCannotBeLessThan0:Fa,TheNumberOfRowsCannotBeLessThanMinRows:wa,pleaseEnterColumnWidth:ba,pleaseSetTheLogicalRelationshipOfAllRuleConditions:Ba,pleaseCompleteAllRulesAndConditions:_a,pleaseSelectControl:Sa,pleaseSelectAtLeastOneColumn:Ma,pleaseSelectFillBackMode:Ia,pleaseSelectDashboard:Na,rootNodeIsRequired:Oa,theViewNameCannotBeEmpty:xa,pleaseSelectOcrType:Ra,pleaseSelectAtLeastOneFieldToFillIn:$a,pleaseChooseAtLeastOne:Pa,pleaseEnterButtonContent:Ta,pleaseEnterDataCodeInDataSetting:ja,pleaseEnterValueFieldCodeInDataSetting:La,pleaseEnterSvcCodeInDataSetting:ka,pleaseBindAtLeastOneDisplayValueInDataSetting:qa,rootNodeIsRequiredInDataSetting:Ua,pleaseEnterMaxHeight:Va,pleaseEnter:Ha,pleaseEnterWatermark:za,pleaseEnterFileName:Wa,pleaseUploadAtLeastOnePrintTemplate:Za,pleaseAssignBusiness:Ja,pleaseAssignExternal:Ga,pleaseEnterAliasCode:Xa,pleaseSelectDataCode:Ka,pleaseSelectSvcCode:Qa,pleaseSelectJoinFieldCode:Ya,pleaseSelectMainFieldCode:es,pleaseSelectSortFieldCode:ts},rs="Please enter a number",us="Please enter a string",is="Please enter an object",os="Please enter an array",as="Please enter a boolean",ss="{caption} Required",cs="Please enter the title",ls="Please enter the bubble prompt",fs="Please enter the row title",ds="Please enter the prompt text",hs="Please bind data items",ps="Please bind the form",Ds="Please bind the list",gs="Please bind the process",vs="Please enter the displayed value",ys="Please enter the stored value",ms="The document number is not bound to the data item",Es="Please select at least one display field",As="Please enter a value greater than or equal to {min} and less than or equal to {max}",Cs="Please enter a value greater than or equal to {min}",Fs="Please enter a value less than or equal to {max}",ws="The value range is set incorrectly",bs="Please enter a value with a length greater than or equal to {min} and less than or equal to {max}",Bs="The attachment size must be between 0MB and 1000MB",_s="Please fill in the total score setting",Ss="The total score cannot be less than 1",Ms="The default value must be between {min} and {max}",Is="The number of attachment uploads exceeds the limit",Ns="Please re-select the optional quantity",Os="The maximum length of the control must be greater than the minimum length",xs="The minimum length of the control must be less than the maximum length",Rs="Please select the correct option setting",$s="Option ID cannot be repeated",Ps="Please enter at least one option",Ts="Please bind the data source",js="Please bind the stored value",Ls="Please bind the service",ks="At least one display value must be bound",qs="Please select a province",Us="Please select a city",Vs="Please select a district",Hs="The minimum number of lines to fill in cannot be less than 0",zs="The number of rows cannot be less than {min} rows",Ws="Please enter the column width",Zs="Please set the logical relationship of all rule conditions",Js="Please complete all rules and conditions",Gs="please select control",Xs="Please select the dashboard",Ks="View name cannot be empty",Qs="Please select recognition type",Ys="Please select at least one field to fill in",ec="Please select at least one",tc="Please enter the button title",nc="Please bind the business model in the data settings",rc="Please bind storage values in data settings",uc="Please bind the service in the data settings",ic="Please bind at least one display value in the data settings",oc="Please select the root node in the data settings",ac="Please enter the maximum height",sc="The input content cannot be empty",cc="Watermark cannot be empty",lc="File name cannot be empty",fc="Please upload at least one printing template!\uFF01",dc="Please select a specific business department",hc="Please select a specified external organization",pc="Please enter a sub table alias",Dc="Please select the associated table to set the business model",gc="Please select the association table to set the binding service",vc="Select associated sub table fields",yc="Please select the associated main table field",mc="Please select the sort field",Ec={isNotNumber:rs,isNotString:us,isNotObject:is,isNotArray:os,isNotBoolean:as,runtimeRequired:ss,pleaseEnterCaption:cs,pleaseEnterCaptionTip:ls,pleaseEnterRowCaption:fs,pleaseEnterPlaceholder:ds,pleaseEnterFieldCode:hs,pleaseEnterForm:ps,pleaseEnterList:Ds,pleaseEnterProcess:gs,pleaseEnterLabel:vs,pleaseEnterValue:ys,bizKeyNotBindFiled:ms,pleaseSelectOneField:Es,pleaseEnterNumberRange:As,pleaseEnterAValueGreaterThanMin:Cs,pleaseEnterAValueLessThanMax:Fs,numberRangeSetError:ws,stringRangeError:bs,attachmentMaxSize:Bs,pleaseEnterTotalScoreSetting:_s,theTotalScoreMustNotBeLessThan1:Ss,scoreDefaultValueRange:Ms,attachmentLimitError:Is,PleaseReselectTheOptionalQuantity:Ns,TheMaximumLengthIsGreaterThanTheMinimumLength:Os,TheMinimumLengthIsGreaterThanTheMaximumLength:xs,PleaseSelectTheCorrectOptionSettings:Rs,optionIdIsRepeat:$s,optionIsRequired:Ps,pleaseEnterDataCode:Ts,pleaseEnterValueFieldCode:js,pleaseEnterSvcCode:Ls,pleaseBindAtLeastOneDisplayValue:ks,pleaseSelectProvince:qs,pleaseSelectCity:Us,pleaseSelectDistrict:Vs,limitRowsCannotBeLessThan0:Hs,TheNumberOfRowsCannotBeLessThanMinRows:zs,pleaseEnterColumnWidth:Ws,pleaseSetTheLogicalRelationshipOfAllRuleConditions:Zs,pleaseCompleteAllRulesAndConditions:Js,pleaseSelectControl:Gs,pleaseSelectDashboard:Xs,theViewNameCannotBeEmpty:Ks,pleaseSelectOcrType:Qs,pleaseSelectAtLeastOneFieldToFillIn:Ys,pleaseChooseAtLeastOne:ec,pleaseEnterButtonContent:tc,pleaseEnterDataCodeInDataSetting:nc,pleaseEnterValueFieldCodeInDataSetting:rc,pleaseEnterSvcCodeInDataSetting:uc,pleaseBindAtLeastOneDisplayValueInDataSetting:ic,rootNodeIsRequiredInDataSetting:oc,pleaseEnterMaxHeight:ac,pleaseEnter:sc,pleaseEnterWatermark:cc,pleaseEnterFileName:lc,pleaseUploadAtLeastOnePrintTemplate:fc,pleaseAssignBusiness:dc,pleaseAssignExternal:hc,pleaseEnterAliasCode:pc,pleaseSelectDataCode:Dc,pleaseSelectSvcCode:gc,pleaseSelectJoinFieldCode:vc,pleaseSelectMainFieldCode:yc,pleaseSelectSortFieldCode:mc},Ac="\u6570\u5B57\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Cc="\u6587\u5B57\u5217\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Fc="\u5BFE\u8C61\u7269\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",wc="\u6570\u5B57\u7D44\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",bc="\u30D6\u30FC\u30EB\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Bc="{caption}\u5FC5\u9808",_c="\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Sc="\u6C17\u6CE1\u306E\u30D2\u30F3\u30C8\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",Mc="\u884C\u30D8\u30C3\u30C0\u30FC\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",Ic="\u30D2\u30F3\u30C8\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Nc="\u30C7\u30FC\u30BF\u3092\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",Oc="\u30B7\u30FC\u30C8\u3092\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",xc="\u30EA\u30B9\u30C8\u3092\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",Rc="\u30D5\u30ED\u30FC\u3092\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",$c="\u8868\u793A\u5024\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Pc="\u4FDD\u5B58\u5024\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",Tc="\u30B7\u30FC\u30C8\u756A\u53F7\u304C\u30C7\u30FC\u30BF\u306B\u30EA\u30F3\u30AF\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",jc="\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u8868\u793A\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",Lc="{min}\u4EE5\u4E0A{max}\u4EE5\u4E0B\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",kc="{min}\u4EE5\u4E0A\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",qc="{max}\u672A\u6E80\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",Uc="\u6570\u5024\u7BC4\u56F2\u8A2D\u5B9A\u30A8\u30E9\u30FC",Vc="\u9577\u3055\u304C{min}\u4EE5\u4E0A{max}\u4EE5\u4E0B\u306E\u5024\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",Hc="\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306F0MB\u304B\u30891000MB\u306E\u9593\u3067\u304A\u9858\u3044\u3057\u307E\u3059\u3002",zc="\u30C8\u30FC\u30BF\u30EB\u70B9\u6570\u3092\u8A2D\u5B9A\u3057\u3066\u4E0B\u3055\u3044",Wc="\u30C8\u30FC\u30BF\u30EB\u70B9\u6570\u306F\uFF11\u4EE5\u4E0A\u3067\u304A\u9858\u3044\u3057\u307E\u3059\u3002",Zc="\u57FA\u672C\u8A2D\u5B9A\u5024\u306F{min}\u304B\u3089{max}\u306E\u9593\u3067\u304A\u9858\u3044\u3057\u307E\u3059\u3002",Jc="\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u6570\u304C\u5236\u9650\u3092\u8D85\u3048\u3066\u3044\u307E\u3059",Gc="\u6570\u91CF\u3092\u518D\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044",Xc="\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u6700\u5927\u5024\u306F\u6700\u5C0F\u5024\u3088\u308A\u5927\u304D\u304F\u8A2D\u5B9A\u3057\u3066\u4E0B\u3055\u3044",Kc="\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u6700\u5C0F\u5024\u306F\u6700\u5927\u5024\u3088\u308A\u5927\u304D\u304F\u8A2D\u5B9A\u3057\u3066\u4E0B\u3055\u3044",Qc="\u6B63\u78BA\u306A\u8A2D\u5B9A\u5024\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044",Yc="ID\u306F\u91CD\u8907\u3057\u306A\u3044\u3088\u3046\u306B\u304A\u9858\u3044\u3057\u307E\u3059",el="\u6700\u4F4E\uFF11\u70B9\u3092\u9078\u3076\u3088\u3046\u306B\u304A\u9858\u3044\u3057\u307E\u3059",tl="\u5143\u30C7\u30FC\u30BF\u306B\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",nl="\u4FDD\u5B58\u5024\u306B\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",rl="\u30B5\u30FC\u30D3\u30B9\u306B\u30EA\u30F3\u30AF\u3057\u3066\u4E0B\u3055\u3044",ul="\u8868\u793A\u5024\u3092\u30EA\u30F3\u30AF\u3057\u76F4\u3057\u3057\u3066\u4E0B\u3055\u3044",il="\u7701\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044",ol="\u5E02\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044",al="\u533A\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044",sl="\u6700\u5C0F\u5024\u306F\uFF10\u3088\u308A\u5927\u304D\u304F\u8A2D\u5B9A\u3057\u3066\u4E0B\u3055\u3044",cl="\u6700\u4F4E\u884C\u6570\u306F{min}\u884C\u3067\u304A\u9858\u3044\u3057\u307E\u3059",ll="\u5217\u5E45\u3092\u5165\u529B\u3057\u3066\u4E0B\u3055\u3044",fl="\u5168\u3066\u306E\u6761\u4EF6\u306E\u30ED\u30B8\u30C3\u30AF\u3092\u8A2D\u5B9A\u3057\u3066\u4E0B\u3055\u3044",dl="\u5168\u3066\u306E\u6761\u4EF6\u3092\u5B8C\u6210\u3055\u305B\u3066\u4E0B\u3055\u3044",hl="please select control",pl="\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",Dl="\u30D3\u30E5\u30FC\u540D\u3092\u7A7A\u767D\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",gl="\u8B58\u5225\u30BF\u30A4\u30D7\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",vl="\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",yl="\u5C11\u306A\u304F\u3068\u30821\u3064\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",ml="\u30DC\u30BF\u30F3\u306E\u30BF\u30A4\u30C8\u30EB\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",El="\u30C7\u30FC\u30BF\u8A2D\u5B9A\u3067\u30D3\u30B8\u30CD\u30B9\u30E2\u30C7\u30EB\u3092\u30D0\u30A4\u30F3\u30C9\u3057\u3066\u304F\u3060\u3055\u3044",Al="\u30C7\u30FC\u30BF\u8A2D\u5B9A\u306B\u683C\u7D0D\u5024\u3092\u30D0\u30A4\u30F3\u30C9\u3057\u3066\u304F\u3060\u3055\u3044",Cl="\u30C7\u30FC\u30BF\u8A2D\u5B9A\u3067\u30B5\u30FC\u30D3\u30B9\u3092\u30D0\u30A4\u30F3\u30C9\u3057\u3066\u304F\u3060\u3055\u3044",Fl="\u30C7\u30FC\u30BF\u8A2D\u5B9A\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u8868\u793A\u5024\u3092\u30D0\u30A4\u30F3\u30C9\u3057\u3066\u304F\u3060\u3055\u3044",wl="\u30C7\u30FC\u30BF\u8A2D\u5B9A\u3067\u30EB\u30FC\u30C8\u30CE\u30FC\u30C9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",bl="\u6700\u5927\u9AD8\u3055\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",Bl="\u5165\u529B\u5185\u5BB9\u3092\u7A7A\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",_l="\u900F\u304B\u3057\u3092\u7A7A\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",Sl="\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u7A7A\u767D\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093",Ml="\u5370\u5237\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u5C11\u306A\u304F\u3068\u30821\u3064\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\uFF01\uFF01",Il="\u6307\u5B9A\u3055\u308C\u305F\u30D3\u30B8\u30CD\u30B9\u90E8\u9580\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",Nl="\u5916\u90E8\u7D44\u7E54\u306E\u6307\u5B9A\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",Ol="\u30B5\u30D6\u30C6\u30FC\u30D6\u30EB\u5225\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",xl="\u95A2\u9023\u8868\u3092\u9078\u629E\u3057\u3066\u30D3\u30B8\u30CD\u30B9\u30E2\u30C7\u30EB\u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",Rl="\u95A2\u9023\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A\u30D0\u30A4\u30F3\u30C9\u30B5\u30FC\u30D3\u30B9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",$l="\u95A2\u9023\u30B5\u30D6\u30C6\u30FC\u30D6\u30EB\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u9078\u629E",Pl="\u95A2\u9023\u30DE\u30B9\u30BF\u30FC\u30C6\u30FC\u30D6\u30EB\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",Tl="\u30BD\u30FC\u30C8\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",jl={isNotNumber:Ac,isNotString:Cc,isNotObject:Fc,isNotArray:wc,isNotBoolean:bc,runtimeRequired:Bc,pleaseEnterCaption:_c,pleaseEnterCaptionTip:Sc,pleaseEnterRowCaption:Mc,pleaseEnterPlaceholder:Ic,pleaseEnterFieldCode:Nc,pleaseEnterForm:Oc,pleaseEnterList:xc,pleaseEnterProcess:Rc,pleaseEnterLabel:$c,pleaseEnterValue:Pc,bizKeyNotBindFiled:Tc,pleaseSelectOneField:jc,pleaseEnterNumberRange:Lc,pleaseEnterAValueGreaterThanMin:kc,pleaseEnterAValueLessThanMax:qc,numberRangeSetError:Uc,stringRangeError:Vc,attachmentMaxSize:Hc,pleaseEnterTotalScoreSetting:zc,theTotalScoreMustNotBeLessThan1:Wc,scoreDefaultValueRange:Zc,attachmentLimitError:Jc,PleaseReselectTheOptionalQuantity:Gc,TheMaximumLengthIsGreaterThanTheMinimumLength:Xc,TheMinimumLengthIsGreaterThanTheMaximumLength:Kc,PleaseSelectTheCorrectOptionSettings:Qc,optionIdIsRepeat:Yc,optionIsRequired:el,pleaseEnterDataCode:tl,pleaseEnterValueFieldCode:nl,pleaseEnterSvcCode:rl,pleaseBindAtLeastOneDisplayValue:ul,pleaseSelectProvince:il,pleaseSelectCity:ol,pleaseSelectDistrict:al,limitRowsCannotBeLessThan0:sl,TheNumberOfRowsCannotBeLessThanMinRows:cl,pleaseEnterColumnWidth:ll,pleaseSetTheLogicalRelationshipOfAllRuleConditions:fl,pleaseCompleteAllRulesAndConditions:dl,pleaseSelectControl:hl,pleaseSelectDashboard:pl,theViewNameCannotBeEmpty:Dl,pleaseSelectOcrType:gl,pleaseSelectAtLeastOneFieldToFillIn:vl,pleaseChooseAtLeastOne:yl,pleaseEnterButtonContent:ml,pleaseEnterDataCodeInDataSetting:El,pleaseEnterValueFieldCodeInDataSetting:Al,pleaseEnterSvcCodeInDataSetting:Cl,pleaseBindAtLeastOneDisplayValueInDataSetting:Fl,rootNodeIsRequiredInDataSetting:wl,pleaseEnterMaxHeight:bl,pleaseEnter:Bl,pleaseEnterWatermark:_l,pleaseEnterFileName:Sl,pleaseUploadAtLeastOnePrintTemplate:Ml,pleaseAssignBusiness:Il,pleaseAssignExternal:Nl,pleaseEnterAliasCode:Ol,pleaseSelectDataCode:xl,pleaseSelectSvcCode:Rl,pleaseSelectJoinFieldCode:$l,pleaseSelectMainFieldCode:Pl,pleaseSelectSortFieldCode:Tl},Ll={zhCN:ns,enUS:Ec,jaJP:jl},$e;(function(e){e.Number="Number",e.Operator="Operator",e.VariableInMainTable="VariableInMainTable",e.VariableInCurrentSubTable="VariableInCurrentSubTable",e.VariableInOtherSubTable="VariableInOtherSubTable",e.UndefinedVariable="UndefinedVariable"})($e||($e={}));var Et;(function(e){e.SUM="SUM",e.AVG="AVG",e.MAX="MAX",e.MIN="MIN"})(Et||(Et={}));var nu="zh-CN",V;(function(e){e.BASE="base",e.FORM="form",e.LAYOUT="layout",e.WRAP="wrap",e.COLUMN="column",e.LIST="list",e.SEARCH="search"})(V||(V={}));var ru;(function(e){e[e.FORM=0]="FORM",e[e.LIST=1]="LIST",e[e.REPORT=2]="REPORT",e[e.DASHBOARD=3]="DASHBOARD",e[e.VUE=4]="VUE",e[e.FREE_PAGE=5]="FREE_PAGE"})(ru||(ru={}));var ne;(function(e){e.TITLE="title",e.LINK="link",e.BUTTON="button",e.DIVIDER="divider",e.TEXT="text",e.CREATE_FORM_LIST_BUTTON="list-page-btn-create-form",e.BATCH_SUBMISSION_LIST_BUTTON="list-page-btn-batch-submission",e.BATCH_DELETE_LIST_BUTTON="list-page-btn-batch-delete",e.SUBMISSION_RECORD_LIST_BUTTON="list-page-btn-submission-record",e.IMPORT_RECORD_LIST_BUTTON="list-page-btn-import-record",e.EXPORT_RECORD_LIST_BUTTON="list-page-btn-export-record",e.EXPORT_LIST_BUTTON="list-page-btn-export-list",e.LIST_SELECT_BUTTON="list-select-button",e.ORGANIZATION_SELECTION="organization-selection",e.FORM_SELECT_BUTTON="form-select-button",e.LIST_VIEW_SELECT="list-view-select",e.TEXT_OCR_BUTTON="text-ocr-button",e.INVOICE_CHECK_BUTTON="invoice-check-button",e.LIST_PAGE_BTN_BATCH_PRINT="list-page-btn-batch-print",e.LIST_PAGE_BTN_BATCH_PRINT_RECORD="list-page-btn-batch-print-record",e.VARCHAR_COLUMN="varchar-column",e.TEXT_COLUMN="text-column",e.DECIMAL_COLUMN="decimal-column",e.TIMESCOPE_COLUMN="timescope-column",e.TIMESTAMP_COLUMN="timestamp-column",e.ARRAY_COLUMN="array-column",e.DEPARTMENT_COLUMN="department-column",e.AUTO_NUMBER_COLUMN="auto-number-column",e.FILE_COLUMN="file-column",e.IMAGE_COLUMN="image-column",e.PEOPLE_COLUMN="people-column",e.LOCATION_COLUMN="location-column",e.CUSTOM_COLUMN="custom-column",e.ORDER_COLUMN="order-column",e.OPERATION_COLUMN="operation-column",e.OPERATION_BUTTON="operation-button",e.EMPLOYEE_COLUMN="employee-column",e.Approval_Status_Column="approval-status-column",e.ADDRESS="address",e.AMOUNT="amount",e.ATTACHMENT="attachment",e.AUTO_NUMBER="auto-number",e.CALC="calc",e.CHECKBOX="checkbox",e.DATE_PICKER="date-picker",e.DATE_RANGE="date-range",e.DEPARTMENT="department",e.EMPLOYEE="employee",e.IMAGE="image",e.INPUT="input",e.NUMBER="number",e.RADIO="radio",e.RICH_TEXT="rich-text",e.SCORE="score",e.SEARCH_DATE_RANGE="search-date-range",e.SEARCH_NUMBER_RANGE="search-number-range",e.SEARCH_INPUT="search-input",e.SELECT="select",e.SELECT_MULTIPLE="select-multiple",e.SELECT_RELATION="select-relation",e.VUE_FORM_ITEM="vue-form-item",e.TEXTAREA="textarea",e.EMAIL="email",e.FOOTER="footer",e.HEADER="header",e.ID_CARD="id-card",e.MOBILE="mobile",e.PHONE="phone",e.RADIO_IMAGE="radio-image",e.ELECTRONIC_SIGNATURE="electronic-signature",e.WPS="wps",e.CARD_GROUP="card-group",e.COL="col",e.GRID="grid",e.GRID_ROW="grid-row",e.GRID_TABLE_COLUMN="grid-table-column",e.GRID_LAYOUT_CONTAINER="grid-layout-container",e.ROW="row",e.TWO_COLUMNS="two-columns",e.SUBTABLE_COLUMN="subtable-column",e.SUBTABLE_ROW="subtable-row",e.TAB="tab",e.TAB_PANE="tab-pane",e.TOOLBOX="toolbox",e.DATA_VIEW="data-view",e.LIST_VIEW="list-view",e.ACTION_BAR="action-bar",e.SUBTABLE="subtable",e.GRID_TABLE="grid-table",e.SIMPLE_SEARCH="simple-search",e.PAGINATION="pagination",e.CHECKBOX_IMAGE="checkbox-image",e.DASHBOARD="dashboard",e.TREE="tree",e.EMPLOYEE2="employee2",e.DEPARTMENT2="department2",e.GRID_LAYOUT_WRAP="grid-layout-wrap",e.VUE_PAGE="vue-page"})(ne||(ne={}));var uu;(function(e){e.SAVE="save",e.DRAFT="draft",e.UNSUBMIT="unsubmit",e.AUDIT="audit",e.UNAUDIT="unaudit",e.CANCEL="cancel",e.FORM_SUBMIT="form_submit"})(uu||(uu={}));var oe;(function(e){e.VARCHAR="varchar",e.TEXT="text",e.ARRAY="array",e.ADDRESS="location",e.DECIMAL="decimal",e.DECIMAL_RANGE="decimal_range",e.TIMESTAMP="timestamp",e.EMPLOYEES="people",e.DEPARTMENTS="department",e.MONEY="money",e.TIMESCOPE="timescope",e.FILE="file",e.IMAGE="image",e.AUTO_NUMBER="auto_number",e.CALC="calc",e.LIST="list",e.JSON="json",e.ANY="ANY"})(oe||(oe={}));var iu;(function(e){e.YEAR="year",e.MONTH="month",e.DATE="date",e.DATEHOUR="datehour",e.DATEMIN="datemin",e.DATETIME="datetime"})(iu||(iu={}));var ou="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",kl=ou+"0123456789";function nn(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15,t="",n=0;n<e;n++){var r=n===0?ou:kl,u=Math.random()*r.length;t+=r[parseInt(String(u),10)]}return t}function Un(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ql(e){if(Array.isArray(e))return Un(e)}function Ul(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function au(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rn(e,t,n){return lu()?rn=Reflect.construct:rn=function(u,i,o){var s=[null];s.push.apply(s,i);var c=Function.bind.apply(u,s),f=new c;return o&&kt(f,o.prototype),f},rn.apply(null,arguments)}function Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Lt(e)}function su(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kt(e,t)}function Vl(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Hl(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zl(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wl(e,t){return t&&(Zl(t)==="object"||typeof t=="function")?t:Ul(e)}function kt(e,t){return kt=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},kt(e,t)}function cu(e){return ql(e)||Hl(e)||Jl(e)||zl()}function Zl(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Jl(e,t){if(!!e){if(typeof e=="string")return Un(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Un(e,t)}}function Vn(e){var t=typeof Map=="function"?new Map:void 0;return Vn=function(r){if(r===null||!Vl(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,u)}function u(){return rn(r,arguments,Lt(this).constructor)}return u.prototype=Object.create(r.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),kt(u,r)},Vn(e)}function lu(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function fu(e){var t=lu();return function(){var r=Lt(e),u;if(t){var i=Lt(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return Wl(this,u)}}var Hn=console;function At(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,u=t.slice(1);(r=Hn).warn.apply(r,["\u{1F9D0} Driven Warning:"+t[0]].concat(cu(u)))}function zn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,u=t.slice(1);(r=Hn).log.apply(r,["\u{1F680} Driven Log:"+t[0]].concat(cu(u)))}function Gl(e){return e+" \u{1F41B}\u{1F41B}\u{1F41B}"}var Wn=function(e){su(n,e);var t=fu(n);function n(r){au(this,n);var u;return u=t.call(this,r),u.name="\u{1F4A5} Driven Error",u.message=r?Gl(r):"An unknown error occurred in the Driven, please contact the person in charge \u{1F691}\u{1F691}\u{1F691}",u}return n}(Vn(Error)),Xl=function(e){su(n,e);var t=fu(n);function n(r){au(this,n);var u;return u=t.call(this,r),u.name="\u{1F6A8} Driven Reference Error",u}return n}(Wn);function Ze(e){throw new Wn(e)}function du(e){throw new Xl(e)}function un(e){Hn.error(new Wn(e))}function Je(e,t){Array.isArray(e)&&e.map(function(n){switch(n.controlType){case"layout":Je(n==null?void 0:n.children,t);break;case"wrap":Je(n==null?void 0:n.children,t);break;case"search":Je(n==null?void 0:n.children,t);break;case"form":t(n)}})}var Kl=Object.prototype.toString;function hu(e,t){return Kl.call(e)==="[object "+t+"]"}function Ql(e){return hu(e,"String")}function Yl(e){return hu(e,"Promise")}var ef=function(){function e(t){var n,r;this._messageCache=new Map,this.messages={},this.variableRegExp=/\{([0-9a-zA-Z_]+)\}/g,this._messages=Object.freeze((r=(n=t.messages)!==null&&n!==void 0?n:this.getPreImport(t.locale))!==null&&r!==void 0?r:{}),t.variableRegExp&&(this.variableRegExp=t.variableRegExp),this.setLocale(t.locale)}return e.prototype.setLocale=function(t){var n=this;this.locale=t,this._messageCache.clear();var r=this.getMessageData();Yl(r)?r.then(function(u){n._messageCache.clear(),n.messages[n.localeInMessageKey]=u}):this.messages[this.localeInMessageKey]=r},e.prototype.getMessageData=function(){var t=this._messages[this.localeInMessageKey];return typeof t=="function"?t():t},e.prototype.translate=function(t,n,r){var u=this.getMessage(t);return u?this.formatMessage(u,r):this.formatMessage(n,r)},e.prototype.getMessage=function(t){if(this._messageCache.has(t))return this._messageCache.get(t);var n=this.getPathArray(t),r=n.reduce(function(u,i,o,s){if(u!==void 0){var c=u[i];if(!(o===s.length-1&&!Ql(c)))return c}},this.message);return this._messageCache.set(t,r),r},e.prototype.formatMessage=function(t,n){return n?t.replace(this.variableRegExp,function(r,u){var i=n[u];return i!==void 0?String(i):r}):t},e.prototype.getPreImport=function(t){var n;if(window.okI18nPreImport){var r=this.getLocaleInMessageKey(t);return window.okI18nPreImport.hasOwnProperty(r)?window.okI18nPreImport:(n={},n[r]=window.okI18nPreImport,n)}},e.prototype.getPathArray=function(t){return t.split(".")},e.prototype.getLocaleInMessageKey=function(t){return t.replace(/-/g,"")},Object.defineProperty(e.prototype,"$t",{get:function(){return this.translate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localeInMessageKey",{get:function(){return this.getLocaleInMessageKey(this.locale)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){var t;return(t=this.messages[this.localeInMessageKey])!==null&&t!==void 0?t:{}},enumerable:!1,configurable:!0}),e}();function tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nf(e,t,n){return t&&pu(e.prototype,t),n&&pu(e,n),e}function rf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Se=function(){function e(){tf(this,e)}return nf(e,null,[{key:"getMessage",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.$i18n.$t(n,"",r)}},{key:"resetI18n",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nu;return new ef({locale:n,messages:Ll})}},{key:"setLocale",value:function(n){return this.$i18n.setLocale(n)}}]),e}();rf(Se,"$i18n",Se.resetI18n());function Zn(e,t,n){var r=t.replace(/\[(\d)]/g,function(i,o){return"."+o}).split("."),u=!1;return r.reduce(function(i,o,s,c){var f=i;if(!!i){if(!Object.prototype.hasOwnProperty.call(i,o)){At("Can not set ".concat(t,"'s ").concat(o," property in current %o, Because there is no ").concat(o," property on the %o"),i,i);return}return s===c.length-1&&!Object.is(f[o],n)&&(f[o]=n,u=!0),f[o]}},e),u}var tt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Du(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jn={exports:{}};(function(e){(function(t){var n=function(p,y,m){if(!f(y)||a(y)||d(y)||h(y)||c(y))return y;var C,w=0,S=0;if(l(y))for(C=[],S=y.length;w<S;w++)C.push(n(p,y[w],m));else{C={};for(var I in y)Object.prototype.hasOwnProperty.call(y,I)&&(C[p(I,m)]=n(p,y[I],m))}return C},r=function(p,y){y=y||{};var m=y.separator||"_",C=y.split||/(?=[A-Z])/;return p.split(C).join(m)},u=function(p){return D(p)?p:(p=p.replace(/[\-_\s]+(.)?/g,function(y,m){return m?m.toUpperCase():""}),p.substr(0,1).toLowerCase()+p.substr(1))},i=function(p){var y=u(p);return y.substr(0,1).toUpperCase()+y.substr(1)},o=function(p,y){return r(p,y).toLowerCase()},s=Object.prototype.toString,c=function(p){return typeof p=="function"},f=function(p){return p===Object(p)},l=function(p){return s.call(p)=="[object Array]"},a=function(p){return s.call(p)=="[object Date]"},d=function(p){return s.call(p)=="[object RegExp]"},h=function(p){return s.call(p)=="[object Boolean]"},D=function(p){return p=p-0,p===p},g=function(p,y){var m=y&&"process"in y?y.process:y;return typeof m!="function"?p:function(C,w){return m(C,p,w)}},A={camelize:u,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(p,y){return n(g(u,y),p)},decamelizeKeys:function(p,y){return n(g(o,y),p,y)},pascalizeKeys:function(p,y){return n(g(i,y),p)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=A:t.humps=A})(tt)})(Jn);var gu={};Object.defineProperty(gu,"__esModule",{value:!0});function Gn(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(t=>typeof t!="object"||t===null?t:Gn(t));{const t={};for(const n in e){const r=e[n];t[n]=typeof r!="object"||r===null?r:Gn(r)}return t}}var uf=gu.default=Gn;function vu(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function K(e){if(e!==void 0)return(typeof e=="undefined"?"undefined":vu(e))==="object"?uf(e):e}function Pe(e){return Object.prototype.toString.call(e)==="[object Object]"}function of(e){return e!=null&&(typeof e=="undefined"?"undefined":vu(e))==="object"&&Array.isArray(e)===!1}function dt(e){return Array.isArray(e)}function Ae(e){return typeof e=="string"}function on(e){return typeof e=="number"}function yu(e){return typeof e=="function"}function af(e){return dt(e)&&e.every(function(t){return Ae(t)})}function sf(e){return dt(e)&&e.every(function(t){return on(t)||t===""})}function mu(e){return/^\[.*?]$/.test(e)}function an(e){return/^{.*?}$/.test(e)}function cf(e){return Object.values(ne).includes(e)}function Xn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lf(e){if(Array.isArray(e))return Xn(e)}function Eu(e,t,n,r,u,i,o){try{var s=e[i](o),c=s.value}catch(f){n(f);return}s.done?t(c):Promise.resolve(c).then(r,u)}function ff(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(c){Eu(i,r,u,o,s,"next",c)}function s(c){Eu(i,r,u,o,s,"throw",c)}o(void 0)})}}function df(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Au(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hf(e,t,n){return t&&Au(e.prototype,t),n&&Au(e,n),e}function Cu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pf(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Df(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Kn(e){return lf(e)||pf(e)||gf(e)||Df()}function gf(e,t){if(!!e){if(typeof e=="string")return Xn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(e,t)}}function vf(e,t){var n,r,u,i,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(u=f[0]&2?r.return:f[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,f[1])).done)return u;switch(r=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,r=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(u=o.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){o.label=f[1];break}if(f[0]===6&&o.label<u[1]){o.label=u[1],u=f;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(f);break}u[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(l){f=[6,l],r=0}finally{n=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var Fu=function(){function e(){df(this,e),Cu(this,"_events",new Map),Cu(this,"debug",!1)}return hf(e,[{key:"emit",value:function(n){for(var r=arguments.length,u=new Array(r>1?r-1:0),i=1;i<r;i++)u[i-1]=arguments[i];var o=this;return ff(function(){var s,c,f,l,a,d,h,D,g,A,p,y;return vf(this,function(m){switch(m.label){case 0:if(s=o._events.get(n),c=[],!s)return[3,10];f=s.slice(),l=!0,a=!1,d=void 0,m.label=1;case 1:m.trys.push([1,8,9,10]),h=f[Symbol.iterator](),m.label=2;case 2:if(l=(D=h.next()).done)return[3,7];if(g=D.value,!s.includes(g))return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),o.debug&&zn.apply(void 0,["\u6B63\u5728\u6267\u884C ".concat(n," \u4E8B\u4EF6: ").concat(g.applyingPluginName?"\u5F53\u524D\u6267\u884C\u7684\u63D2\u4EF6\u4E3A:"+g.applyingPluginName:"",", \u5F53\u524D\u6267\u884C\u51FD\u6570\u7684\u53C2\u6570\u4E3A").concat(u.map(function(){return"%o"}).join(","),"\u3002")].concat(Kn(u))),[4,g.apply(null,Kn(u))];case 4:return A=m.sent(),o.debug&&zn.apply(void 0,["\u6B63\u5728\u6267\u884C ".concat(n," \u4E8B\u4EF6: ").concat(g.applyingPluginName?"\u5F53\u524D\u6267\u884C\u7684\u63D2\u4EF6\u4E3A:"+g.applyingPluginName:"",", \u5F53\u524D\u6267\u884C\u51FD\u6570\u7684\u53C2\u6570\u4E3A").concat(u.map(function(){return"%o"}).join(","),"; \u51FD\u6570\u7684\u8FD4\u56DE\u7ED3\u679C\u4E3A%o")].concat(Kn(u),[A])),c.push(A),A===!1?[3,7]:[3,6];case 5:return p=m.sent(),un(String(p)+":"+String(p.stack)),[3,6];case 6:return l=!0,[3,2];case 7:return[3,10];case 8:return y=m.sent(),a=!0,d=y,[3,10];case 9:try{!l&&h.return!=null&&h.return()}finally{if(a)throw d}return[7];case 10:return[2,c]}})})()}},{key:"on",value:function(n,r){if(this._events.has(n)){var u;(u=this._events.get(n))===null||u===void 0||u.push(r)}else this._events.set(n,[r])}},{key:"off",value:function(n,r){if(this._events.has(n)){var u=this._events.get(n),i=u==null?void 0:u.indexOf(r);u==null||u.splice(i,1)}}},{key:"delete",value:function(n){this._events.has(n)&&this._events.delete(n)}},{key:"clear",value:function(){this._events=new Map}}]),e}();function yf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mf(e,t,n){return t&&wu(e.prototype,t),n&&wu(e,n),e}function Ef(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Af=[{key:"on_click",name:"\u70B9\u51FB\u65F6",code:"click"},{key:"on_click_finish",name:"\u6267\u884C\u5B8C\u6210\u65F6",code:"click-finish"},{key:"on_change",name:"\u503C\u53D1\u751F\u53D8\u5316\u65F6",code:"change"},{key:"on_search",name:"\u641C\u7D22\u65F6",code:"search"},{key:"on_list_change",name:"\u5217\u8868\u6570\u636E\u53D8\u5316\u65F6",code:"list-change"},{key:"on_list_search",name:"\u5217\u8868\u6570\u636E\u67E5\u8BE2\u6784\u5EFA\u65F6",code:"list-search"},{key:"on_list_mounted",name:"\u5217\u8868\u6570\u636E\u8FD4\u56DE\u65F6",code:"list-mounted"},{key:"on_list_delete",name:"\u5217\u8868\u6570\u636E\u5220\u9664\u65F6",code:"list-delete"},{key:"on_list_before_insert",name:"\u5217\u8868\u6570\u636E\u63D2\u5165\u524D",code:"list-before-insert"},{key:"on_input",name:"\u7528\u6237\u8F93\u5165\u65F6",code:"input"},{key:"on_blur",name:"\u5931\u53BB\u7126\u70B9\u65F6",code:"blur"},{key:"on_focus",name:"\u83B7\u53D6\u7126\u70B9\u65F6",code:"focus"},{key:"on_wps_open",name:"\u6253\u5F00\u6587\u4EF6\u65F6",code:"wps-open"},{key:"on_wps_save",name:"\u4FDD\u5B58\u6587\u4EF6\u65F6",code:"wps-save"},{key:"on_wps_rename",name:"\u91CD\u547D\u540D\u65F6",code:"wps-rename"},{key:"on_list_actions",name:"\u70B9\u51FB\u64CD\u4F5C\u6309\u94AE\u65F6",code:"list-actions"},{key:"on_list_render_operation",name:"\u64CD\u4F5C\u5217\u6E32\u67D3\u65F6",code:"list-render-operation"},{key:"on_list_rowclick",name:"\u884C\u70B9\u51FB\u65F6",code:"list-rowclick"},{key:"on_list_before_rowdelete",name:"\u884C\u5220\u9664\u524D",code:"list-before-rowdelete"},{key:"on_list_before_import",name:"\u5217\u8868\u6570\u636E\u5BFC\u5165\u524D",code:"list-before-import"},{key:"on_list_rows_checked",name:"\u884C\u9009\u4E2D\u65F6",code:"list-rows-checked"},{key:"on_change_tab",name:"\u6807\u7B7E\u9875\u5207\u6362\u65F6",code:"change-tab"},{key:"on_modal_ok",name:"\u5F39\u7A97\u786E\u8BA4\u65F6",code:"modal-ok"}],bu=function(){function e(){yf(this,e)}return mf(e,null,[{key:"getEventsFromKeys",value:function(n){var r=typeof n=="string"?[n]:n;return e.events.filter(function(u){return r.includes(u.key)})}},{key:"getEventsFromControl",value:function(n){var r=[],u=n.eventKeys;r=r.concat(e.events.filter(function(o){return u.includes(o.key)}));var i=n.customEvents.map(function(o){var s=o.key;return o.namespace!==void 0&&o.namespace!==null&&o.namespace!==""&&(s=o.namespace+":"+o.key),{key:s,code:o.key,name:o.name}});return r=r.concat(i),r}}]),e}();Ef(bu,"events",Af);function Qn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cf(e){if(Array.isArray(e))return Qn(e)}function Ff(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wf(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Bu(e){return Cf(e)||Ff(e)||bf(e)||wf()}function bf(e,t){if(!!e){if(typeof e=="string")return Qn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qn(e,t)}}function Yn(e,t){var n;!((n=Object.getOwnPropertyDescriptors(e)[t])===null||n===void 0)&&n.enumerable&&Object.defineProperty(e,t,{enumerable:!1})}function _u(e,t,n){n!=="Runtime"&&(e.parent=t,Yn(e,"parent"))}function Bf(e,t,n){e.forEach(function(r){_u(r,t,n)})}var Su=Symbol("targetKey");function Mu(e){var t;return(t=e[Su])!==null&&t!==void 0?t:e}function Iu(e,t,n){return Bf(e,t,n),new Proxy(e,{get:function(u,i){for(var o=arguments.length,s=new Array(o>2?o-2:0),c=2;c<o;c++)s[c-2]=arguments[c];var f;return i===Su?u:(f=Reflect).get.apply(f,[u,i].concat(Bu(s)))},set:function(u,i,o){for(var s=arguments.length,c=new Array(s>3?s-3:0),f=3;f<s;f++)c[f-3]=arguments[f];var l;if(dt(e)&&i==="length"&&o===e.length)return!0;var a=(l=Reflect).set.apply(l,[u,i,o].concat(Bu(c)));return Pe(o)&&_u(o,t,n),a}})}function er(e,t,n,r,u){var i=r!=null?r:e,o=Iu(Mu(n!=null?n:[]),i,u);Object.defineProperty(e,t,{get:function(){return o},set:function(c){o=Iu(Mu(c),i,u)},enumerable:!0})}function _f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sf(e,t,n){return t&&Nu(e.prototype,t),n&&Nu(e,n),e}function nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ou=[],qt=function(){function e(t){_f(this,e),nt(this,"registeredControlTypes",new Set),nt(this,"controlConfigMap",new Map),nt(this,"_controls",[]),nt(this,"_type",void 0),this._type=t,this._initControls(t)}return Sf(e,[{key:"registerControlConfig",value:function(n,r){return this.controlConfigMap.set(n,r),this}},{key:"getControlConfig",value:function(n){return this.controlConfigMap.get(n)}},{key:"getControls",value:function(){return this._controls}},{key:"register",value:function(n){n.__is_control__||Ze("".concat(n.name," is not a Control"));var r=this._controls.findIndex(function(u){return u.controlType===n.controlType});return r>-1&&(At("The ".concat(n.controlType," is repeat register, So it overwrites the one that was registered before.")),this._controls.splice(r,1)),this.registeredControlTypes.add(n.controlType),this._controls.push(n),this}},{key:"isLayoutControl",value:function(n){return n.controlType===V.LAYOUT}},{key:"isFormControl",value:function(n){return n.controlType===V.FORM}},{key:"isListControl",value:function(n){return n.controlType===V.LIST}},{key:"isColumnControl",value:function(n){return n.controlType===V.COLUMN}},{key:"createControl",value:function(n,r){var u=this;if(Array.isArray(n))return n.map(function(l){return u.createControl(l,r)});if(n.children&&(n.children=n.children.map(function(l){return u.createControl(l,r)})),this.isListControl(n)){var i=n.props;i.headers&&(i.headers=i.headers.map(function(l){return u.createControl(l,r)}))}var o=this.getControlFormType(n.type);if(o){var s=n;if(typeof r=="function"){var c=r(s);c&&(s=c)}var f;return o.mode==="Runtime"?(f=s,f.fieldType=o.controlFieldType,this._setParentPrototypeToSchema(f,this)):f=new o(s),f}else Ze("The constructor of ".concat(n.type," could not be found, please confirm that the constructor has been registered"))}},{key:"resetInstanceParent",value:function(n,r){delete n.parent,Object.defineProperty(n,"parent",{configurable:!0,get:function(){return r}}),Yn(n,"parent")}},{key:"_setParentPrototypeToSchema",value:function(n,r){r._type==="Runtime"&&(Object.defineProperty(n,"parent",{configurable:!0,get:function(){var i=n.id,o=r._controlParentIdMap,s=r.instanceMap;if(!(!o||!s)){var c=o[i],f=s[i];if(!(!c&&!f)){var l=f.findIndex(function(h){return h==n}),a=s[c]||[],d;return a.length!==f.length?d=a[0]:d=a[l],d}}}}),Yn(n,"parent"))}},{key:"createControlInstance",value:function(n,r){var u=this.getControlFormType(n);if(u)return new u(r)}},{key:"getControlFormType",value:function(n){return this._controls.find(function(r){return r.controlType===n})}},{key:"_initControls",value:function(n){var r=this;this.constructor.staticControls.forEach(function(u){r.register(u[n]),e.staticControlsRuntimeRules.set(u.Runtime.controlType,u.Property.RuntimeRules),u.Property.mode=n})}}],[{key:"staticGetRules",value:function(n,r){var u=e.staticControlsRuntimeRules.get(n),i=[];if(u){var o=new u(r);i=Array.from(o)}return i}},{key:"register",value:function(n,r){var u=n.Designer,i=n.Runtime,o=n.Property;(!u||!i||!u.__is_control__||!i.__is_control__)&&Ze("".concat(n," is can't register as a Control"));var s=this.staticControls.findIndex(function(c){return c.Designer.controlType===u.controlType});return s>-1&&(At("The ".concat(u.controlType," is repeat register, So it overwrites the one that was registered before.")),this.staticControls.splice(s,1)),this.staticRegisteredTypes.add(u.controlType),this.staticControls.push(n),o.mode=r,this}}]),e}();nt(qt,"staticControlsRuntimeRules",new Map),nt(qt,"staticControls",Ou),nt(qt,"staticRegisteredTypes",new Set(Ou.map(function(e){return e.Designer.controlType}))),nt(qt,"staticRegisteredConfigs",new Map);function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tr=function e(t){ht(this,e),re(this,"dataCode",void 0),re(this,"fieldCode",void 0),re(this,"fieldType",void 0),re(this,"aliasCode",void 0);var n;this.dataCode=(n=t==null?void 0:t.dataCode)!==null&&n!==void 0?n:"";var r;this.fieldCode=(r=t==null?void 0:t.fieldCode)!==null&&r!==void 0?r:"";var u;this.fieldType=(u=t==null?void 0:t.fieldType)!==null&&u!==void 0?u:"",this.aliasCode=t==null?void 0:t.aliasCode},Mf=function e(t){ht(this,e),re(this,"minWidth",void 0),re(this,"maxWidth",void 0),re(this,"flex",void 0);var n;this.minWidth=(n=t==null?void 0:t.minWidth)!==null&&n!==void 0?n:150,this.maxWidth=t==null?void 0:t.maxWidth;var r;this.flex=(r=t==null?void 0:t.flex)!==null&&r!==void 0?r:1},nr=function e(t){ht(this,e),re(this,"amount",void 0),re(this,"currency",void 0);var n;this.amount=(n=t==null?void 0:t.amount)!==null&&n!==void 0?n:"";var r;this.currency=(r=t==null?void 0:t.currency)!==null&&r!==void 0?r:"CNY"},rr=function e(t){ht(this,e),re(this,"min",void 0),re(this,"max",void 0);var n;this.min=(n=t==null?void 0:t.min)!==null&&n!==void 0?n:"";var r;this.max=(r=t==null?void 0:t.max)!==null&&r!==void 0?r:""},ur=function e(t){ht(this,e),re(this,"city",void 0),re(this,"cityDisplay",void 0),re(this,"district",void 0),re(this,"districtDisplay",void 0),re(this,"province",void 0),re(this,"provinceDisplay",void 0);var n;this.city=(n=t==null?void 0:t.city)!==null&&n!==void 0?n:"";var r;this.cityDisplay=(r=t==null?void 0:t.cityDisplay)!==null&&r!==void 0?r:"";var u;this.district=(u=t==null?void 0:t.district)!==null&&u!==void 0?u:"";var i;this.districtDisplay=(i=t==null?void 0:t.districtDisplay)!==null&&i!==void 0?i:"";var o;this.province=(o=t==null?void 0:t.province)!==null&&o!==void 0?o:"";var s;this.provinceDisplay=(s=t==null?void 0:t.provinceDisplay)!==null&&s!==void 0?s:""},ir=function e(t){ht(this,e),re(this,"result",void 0),re(this,"unit",void 0);var n;this.result=(n=t==null?void 0:t.result)!==null&&n!==void 0?n:0;var r;this.unit=(r=t==null?void 0:t.unit)!==null&&r!==void 0?r:""},xu;(function(e){e.CNY="CNY",e.USD="USD",e.JPY="JPY",e.EUR="EUR",e.INR="INR",e.IDR="IDR",e.BRL="BRL",e.AED="AED",e.AUD="AUD",e.CAD="CAD",e.EGP="EGP",e.GBP="GBP",e.ZAR="ZAR",e.KRW="KRW",e.MAD="MAD",e.MXN="MXN",e.MYR="MYR",e.PHP="PHP",e.PLN="PLN",e.RUB="RUB",e.SGD="SGD",e.THB="THB",e.TRY="TRY",e.TWD="TWD",e.VND="VND",e.HKD="HKD",e.IEP="IEP"})(xu||(xu={}));var Ru;(function(e){e.DEFAULT_DISPLAY="defaultDisplay",e.REQUIRED="required",e.IS_HIDE="isHide",e.IS_SHOW_UNIT="isShowUnit",e.IMD_SEARCH="immediatelySearch",e.MULTIPLE="multiple",e.SUBMIT_SELECT_CURRENCY="submitSelectCurrency",e.CAPTION="caption",e.IS_HIDE_CAPTION="isHideCaption",e.DEFAULT_SHOW_OPTIONS="defaultShowOptions",e.CAN_SEARCH="canSearch",e.CAN_CHECK="canCheck",e.CAN_EDIT="canEdit",e.CAN_DELETE="canDelete",e.SHOW_UPPER_CASE="showUpperCase",e.MICROMETER="micrometer",e.PRECISION="precision",e.PERCENTAGE="percentage",e.OPTIONAL_LEVEL="optionalLevel",e.CONTAINS_SUB_NODE="containsSubNode",e.DEFAULT_COLLAPSE="defaultCollapse",e.CAN_VIEW_FORM="canViewForm",e.VIEW_FORM_MODEL_TYPE="viewFormModelType",e.SERVER_PAGINATION="serverPagination",e.IS_SHOW_CAPTION_TIP="isShowCaptionTip",e.IS_SHOW_WATERMARK="isShowWatermark",e.ENCRYPTED="encrypted",e.IS_INLINE_EDIT="isInlineEdit",e.REVISIONS_MODE="revisionsMode",e.ALLOW_COPY_OPTIONS="allowCopyOptions",e.IS_PASTE="isPaste",e.SORTABLE="sortable"})(Ru||(Ru={}));var or;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.READONLY=1]="READONLY",e[e.EDITABLE=2]="EDITABLE",e[e.PRINT=5]="PRINT"})(or||(or={}));var If=function e(t){ht(this,e),re(this,"width",void 0),re(this,"height",void 0),re(this,"widthConfig",void 0),re(this,"heightConfig",void 0);var n;this.width=(n=t==null?void 0:t.width)!==null&&n!==void 0?n:"";var r;this.height=(r=t==null?void 0:t.height)!==null&&r!==void 0?r:"";var u;this.widthConfig=(u=t==null?void 0:t.widthConfig)!==null&&u!==void 0?u:"fill";var i;this.heightConfig=(i=t==null?void 0:t.heightConfig)!==null&&i!==void 0?i:"fill"};function Nf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ar(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(e,t,n){return $u()?sn=Reflect.construct:sn=function(u,i,o){var s=[null];s.push.apply(s,i);var c=Function.bind.apply(u,s),f=new c;return o&&Vt(f,o.prototype),f},sn.apply(null,arguments)}function Ge(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ut(e){return Ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ut(e)}function Of(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vt(e,t)}function xf(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Rf(e,t){return t&&($f(t)==="object"||typeof t=="function")?t:Nf(e)}function Vt(e,t){return Vt=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Vt(e,t)}function $f(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function sr(e){var t=typeof Map=="function"?new Map:void 0;return sr=function(r){if(r===null||!xf(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,u)}function u(){return sn(r,arguments,Ut(this).constructor)}return u.prototype=Object.create(r.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),Vt(u,r)},sr(e)}function $u(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Pf(e){var t=$u();return function(){var r=Ut(e),u;if(t){var i=Ut(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return Rf(this,u)}}var cr=function e(t){ar(this,e),Ge(this,"isHide",{type:"boolean"})},Pu=function(e){Of(n,e);var t=Pf(n);function n(r){return ar(this,n),t.call(this)}return n}(sr(Array)),Xe=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";ar(this,e),Ge(this,"isHide",void 0),Ge(this,"className",void 0),Ge(this,"style",void 0),Ge(this,"caption",void 0),Ge(this,"defaultState",void 0);var r;this.isHide=(r=t==null?void 0:t.isHide)!==null&&r!==void 0?r:!1,this.style=new If(t==null?void 0:t.style);var u;this.caption=(u=t==null?void 0:t.caption)!==null&&u!==void 0?u:n};Ge(Xe,"mode",void 0),Ge(Xe,"Rules",cr),Ge(Xe,"RuntimeRules",Pu);function Ue(){return Ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}function Tf(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function lr(e){return lr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},lr(e)}function cn(e,t){return cn=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},cn(e,t)}function jf(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function ln(e,t,n){return jf()?ln=Reflect.construct:ln=function(u,i,o){var s=[null];s.push.apply(s,i);var c=Function.bind.apply(u,s),f=new c;return o&&cn(f,o.prototype),f},ln.apply(null,arguments)}function Lf(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function fr(e){var t=typeof Map=="function"?new Map:void 0;return fr=function(r){if(r===null||!Lf(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,u)}function u(){return ln(r,arguments,lr(this).constructor)}return u.prototype=Object.create(r.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),cn(u,r)},fr(e)}var kf=/%[sdj%]/g,Tu=function(){};typeof process!="undefined"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window!="undefined"&&typeof document!="undefined"&&(Tu=function(t,n){typeof console!="undefined"&&console.warn&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function dr(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Me(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=1,u=t[0],i=t.length;if(typeof u=="function")return u.apply(null,t.slice(1));if(typeof u=="string"){var o=String(u).replace(kf,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(c){return"[Circular]"}break;default:return s}});return o}return u}function qf(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function le(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||qf(t)&&typeof e=="string"&&!e)}function Uf(e,t,n){var r=[],u=0,i=e.length;function o(s){r.push.apply(r,s),u++,u===i&&n(r)}e.forEach(function(s){t(s,o)})}function ju(e,t,n){var r=0,u=e.length;function i(o){if(o&&o.length){n(o);return}var s=r;r=r+1,s<u?t(e[s],i):n([])}i([])}function Vf(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n])}),t}var Lu=function(e){Tf(t,e);function t(n,r){var u;return u=e.call(this,"Async Validation Error")||this,u.errors=n,u.fields=r,u}return t}(fr(Error));function Hf(e,t,n,r){if(t.first){var u=new Promise(function(a,d){var h=function(A){return r(A),A.length?d(new Lu(A,dr(A))):a()},D=Vf(e);ju(D,n,h)});return u.catch(function(a){return a}),u}var i=t.firstFields||[];i===!0&&(i=Object.keys(e));var o=Object.keys(e),s=o.length,c=0,f=[],l=new Promise(function(a,d){var h=function(g){if(f.push.apply(f,g),c++,c===s)return r(f),f.length?d(new Lu(f,dr(f))):a()};o.length||(r(f),a()),o.forEach(function(D){var g=e[D];i.indexOf(D)!==-1?ju(g,n,h):Uf(g,n,h)})});return l.catch(function(a){return a}),l}function ku(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:typeof t=="function"?t():t,field:t.field||e.fullField}}}function qu(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]=Ue(Ue({},e[n]),r):e[n]=r}}return e}function Uu(e,t,n,r,u,i){e.required&&(!n.hasOwnProperty(e.field)||le(t,i||e.type))&&r.push(Me(u.messages.required,e.fullField))}function zf(e,t,n,r,u){(/^\s+$/.test(t)||t==="")&&r.push(Me(u.messages.whitespace,e.fullField))}var hr={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ht={integer:function(t){return Ht.number(t)&&parseInt(t,10)===t},float:function(t){return Ht.number(t)&&!Ht.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(n){return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Ht.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&!!t.match(hr.email)&&t.length<255},url:function(t){return typeof t=="string"&&!!t.match(hr.url)},hex:function(t){return typeof t=="string"&&!!t.match(hr.hex)}};function Wf(e,t,n,r,u){if(e.required&&t===void 0){Uu(e,t,n,r,u);return}var i=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?Ht[o](t)||r.push(Me(u.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Me(u.messages.types[o],e.fullField,e.type))}function Zf(e,t,n,r,u){var i=typeof e.len=="number",o=typeof e.min=="number",s=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=t,l=null,a=typeof t=="number",d=typeof t=="string",h=Array.isArray(t);if(a?l="number":d?l="string":h&&(l="array"),!l)return!1;h&&(f=t.length),d&&(f=t.replace(c,"_").length),i?f!==e.len&&r.push(Me(u.messages[l].len,e.fullField,e.len)):o&&!s&&f<e.min?r.push(Me(u.messages[l].min,e.fullField,e.min)):s&&!o&&f>e.max?r.push(Me(u.messages[l].max,e.fullField,e.max)):o&&s&&(f<e.min||f>e.max)&&r.push(Me(u.messages[l].range,e.fullField,e.min,e.max))}var Ct="enum";function Jf(e,t,n,r,u){e[Ct]=Array.isArray(e[Ct])?e[Ct]:[],e[Ct].indexOf(t)===-1&&r.push(Me(u.messages[Ct],e.fullField,e[Ct].join(", ")))}function Gf(e,t,n,r,u){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Me(u.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var i=new RegExp(e.pattern);i.test(t)||r.push(Me(u.messages.pattern.mismatch,e.fullField,t,e.pattern))}}}var U={required:Uu,whitespace:zf,type:Wf,range:Zf,enum:Jf,pattern:Gf};function Xf(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"string")&&!e.required)return n();U.required(e,t,r,i,u,"string"),le(t,"string")||(U.type(e,t,r,i,u),U.range(e,t,r,i,u),U.pattern(e,t,r,i,u),e.whitespace===!0&&U.whitespace(e,t,r,i,u))}n(i)}function Kf(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&U.type(e,t,r,i,u)}n(i)}function Qf(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(t===""&&(t=void 0),le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&(U.type(e,t,r,i,u),U.range(e,t,r,i,u))}n(i)}function Yf(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&U.type(e,t,r,i,u)}n(i)}function e0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),le(t)||U.type(e,t,r,i,u)}n(i)}function t0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&(U.type(e,t,r,i,u),U.range(e,t,r,i,u))}n(i)}function n0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&(U.type(e,t,r,i,u),U.range(e,t,r,i,u))}n(i)}function r0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(t==null&&!e.required)return n();U.required(e,t,r,i,u,"array"),t!=null&&(U.type(e,t,r,i,u),U.range(e,t,r,i,u))}n(i)}function u0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&U.type(e,t,r,i,u)}n(i)}var i0="enum";function o0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u),t!==void 0&&U[i0](e,t,r,i,u)}n(i)}function a0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"string")&&!e.required)return n();U.required(e,t,r,i,u),le(t,"string")||U.pattern(e,t,r,i,u)}n(i)}function s0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"date")&&!e.required)return n();if(U.required(e,t,r,i,u),!le(t,"date")){var s;t instanceof Date?s=t:s=new Date(t),U.type(e,s,r,i,u),s&&U.range(e,s.getTime(),r,i,u)}}n(i)}function c0(e,t,n,r,u){var i=[],o=Array.isArray(t)?"array":typeof t;U.required(e,t,r,i,u,o),n(i)}function pr(e,t,n,r,u){var i=e.type,o=[],s=e.required||!e.required&&r.hasOwnProperty(e.field);if(s){if(le(t,i)&&!e.required)return n();U.required(e,t,r,o,u,i),le(t,i)||U.type(e,t,r,o,u)}n(o)}function l0(e,t,n,r,u){var i=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();U.required(e,t,r,i,u)}n(i)}var zt={string:Xf,method:Kf,number:Qf,boolean:Yf,regexp:e0,integer:t0,float:n0,array:r0,object:u0,enum:o0,pattern:a0,date:s0,url:pr,hex:pr,email:pr,required:c0,any:l0};function Dr(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var gr=Dr();function rt(e){this.rules=null,this._messages=gr,this.define(e)}rt.prototype={messages:function(t){return t&&(this._messages=qu(Dr(),t)),this._messages},define:function(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={};var n,r;for(n in t)t.hasOwnProperty(n)&&(r=t[n],this.rules[n]=Array.isArray(r)?r:[r])},validate:function(t,n,r){var u=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var i=t,o=n,s=r;if(typeof o=="function"&&(s=o,o={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(),Promise.resolve();function c(g){var A,p=[],y={};function m(C){if(Array.isArray(C)){var w;p=(w=p).concat.apply(w,C)}else p.push(C)}for(A=0;A<g.length;A++)m(g[A]);p.length?y=dr(p):(p=null,y=null),s(p,y)}if(o.messages){var f=this.messages();f===gr&&(f=Dr()),qu(f,o.messages),o.messages=f}else o.messages=this.messages();var l,a,d={},h=o.keys||Object.keys(this.rules);h.forEach(function(g){l=u.rules[g],a=i[g],l.forEach(function(A){var p=A;typeof p.transform=="function"&&(i===t&&(i=Ue({},i)),a=i[g]=p.transform(a)),typeof p=="function"?p={validator:p}:p=Ue({},p),p.validator=u.getValidationMethod(p),p.field=g,p.fullField=p.fullField||g,p.type=u.getType(p),p.validator&&(d[g]=d[g]||[],d[g].push({rule:p,value:a,source:i,field:g}))})});var D={};return Hf(d,o,function(g,A){var p=g.rule,y=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");y=y&&(p.required||!p.required&&g.value),p.field=g.field;function m(S,I){return Ue(Ue({},I),{},{fullField:p.fullField+"."+S})}function C(S){S===void 0&&(S=[]);var I=S;if(Array.isArray(I)||(I=[I]),!o.suppressWarning&&I.length&&rt.warning("async-validator:",I),I.length&&p.message!==void 0&&(I=[].concat(p.message)),I=I.map(ku(p)),o.first&&I.length)return D[p.field]=1,A(I);if(!y)A(I);else{if(p.required&&!g.value)return p.message!==void 0?I=[].concat(p.message).map(ku(p)):o.error&&(I=[o.error(p,Me(o.messages.required,p.field))]),A(I);var j={};if(p.defaultField)for(var H in g.value)g.value.hasOwnProperty(H)&&(j[H]=p.defaultField);j=Ue(Ue({},j),g.rule.fields);for(var z in j)if(j.hasOwnProperty(z)){var x=Array.isArray(j[z])?j[z]:[j[z]];j[z]=x.map(m.bind(null,z))}var P=new rt(j);P.messages(o.messages),g.rule.options&&(g.rule.options.messages=o.messages,g.rule.options.error=o.error),P.validate(g.value,g.rule.options||o,function(G){var Z=[];I&&I.length&&Z.push.apply(Z,I),G&&G.length&&Z.push.apply(Z,G),A(Z.length?Z:null)})}}var w;p.asyncValidator?w=p.asyncValidator(p,g.value,C,g.source,o):p.validator&&(w=p.validator(p,g.value,C,g.source,o),w===!0?C():w===!1?C(p.message||p.field+" fails"):w instanceof Array?C(w):w instanceof Error&&C(w.message)),w&&w.then&&w.then(function(){return C()},function(S){return C(S)})},function(g){c(g)})},getType:function(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!zt.hasOwnProperty(t.type))throw new Error(Me("Unknown rule type %s",t.type));return t.type||"string"},getValidationMethod:function(t){if(typeof t.validator=="function")return t.validator;var n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?zt.required:zt[this.getType(t)]||!1}},rt.register=function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");zt[t]=n},rt.warning=Tu,rt.messages=gr,rt.validators=zt;var f0={required:"%s \u5FC5\u586B",maxLength:"%s \u8D85\u51FA\u6700\u5927\u957F\u5EA6\u9650\u5236",minLength:"%s \u5C0F\u4E8E\u6700\u5C0F\u957F\u5EA6\u9650\u5236",string:{range:"%s \u4E0D\u5728\u6307\u5B9A\u957F\u5EA6\u5185"}};function d0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new rt(e);return n.messages(Object.assign(f0,t)),n}var h0=new Fu;function vr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p0(e){if(Array.isArray(e))return e}function D0(e){if(Array.isArray(e))return vr(e)}function Vu(e,t,n,r,u,i,o){try{var s=e[i](o),c=s.value}catch(f){n(f);return}s.done?t(c):Promise.resolve(c).then(r,u)}function Hu(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(c){Vu(i,r,u,o,s,"next",c)}function s(c){Vu(i,r,u,o,s,"throw",c)}o(void 0)})}}function g0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function v0(e,t,n){return t&&zu(e.prototype,t),n&&zu(e,n),e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wu(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Zu(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y0(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m0(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(u){return Object.getOwnPropertyDescriptor(n,u).enumerable}))),r.forEach(function(u){J(e,u,n[u])})}return e}function E0(e){return p0(e)||Zu(e)||Gu(e)||y0()}function yr(e){return D0(e)||Zu(e)||Gu(e)||m0()}function A0(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Gu(e,t){if(!!e){if(typeof e=="string")return vr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vr(e,t)}}function Xu(e,t){var n,r,u,i,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(u=f[0]&2?r.return:f[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,f[1])).done)return u;switch(r=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,r=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(u=o.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){o.label=f[1];break}if(f[0]===6&&o.label<u[1]){o.label=u[1],u=f;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(f);break}u[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(l){f=[6,l],r=0}finally{n=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var ge=function(){function t(n){var r=this;g0(this,t),J(this,"id",void 0),J(this,"name",void 0),J(this,"icon",void 0),J(this,"type",void 0),J(this,"controlType",void 0),J(this,"props",void 0),J(this,"setting",[]),J(this,"fieldType",void 0),J(this,"eventKeys",[]),J(this,"customEvents",[]),J(this,"parent",null),J(this,"slots",void 0),J(this,"slotPosition",void 0),J(this,"updateSetting",Qu),J(this,"removeSetting",Ku),this._callControlHooks("preInstance",n);var u=Wu(this,t)?this.constructor:void 0,i=u.controlName,o=u.controlIcon,s=u.controlType,c=u.controlFieldType,f=u.controlEventKeys,l=u.controlCustomEvents,a=u.name,d=u.setting,h=u.slots,D=u.slotPosition;i&&o&&s||du("The ".concat(a," controlName,controlIcon,controlType is not define"));var g;this.id=(g=n==null?void 0:n.id)!==null&&g!==void 0?g:nn(10),this.name=i,this.icon=o;var A;this.type=(A=n==null?void 0:n.type)!==null&&A!==void 0?A:s,this.props=new Xe(n==null?void 0:n.props,(Wu(this,t)?this.constructor:void 0).controlName);var p;this.controlType=(p=n==null?void 0:n.controlType)!==null&&p!==void 0?p:"base",this.setting=K(d);var y;this.fieldType=(y=n==null?void 0:n.fieldType)!==null&&y!==void 0?y:c,this.eventKeys=K(f),this.customEvents=K(l),this.slots=K(h),this.slotPosition=K(D),Promise.resolve().then(function(){r._callControlHooks("postInstance",n)})}return v0(t,[{key:"rules",get:function(){var r=this.props.constructor.Rules;return r?new r(this.props):{}}},{key:"_callControlHooks",value:function(){for(var r=arguments.length,u=new Array(r),i=0;i<r;i++)u[i]=arguments[i];var o,s=E0(u),c=s[0],f=s.slice(1);return(o=h0).emit.apply(o,[c,this].concat(yr(f)))}},{key:"preUpdate",value:function(r,u){this._callControlHooks("preUpdateProps",r,u)}},{key:"postUpdate",value:function(r,u){this._callControlHooks("postUpdateProps",r,u)}},{key:"updateProps",value:function(r,u){this.preUpdate(r,u),Zn(this.props,r,u),this.postUpdate(r,u)}},{key:"preValidate",value:function(){var r=this;return Hu(function(){var u,i,o;return Xu(this,function(s){switch(s.label){case 0:return u=Ju({},r.rules),[4,r._callControlHooks("preValidate",u)];case 1:return i=s.sent(),o=i[i.length-1],[2,o===!1?void 0:o]}})})()}},{key:"validate",value:function(r,u){var i=this;return Hu(function(){var o,s,c,f;return Xu(this,function(l){switch(l.label){case 0:return[4,i.preValidate()];case 1:o=l.sent(),s=o!==void 0?o:Ju({},i.rules),Array.isArray(u)&&u.forEach(function(a){s.hasOwnProperty(a)&&delete s[a]}),c=d0(s,r),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,c.validate(i.props)];case 3:return l.sent(),[2,!0];case 4:throw f=l.sent(),f.control||(f.control=i),f;case 5:return[2]}})})()}},{key:"toDataBindModel",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,u=this.fieldType,i=this.id,o=this.type,s=this.props,c=s.dataBind,f=s.datasourceBind,l=s.optionConfig,a=s.caption,d=s.required,h=s.maxLength,D=s.options,g=s.encrypted,A=s.encryptedMode;if(!(!u&&!c&&!f)){var p={parentId:r,fieldType:u,controlId:i,caption:a,type:o,props:{}};switch(c&&(p.dataBind=c),l){case"datasource":case void 0:f&&(p.datasourceBind=f);break;case"custom":p.props.options=D;break}return d!==void 0&&(p.required=d),h!==void 0&&(p.maxLength=h),g!==void 0&&(p.encrypted=g),A!==void 0&&(p.encryptedMode=A),p}}},{key:"preToSchema",value:function(){this._callControlHooks("preToSchema",this)}},{key:"toSchema",value:function(){return this.preToSchema(),{id:this.id,type:this.type,props:K(this.props),fieldType:this.fieldType,controlType:this.controlType}}}],[{key:"updateBasicControl",value:function(r,u){if(r==="setting"){if(u.add){var i;(i=this.setting).push.apply(i,yr(u.add))}u.remove&&this.removeSettingItem(u.remove),u.update}}}]),t}();J(ge,"mode","Designer"),J(ge,"slots",void 0),J(ge,"slotPosition",void 0),J(ge,"controlName","\u63A7\u4EF6"),J(ge,"controlIcon","icon"),J(ge,"controlType","control"),J(ge,"controlFieldType",void 0),J(ge,"controlEventKeys",[]),J(ge,"controlCustomEvents",[]),J(ge,"setting",[]),J(ge,"__is_control__",!0),J(ge,"removeSettingItem",Ku),J(ge,"updateSettingItem",Qu);function Ku(e){var t=this,n=Array.isArray(e)?e:[e];n.forEach(function(r){var u,i=typeof r!="string",o=(u=t.setting)===null||u===void 0?void 0:u.findIndex(function(f){return f.key===(i?r.key:r)});if(o!==-1){var s,c;i?t.setting[o].showItems=(s=t.setting[o].showItems)===null||s===void 0?void 0:s.filter(function(f){return!r.hideItems.includes(f)}):t.setting.splice(o,1),i&&!(!((c=t.setting[o].showItems)===null||c===void 0)&&c.length)&&t.setting.splice(o,1)}})}function Qu(e,t){var n=this,r=typeof e=="string"?[e]:e;r.forEach(function(u){var i=n.setting.find(function(f){return f.key===u});if(i){if(typeof t=="boolean")i.visible=t;else if((typeof t=="undefined"?"undefined":A0(t))==="object"){var o,s=(o=t.type)!==null&&o!==void 0?o:"replace";if(s==="replace")i.showItems=t.showItems;else{var c;(c=i.showItems).push.apply(c,yr(t.showItems))}}}})}function C0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function F0(e,t,n){return t&&Yu(e.prototype,t),n&&Yu(e,n),e}function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w0(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Wt=function(){function t(n){C0(this,t),Ie(this,"id",void 0),Ie(this,"type",void 0),Ie(this,"controlType",void 0),Ie(this,"props",void 0),Ie(this,"fieldType",void 0),Ie(this,"customEvents",[]),Ie(this,"pageStatus",void 0),Ie(this,"parent",null);var r=w0(this,t)?this.constructor:void 0,u=r.controlType,i=r.controlFieldType,o=r.name,s=r.controlCustomEvents;u||du("The ".concat(o," controlType is not define"));var c;this.id=(c=n==null?void 0:n.id)!==null&&c!==void 0?c:nn(10);var f;this.type=(f=n==null?void 0:n.type)!==null&&f!==void 0?f:u,this.props=new Xe(n==null?void 0:n.props),this.customEvents=s;var l;this.controlType=(l=n==null?void 0:n.controlType)!==null&&l!==void 0?l:"base";var a;this.fieldType=(a=n==null?void 0:n.fieldType)!==null&&a!==void 0?a:i;var d;this.pageStatus=(d=n==null?void 0:n.pageStatus)!==null&&d!==void 0?d:or.UNKNOWN}return F0(t,[{key:"rules",get:function(){var r=this.props.constructor.RuntimeRules;if(r){var u=new r(this.props);return Array.from(u)}return[]}}]),t}();Ie(Wt,"mode","Runtime"),Ie(Wt,"controlType","control"),Ie(Wt,"controlFieldType",void 0),Ie(Wt,"__is_control__",!0),Ie(Wt,"controlCustomEvents",[]);function Ne(e){return(e==null?void 0:e.dataCode)!==void 0&&(e==null?void 0:e.fieldCode)!==void 0}function fe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(e){return fn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fn(e)}function Er(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ar(e,t)}function b0(e,t){return t&&(B0(t)==="object"||typeof t=="function")?t:fe(e)}function Ar(e,t){return Ar=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Ar(e,t)}function B0(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Cr(e){var t=_0();return function(){var r=fn(e),u;if(t){var i=fn(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return b0(this,u)}}var S0=function(e){Er(n,e);var t=Cr(n);function n(r){mr(this,n);var u;u=t.call(this,r),ae(fe(u),"dataBind",{}),ae(fe(u),"caption",{type:"string",required:!0,message:Se.getMessage("pleaseEnterCaption")}),ae(fe(u),"isHideCaption",{type:"boolean"}),ae(fe(u),"labelPosition",{type:"enum",enum:["top","left"]}),ae(fe(u),"defaultState",{type:"enum",enum:["default","readonly"]}),ae(fe(u),"required",{type:"boolean"}),ae(fe(u),"captionTip",{type:"string",required:!1,message:Se.getMessage("pleaseEnterCaptionTip")});var i={fieldCode:{type:"string",required:!0,message:Se.getMessage("pleaseEnterFieldCode")},dataCode:{type:"string",required:!0,message:Se.getMessage("pleaseEnterFieldCode")}};if(Ne(r.dataBind))u.dataBind={type:"object",required:!0,fields:K(i),message:Se.getMessage("pleaseEnterFieldCode")};else{var o={type:"object",required:!0,fields:{},message:Se.getMessage("pleaseEnterFieldCode")};Object.keys(r.dataBind).forEach(function(s){o.fields[s]={type:"object",required:!0,fields:K(i),message:Se.getMessage("pleaseEnterFieldCode")}}),u.dataBind=o}return r.isShowCaptionTip&&(u.captionTip.required=!0),u}return n}(cr),M0=function(e){Er(n,e);var t=Cr(n);function n(r){mr(this,n);var u;u=t.call(this,r);var i=r.isHide?!1:r.required;return i&&u.push({type:"string",required:i,message:r.requiredMessage!==""?r.requiredMessage:Se.getMessage("runtimeRequired",{caption:r.caption})}),u}return n}(Pu),Fr=function(e){Er(n,e);var t=Cr(n);function n(r){mr(this,n);var u;u=t.call(this,r),ae(fe(u),"caption",void 0),ae(fe(u),"isHideCaption",void 0),ae(fe(u),"isShowCaptionTip",void 0),ae(fe(u),"captionTip",void 0),ae(fe(u),"labelPosition",void 0),ae(fe(u),"dataBind",void 0),ae(fe(u),"defaultValue",void 0),ae(fe(u),"placeholder",void 0),ae(fe(u),"defaultState",void 0),ae(fe(u),"required",void 0),ae(fe(u),"requiredMessage",void 0);var i;u.caption=(i=r==null?void 0:r.caption)!==null&&i!==void 0?i:"";var o;u.isHideCaption=(o=r==null?void 0:r.isHideCaption)!==null&&o!==void 0?o:!1;var s;u.isShowCaptionTip=(s=r==null?void 0:r.isShowCaptionTip)!==null&&s!==void 0?s:!1;var c;u.captionTip=(c=r==null?void 0:r.captionTip)!==null&&c!==void 0?c:"";var f;u.defaultState=(f=r==null?void 0:r.defaultState)!==null&&f!==void 0?f:"default";var l;u.labelPosition=(l=r==null?void 0:r.labelPosition)!==null&&l!==void 0?l:"top";var a;u.placeholder=(a=r==null?void 0:r.placeholder)!==null&&a!==void 0?a:"";var d;u.required=(d=r==null?void 0:r.required)!==null&&d!==void 0?d:!1;var h;u.requiredMessage=(h=r==null?void 0:r.requiredMessage)!==null&&h!==void 0?h:"",u.dataBind=new tr(r==null?void 0:r.dataBind);var D;return u.defaultValue=(D=r==null?void 0:r.defaultValue)!==null&&D!==void 0?D:"",u}return n}(Xe);ae(Fr,"Rules",S0),ae(Fr,"RuntimeRules",M0);function wr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hn(e){return hn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},hn(e)}function N0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&br(e,t)}function O0(e,t){return t&&(x0(t)==="object"||typeof t=="function")?t:wr(e)}function br(e,t){return br=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},br(e,t)}function x0(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function R0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function $0(e){var t=R0();return function(){var r=hn(e),u;if(t){var i=hn(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return O0(this,u)}}var ei=function(e){N0(n,e);var t=$0(n);function n(r){I0(this,n);var u;return u=t.call(this,r),dn(wr(u),"controlType","form"),dn(wr(u),"props",void 0),u.props=new Fr(r==null?void 0:r.props),u}return n}(ge);dn(ei,"controlEventKeys",["on_change","on_focus","on_blur"]),dn(ei,"controlCustomAttributes",void 0);function P0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},pn(e)}function j0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Br(e,t)}function L0(e,t){return t&&(k0(t)==="object"||typeof t=="function")?t:P0(e)}function Br(e,t){return Br=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Br(e,t)}function k0(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function q0(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function U0(e){var t=q0();return function(){var r=pn(e),u;if(t){var i=pn(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return L0(this,u)}}var V0=function(e){j0(n,e);var t=U0(n);function n(r){return T0(this,n),t.call(this,r)}return n}(Xe);function _r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function H0(e){if(Array.isArray(e))return _r(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ti(e,t,n,r,u,i,o){try{var s=e[i](o),c=s.value}catch(f){n(f);return}s.done?t(c):Promise.resolve(c).then(r,u)}function z0(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(c){ti(i,r,u,o,s,"next",c)}function s(c){ti(i,r,u,o,s,"throw",c)}o(void 0)})}}function W0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ni(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Z0(e,t,n){return t&&ni(e.prototype,t),n&&ni(e,n),e}function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(e,t,n){return typeof Reflect!="undefined"&&Reflect.get?Ft=Reflect.get:Ft=function(u,i,o){var s=nd(u,i);if(!!s){var c=Object.getOwnPropertyDescriptor(s,i);return c.get?c.get.call(o||u):c.value}},Ft(e,t,n||e)}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},it(e)}function J0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sr(e,t)}function G0(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function X0(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function K0(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Q0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(u){return Object.getOwnPropertyDescriptor(n,u).enumerable}))),r.forEach(function(u){ut(e,u,n[u])})}return e}function Y0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,r)}return n}function ed(e,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Y0(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function td(e,t){return t&&(rd(t)==="object"||typeof t=="function")?t:pt(e)}function Sr(e,t){return Sr=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Sr(e,t)}function nd(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=it(e),e!==null););return e}function ri(e){return H0(e)||X0(e)||ud(e)||K0()}function rd(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function ud(e,t){if(!!e){if(typeof e=="string")return _r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _r(e,t)}}function id(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function od(e){var t=id();return function(){var r=it(e),u;if(t){var i=it(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return td(this,u)}}function ad(e,t){var n,r,u,i,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(u=f[0]&2?r.return:f[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,f[1])).done)return u;switch(r=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,r=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(u=o.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){o.label=f[1];break}if(f[0]===6&&o.label<u[1]){o.label=u[1],u=f;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(f);break}u[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(l){f=[6,l],r=0}finally{n=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var sd=1e4,ui=function(t){J0(r,t);var n=od(r);function r(u){W0(this,r);var i;i=n.call(this,u),ut(pt(i),"controlType","layout"),ut(pt(i),"children",void 0),ut(pt(i),"excludes",void 0),ut(pt(i),"childrenMaxLength",void 0),ut(pt(i),"props",void 0);var o=G0(this,r)?this.constructor:void 0,s=o.excludes,c=o.childrenMaxLength;return i.props=new V0(u==null?void 0:u.props),er(pt(i),"children",u==null?void 0:u.children,void 0,"Designer"),i.excludes=K(s),i.childrenMaxLength=c,i}return Z0(r,[{key:"judgeExcludesChildren",value:function(i){return this.excludes===!1||Array.isArray(this.excludes)&&!this.excludes.includes(i)}},{key:"judgeJoinChildren",value:function(i){var o=this.judgeExcludesChildren(i);return o&&this.childrenMaxLength>this.children.length}},{key:"validate",value:function(i,o){var s=this,c=this,f=function(){return Ft(it(r.prototype),"validate",s)};return z0(function(){return ad(this,function(l){switch(l.label){case 0:return[4,f().call(c,i,o)];case 1:return l.sent(),[4,Promise.all(c.children.map(function(a){return a.validate(i,o)}))];case 2:return l.sent(),[2,!0]}})})()}},{key:"toDataBindModel",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=Ft(it(r.prototype),"toDataBindModel",this).call(this),s=o?[o]:[];return this.children.reduce(function(c,f){var l=f.toDataBindModel(i);if(Array.isArray(l)){var a=l.filter(function(d){return!!d});return ri(c).concat(ri(a))}return l&&c.push(l),c},s)}},{key:"toSchema",value:function(){var i=Ft(it(r.prototype),"toSchema",this).call(this),o=this.children.map(function(s){var c=s.toSchema();return c});return ed(Q0({},i),{children:o})}}]),r}(ge);ut(ui,"excludes",!1),ut(ui,"childrenMaxLength",sd);function Ke(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e){return Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Dn(e)}function ld(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mr(e,t)}function fd(e,t){return t&&(dd(t)==="object"||typeof t=="function")?t:Ke(e)}function Mr(e,t){return Mr=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Mr(e,t)}function dd(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function hd(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function pd(e){var t=hd();return function(){var r=Dn(e),u;if(t){var i=Dn(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return fd(this,u)}}var Dd=function(e){ld(n,e);var t=pd(n);function n(r,u,i){cd(this,n);var o;o=t.call(this,u),wt(Ke(o),"headers",void 0),wt(Ke(o),"footers",void 0),wt(Ke(o),"pageIndex",void 0),wt(Ke(o),"pageSize",void 0),wt(Ke(o),"pageSizeOptions",void 0),wt(Ke(o),"totalCount",void 0),er(Ke(o),"headers",u==null?void 0:u.headers,r,i),er(Ke(o),"footers",u==null?void 0:u.footers,r);var s;o.pageIndex=(s=u==null?void 0:u.pageIndex)!==null&&s!==void 0?s:1;var c;o.pageSize=(c=u==null?void 0:u.pageSize)!==null&&c!==void 0?c:20;var f;o.pageSizeOptions=(f=u==null?void 0:u.pageSizeOptions)!==null&&f!==void 0?f:[20];var l;return o.totalCount=(l=u==null?void 0:u.totalCount)!==null&&l!==void 0?l:0,o}return n}(Xe);function Ir(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gd(e){if(Array.isArray(e))return Ir(e)}function gn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ii(e,t,n,r,u,i,o){try{var s=e[i](o),c=s.value}catch(f){n(f);return}s.done?t(c):Promise.resolve(c).then(r,u)}function vd(e){return function(){var t=this,n=arguments;return new Promise(function(r,u){var i=e.apply(t,n);function o(c){ii(i,r,u,o,s,"next",c)}function s(c){ii(i,r,u,o,s,"throw",c)}o(void 0)})}}function yd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function md(e,t,n){return t&&oi(e.prototype,t),n&&oi(e,n),e}function vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t,n){return typeof Reflect!="undefined"&&Reflect.get?bt=Reflect.get:bt=function(u,i,o){var s=bd(u,i);if(!!s){var c=Object.getOwnPropertyDescriptor(s,i);return c.get?c.get.call(o||u):c.value}},bt(e,t,n||e)}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ot(e)}function Ed(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nr(e,t)}function Ad(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cd(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ai(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(u){return Object.getOwnPropertyDescriptor(n,u).enumerable}))),r.forEach(function(u){vn(e,u,n[u])})}return e}function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,r)}return n}function si(e,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fd(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wd(e,t){return t&&(Bd(t)==="object"||typeof t=="function")?t:gn(e)}function Nr(e,t){return Nr=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Nr(e,t)}function bd(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=ot(e),e!==null););return e}function ci(e){return gd(e)||Ad(e)||_d(e)||Cd()}function Bd(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _d(e,t){if(!!e){if(typeof e=="string")return Ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ir(e,t)}}function Sd(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Md(e){var t=Sd();return function(){var r=ot(e),u;if(t){var i=ot(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return wd(this,u)}}function Id(e,t){var n,r,u,i,o={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(f){return function(l){return c([f,l])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(u=f[0]&2?r.return:f[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,f[1])).done)return u;switch(r=0,u&&(f=[f[0]&2,u.value]),f[0]){case 0:case 1:u=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,r=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(u=o.trys,!(u=u.length>0&&u[u.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){o.label=f[1];break}if(f[0]===6&&o.label<u[1]){o.label=u[1],u=f;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(f);break}u[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(l){f=[6,l],r=0}finally{n=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var Nd=function(e){Ed(n,e);var t=Md(n);function n(r){yd(this,n);var u;return u=t.call(this,r),vn(gn(u),"controlType","list"),vn(gn(u),"props",void 0),u.props=new Dd(gn(u),r==null?void 0:r.props,"Designer"),u}return md(n,[{key:"validate",value:function(u,i){var o=this,s=this,c=function(){return bt(ot(n.prototype),"validate",o)};return vd(function(){return Id(this,function(f){switch(f.label){case 0:return[4,c().call(s,u)];case 1:return f.sent(),[4,Promise.all(s.props.headers.map(function(l){return l.validate(u,i)}))];case 2:return f.sent(),[2,!0]}})})()}},{key:"toDataBindModel",value:function(){var u=bt(ot(n.prototype),"toDataBindModel",this).call(this),i=u?[u]:[],o=this.id;return this.props.headers.reduce(function(s,c){var f=c.toDataBindModel(o);if(Array.isArray(f)){var l=f.filter(function(a){return!!a});return ci(s).concat(ci(l))}return f&&s.push(f),s},i)}},{key:"toSchema",value:function(){var u=bt(ot(n.prototype),"toSchema",this).call(this),i=this.props.headers.map(function(o){return o.toSchema()});return si(ai({},u),{props:si(ai({},this.props),{headers:i})})}}]),n}(ge);vn(Nd,"controlFieldType",oe.LIST);function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function li(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yn(e){return yn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},yn(e)}function fi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Or(e,t)}function Od(e,t){return t&&(xd(t)==="object"||typeof t=="function")?t:Ce(e)}function Or(e,t){return Or=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},Or(e,t)}function xd(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Rd(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function di(e){var t=Rd();return function(){var r=yn(e),u;if(t){var i=yn(this).constructor;u=Reflect.construct(r,arguments,i)}else u=r.apply(this,arguments);return Od(this,u)}}var $d=function(e){fi(n,e);var t=di(n);function n(r){li(this,n);var u;return u=t.call(this,r),Fe(Ce(u),"caption",{type:"string",required:!0,message:Se.getMessage("pleaseEnterCaption")}),Fe(Ce(u),"width",{type:"number",required:!1,message:Se.getMessage("pleaseEnterColumnWidth")}),u.width.required=r.widthType==="px",u}return n}(cr),Pd=function(e){fi(n,e);var t=di(n);function n(r){li(this,n);var u;u=t.call(this,r),Fe(Ce(u),"widthType",void 0),Fe(Ce(u),"width",void 0),Fe(Ce(u),"caption",void 0),Fe(Ce(u),"dataBind",void 0),Fe(Ce(u),"autoWidth",void 0),Fe(Ce(u),"fixed",void 0),Fe(Ce(u),"sort",void 0),Fe(Ce(u),"align",void 0),Fe(Ce(u),"colSpan",void 0),Fe(Ce(u),"autoHeight",void 0),Fe(Ce(u),"children",void 0);var i;u.width=(i=r==null?void 0:r.width)!==null&&i!==void 0?i:150,u.widthType=(r==null?void 0:r.widthType)||"auto";var o;u.caption=(o=r==null?void 0:r.caption)!==null&&o!==void 0?o:"";var s;u.fixed=(s=r==null?void 0:r.fixed)!==null&&s!==void 0?s:"none",u.autoWidth=new Mf(r==null?void 0:r.autoWidth),u.dataBind=new tr(r==null?void 0:r.dataBind);var c;u.sort=(c=r==null?void 0:r.sort)!==null&&c!==void 0?c:!0,u.align=r==null?void 0:r.align,u.colSpan=r==null?void 0:r.colSpan;var f;return u.autoHeight=(f=r==null?void 0:r.autoHeight)!==null&&f!==void 0?f:!1,u}return n}(Xe);Fe(Pd,"Rules",$d);function mn(e){return e.controlType===V.LAYOUT||e.controlType===V.WRAP||e.controlType===V.LIST||e.controlType===V.SEARCH||e.controlType===V.COLUMN&&e.type!==ne.OPERATION_COLUMN}function Dt(e,t){Array.isArray(e)&&e.map(n=>{n.controlType===V.LIST?t(n,[]):mn(n)?Dt(n==null?void 0:n.children,t):n.controlType===V.FORM&&t(n)})}function gt(e,t){Array.isArray(e)&&e.map(n=>{n.type===ne.DATA_VIEW||n.type===ne.SIMPLE_SEARCH?t(n):mn(n)&&gt(n==null?void 0:n.children,t)})}let hi=0;function Zt(e=""){const t=Date.now(),n=Math.floor(Math.random()*1e9);return hi++,e+"_"+n+hi+String(t)}class me extends qt{constructor(t){super("Runtime"),this._flatInstances=[],this._instanceMap={},this._controlParentIdMap={};const{schema:n}=t;this._schema=n,this._instance=this.createControl(n,t.beforeCreateInstance),this.getFlatInstances()}getFlatInstances(){const t=[],n={},r={};return xr(this._instance,"",(u,i)=>{var o;i&&(r[u.id]=i),n[u.id]||(n[u.id]=[]),!(u.type==="subtable-column"&&n[u.id].length>0)&&(t.push(u),!(((o=u.parent)==null?void 0:o.type)===ne.SUBTABLE_COLUMN&&u.parent.parent===void 0)&&n[u.id].push(u))}),this._flatInstances=t,this._instanceMap=n,this._controlParentIdMap=r,this._flatInstances}get schema(){return this._schema}get instance(){return this._instance}get flatInstances(){return this._flatInstances}get instanceMap(){return this._instanceMap}get allRules(){let t={},n={},r={};return gt(this._instance,u=>{let i=me.staticGetRules(u.type,u.props);n[u.id]=K(i[0]),t[u.id]=K(i[0]),r[u.id]=K(i[0]),Dt(u.children,o=>{(o.controlType===V.FORM||o.controlType===V.LIST)&&(pi(n[u.id].fields,o,!0),vi(t[u.id].fields,o,!0),Di(r[u.id].fields,o,!0))})}),{rules:this.rules,antdRules:this.antdRules,fieldCodeRules:this.fieldCodeRules,defaultAntdRules:t,defaultRule:n,defaultFieldRules:r}}get rules(){let t={};return gt(this._instance,n=>{let r=me.staticGetRules(n.type,n.props);t[n.id]=r[0],Dt(n.children,u=>{(u.controlType===V.FORM||u.controlType===V.LIST)&&pi(t[n.id].fields,u)})}),t}get fieldCodeRules(){let t={};return gt(this._instance,n=>{let r=me.staticGetRules(n.type,n.props);t[n.id]=r[0],Dt(n.children,u=>{(u.controlType===V.FORM||u.controlType===V.LIST)&&Di(t[n.id].fields,u)})}),t}get antdRules(){let t={};return gt(this._instance,n=>{let r=me.staticGetRules(n.type,n.props);t[n.id]=r[0],Dt(n.children,u=>{(u.controlType===V.FORM||u.controlType===V.LIST)&&vi(t[n.id].fields,u)})}),t}}function xr(e,t,n){(Array.isArray(e)?e:[e]).map(u=>{if(n(u,t),mn(u)){const i=u;i.children||(i.children=[]),xr(i.children,i.id,n)}Td(u,"headers")&&xr(u.props.headers,u.id,n)})}function Td(e,t){return t in e.props&&dt(e.props[t])}function En(e){return e.props.isHide?!0:e.parent===null||e.parent===void 0?!1:En(e.parent)}function pi(e,t,n=!1){if(En(t))return;let r=me.staticGetRules(t.type,t.props);if(t.controlType===V.FORM)e[t.id]=r;else if(t.type===ne.SUBTABLE){e[t.id]=r;const u={type:"array",fields:{}};(n===!0?[{children:t.props.headers}]:t.children).forEach((i,o)=>{Je(i.children,s=>{if(u.fields){u.fields[o]||(u.fields[o]={type:"object",required:!0,fields:{}});let c=me.staticGetRules(s.type,s.props);u.fields[o].fields[s.id]=c}})}),e[t.id].push(u)}}function Di(e,t,n=!1){var u,i,o,s,c,f,l;if(En(t))return;let r=me.staticGetRules(t.type,t.props);if(t.controlType===V.FORM)if(Ne(t.props.dataBind))((u=t.props.dataBind)==null?void 0:u.fieldCode)!=""&&(e[(i=t.props.dataBind)==null?void 0:i.fieldCode]=r);else for(const a in t.props.dataBind)((o=t.props.dataBind[a])==null?void 0:o.fieldCode)!=""&&(e[(s=t.props.dataBind[a])==null?void 0:s.fieldCode]=((c=gi(r))==null?void 0:c[a])||[]);else if(t.type===ne.SUBTABLE){e[(f=t.props.datasourceBind)==null?void 0:f.dataCode]=r;const a={type:"array",fields:{}};(n===!0?[{children:t.props.headers}]:t.children).forEach((d,h)=>{Je(d.children,D=>{var g,A,p,y;if(a.fields){a.fields[h]||(a.fields[h]={type:"object",required:!0,fields:{}});let m=me.staticGetRules(D.type,D.props);if(Ne(D.props.dataBind))((p=D.props.dataBind)==null?void 0:p.fieldCode)!=""&&(a.fields[h].fields[(y=D.props.dataBind)==null?void 0:y.fieldCode]=m);else for(const C in D.props.dataBind)((g=D.props.dataBind[C])==null?void 0:g.fieldCode)!=""&&(a.fields[h].fields[D.props.dataBind[C].fieldCode]=((A=gi(m))==null?void 0:A[C])||[])}})}),e[(l=t.props.datasourceBind)==null?void 0:l.dataCode].push(a)}}function gi(e){let t={};return e.map(n=>{n.fields&&(t=n)}),t==null?void 0:t.fields}function vi(e,t,n=!1){if(En(t))return;let r=me.staticGetRules(t.type,t.props);t.controlType===V.FORM?e[t.id]=r:t.type===ne.SUBTABLE&&t.children.length&&(e[t.id]=[],(n===!0?[{children:t.props.headers}]:t.children).forEach(u=>{let i={};Je(u.children,o=>{let s=me.staticGetRules(o.type,o.props);i[o.id]=s}),e[t.id].push(i)}))}class jd{constructor(t){const{state:n,emptyState:r,databindMapping:u,controlidMapping:i,defaultState:o,subtableHeadersControlIdMapping:s}=Ld(t.instance);this.emptyState=r,this.state=n,this.dataBindMapping=u,this.controlIdMapping=i,this.defaultState=o,this.subtableHeadersControlIdMapping=s}setState(t,n,r){const u=this.controlIdMapping[t],i=K(n);u!==void 0?(u.children&&n.forEach(o=>{o.uid||Object.assign(o,{uid:"new:"+Zt("uid")})}),this.state[u.dataView][t]=i):r!==void 0?Object.keys(this.controlIdMapping).map(o=>{const s=this.controlIdMapping[o].dataView,c=this.controlIdMapping[o].children;c!==void 0&&Object.keys(c).map(f=>{f===t&&this.state[s][o][r]&&(this.state[s][o][r][t]=i)})}):this.state[t]=i}getState(t,n){var u;if(this.state[t]!==void 0)return this.state[t];{const i=this.controlIdMapping[t];if(i!==void 0){const o=this.state[i.dataView][t];return n!==void 0&&Object.keys((u=i==null?void 0:i.children)!=null?u:{}).length>0?o[n]:o}else if(n!==void 0){let o;return Object.keys(this.controlIdMapping).map(s=>{const c=this.controlIdMapping[s].dataView,f=this.controlIdMapping[s].children;f!==void 0&&Object.keys(f).map(l=>{var a;l===t&&(o=(a=this.state[c][s][n])==null?void 0:a[t])})}),o}else{let o=[];return Object.keys(this.controlIdMapping).map(s=>{const c=this.controlIdMapping[s].dataView,f=this.controlIdMapping[s].children;f!==void 0&&Object.keys(f).map(l=>{l===t&&this.state[c][s].map(a=>{o.push(a[t])})})}),o}}}getEmptyState(t){if(this.emptyState[t]!==void 0)return this.emptyState[t];{const r=this.controlIdMapping[t];if(r!==void 0){const u=this.emptyState[r.dataView][t];return"children"in r&&Object.assign(u,{uid:"new:"+Zt("uid")}),u}else{let u;return Object.keys(this.controlIdMapping).map(i=>{const o=this.controlIdMapping[i].dataView,s=this.controlIdMapping[i].children;s!==void 0&&Object.keys(s).map(c=>{c===t&&(u=this.emptyState[o][i][t])})}),u}}}getDataBind(t){let n=this.controlIdMapping[t];if(n)return n.dataBind;e:for(let r in this.controlIdMapping){const u=this.controlIdMapping[r];if(u.children){for(let i in u.children)if(i===t){n=u.children[i];break e}}}return n==null?void 0:n.dataBind}}function Ld(e){let t={},n={},r={},u={},i={},o={};return gt(e,s=>{const c=s.id,f={},l={};Dt([s],(a,d)=>{kd(f,l,a),qd(r,c,a),Ud(u,c,a),Vd(i,a)}),t[c]={},o[c]=f,n[c]=l}),{state:t,defaultState:o,subtableHeadersControlIdMapping:i,emptyState:n,databindMapping:r,controlidMapping:u}}function kd(e,t,n){var r,u;if(n.controlType===V.FORM)e[n.id]=K(n.props.defaultValue),t[n.id]=K(n.props.defaultValue);else{const i={};Je(n.props.headers,o=>{i[o.id]=K(o.props.defaultValue)}),e[n.id]=(u=new Array((r=n.props.defaultRows)!=null?r:1).fill(0).map(()=>ie({uid:"new:"+Zt("uid")},K(i))))!=null?u:[],t[n.id]=i}}function qd(e,t,n){var r,u;if(n.controlType===V.FORM)Ne(n.props.dataBind)?((u=(r=n.props)==null?void 0:r.dataBind)==null?void 0:u.dataCode)===void 0||(e[n.props.dataBind.dataCode]===void 0&&(e[n.props.dataBind.dataCode]={controlId:t,fields:[],dataViewId:t}),e[n.props.dataBind.dataCode].fields.push({fieldCode:n.props.dataBind.fieldCode,controlId:n.id,dataBind:n.props.dataBind,dataViewId:[t]})):Object.keys(n.props.dataBind).map(i=>{const o=n.props.dataBind,s=o[i].dataCode;s!==void 0&&(e[s]===void 0&&(e[s]={controlId:n.id,fields:[],dataViewId:t}),e[s].fields.push({fieldCode:o[i].fieldCode,controlId:n.id,dataBind:o,dataViewId:[t]}))});else{if(n.props.datasourceBind.dataCode===""){At(`datasourceBind.dataCode is empty! maybe in preview mode, control:${n.id} type:${n.type}`);return}e[n.props.datasourceBind.dataCode]={controlId:n.id,fields:[],dataViewId:t};const i=n.id;Je(n.props.headers,o=>{Ne(o.props.dataBind)?(e[o.props.dataBind.dataCode]===void 0&&(e[o.props.dataBind.dataCode]={controlId:t,fields:[],dataViewId:t}),e[o.props.dataBind.dataCode].fields.push({fieldCode:o.props.dataBind.fieldCode,controlId:o.id,dataBind:o.props.dataBind,dataViewId:[t,i]})):Object.keys(o.props.dataBind).map(s=>{const c=o.props.dataBind,f=c[s].dataCode;e[f].fields.push({fieldCode:c[s].fieldCode,controlId:o.id,dataBind:c,dataViewId:[t,i]})})})}}function Ud(e,t,n){n.controlType===V.FORM?e[n.id]={dataBind:n.props.dataBind,options:[],dataView:t}:n.type===ne.SUBTABLE&&(e[n.id]={dataBind:new tr({dataCode:n.props.datasourceBind.dataCode,fieldCode:""}),dataView:t,children:{},options:[]},Je(n.props.headers,r=>{var u,i;Object.assign((i=(u=e[n.id])==null?void 0:u.children)!=null?i:{},{[r.id]:{dataBind:r.props.dataBind}})}))}function Vd(e,t){if(t.type===ne.SUBTABLE){const n={};t.props.headers.map(r=>{r.children.map(u=>{Object.assign(n,{[u.id]:u})})}),Object.assign(e,{[t.id]:n})}}const yi=["splice","push","shift","pop","unshift","reverse"],Rr=Symbol("__engineProxy__"),$r=Symbol("__engineTarget__"),mi=Symbol("__engineArrayBeforeSetCallbackFlag__"),Ei=Symbol("__engineProxyThisKey__"),Te={type:"",args:[],callback:Ai};function Ai(){}Jd();function Hd(e,t,n,r,u){if(Te.type){Te.callback=u.bind(null,e,r);return}const i=Number(t);if(i>e.length){Ze(`Wrong array operations may cause unknown errors. It is recommended to use APIs such as ${yi.join(",")} for array operations`);return}if(!(Number.isNaN(i)&&t!=="length"))if(t==="length"){const s=n,c=e.length;if(s>e.length){Ze("Do not directly modify the length of the array data, please add new rows");return}return s===e.length?void 0:()=>u.call(null,e,r,"splice",[s,c-s])}else return i===e.length?()=>u.call(null,e,r,"push",[n]):()=>u.call(null,e,r,"splice",[i,1,n])}function zd(e,t,n){return{__engineProxy__:!0,get(r,u,i){return u===Rr?!0:u===$r?r:Array.isArray(r)&&u===mi?n:u===Ei?e:Reflect.get(r,u,i)},set(r,u,i,o){var d;let s=K(i);const c=r[u],f=e===""?u:e+"."+u;function l(h){if(typeof h=="object"&&h!==null)return h[Rr]!==!0?An(h,t,n,f):An(h[$r],t,n,f)}s=(d=l(s))!=null?d:s;let a;if(Array.isArray(r)){const h=Hd(r,u,s,e,t);a=Reflect.set(r,u,s,o),h&&h()}else{try{let h=s;if(s=n.call(null,r,f,s,c),h!==s){const D=l(s);D!==void 0&&(s=D)}}catch(h){return un(`${f} set error ${h}`),!0}a=Reflect.set(r,u,s,o),t.call(null,r,f,s,c)}return a||!0}}}function An(e,t,n,r=""){if(Object.isFrozen(e))return e;for(let u in e){const i=r===""?u:r+"."+u,o=e[u];typeof o=="object"&&o!==null&&(e[u]=An(o,t,n,i))}return new Proxy(e,zd(r,t,n))}function Ci(e){const t=[];return e.forEach(n=>{t.push(n),(n.controlType==="layout"||n.controlType==="wrap")&&t.push(...Ci(n.children))}),t}function Pr(e,t,n){if(t==="")return;const r=t.split(".");if(r.length===0)return;const u=r[0],i=r.slice(1),o=n[u]?n[u][0]:void 0;return i.length===0?o:i.reduce((s,c)=>{var a,d;const f=Number(c);if(Number.isNaN(f)&&s){const h=s!=null&&s.children?Ci(s.children):void 0,D=h==null?void 0:h.find(g=>g.id===c);return D||(s.controlType===V.FORM?s:void 0)}else return(d=(a=s==null?void 0:s.children)==null?void 0:a[f])!=null?d:s},o)}function Wd(e,t){return["push","unshift"].includes(e)?t:e==="splice"?t.slice(2):[]}function Zd(e,t,n){if(["push","unshift"].includes(e))return n;if(e==="splice")return t.slice(0,2).concat(n)}function Jd(){yi.forEach(e=>{const t=Array.prototype[e];Array.prototype[e]=function(...n){var r;if(this[Rr]){let u;const i=Wd(e,n);if(i.length){const o=(r=this[mi])==null?void 0:r.call(this,this[$r],this[Ei],i),s=Zd(e,n,o);Te.type=e,Te.args=s,u=t.apply(this,s)}else Te.type=e,Te.args=n,u=t.apply(this,n);return typeof Te.callback=="function"&&Te.callback(e,n,u),Te.type="",Te.args=[],Te.callback=Ai,u}else return t.apply(this,n)}})}class Gd{constructor(){this.actionMap=new Map,this.buildinActions={},this.actionUtils={},this.sources={}}execAction(t,n,...r){return ze(this,null,function*(){const u=this.actionMap.get(t);if(!!u)try{return yield u.func.call(null,n,...r)}catch(i){return un(`${u.id} Exception during calling action: ${i}`),!1}})}addAction(t,n){this.actionMap.has(t)&&Ze("duplicated action key");const r=new Xd(t,n);this.actionMap.set(t,r)}}class Xd{constructor(t,n){this.id="",this.id=t,this.func=n}}class Kd{constructor(t){this._dataStore=new Map,this.executer=t}add(t,n){this._dataStore.set(t,n)}get(t){let n=this._dataStore.get(t);return K(n)}remove(t){this._dataStore.delete(t)}getRemoteData(t){return ze(this,null,function*(){return this.executer===void 0?(un("\u672A\u521D\u59CB\u5316executer"),[]):this.executer(t)})}}class at{}class Jt extends at{validate(t){return Ae(t)}transform(t){if(t==null)return"";if(!Pe(t)&&!yu(t))return String(t);if(of(t))return JSON.stringify(t);throw`${t} is not a string`}}class Tr extends at{validate(t){return on(t)||t===""}transform(t){if(t==null)return"";const n=!Pe(t)&&!yu(t)?Number(t):void 0;if(!Number.isNaN(n)&&n!==void 0)return n;throw`${t} is not a number`}}class Qd extends at{validate(t){return af(t)}transform(t){if(t==null)return[];function n(r){return r.map(u=>u?String(u):"")}if(dt(t))return n(t);if(Ae(t)&&mu(t))try{const r=JSON.parse(t);if(Array.isArray(r))return n(r)}catch(r){}return[String(t)]}}class Yd extends at{validate(t){return sf(t)}transform(t){if(t==null)return[];function n(u){return u.map(i=>!i&&i!==0?"":Number(i)).filter(i=>i===""||!Number.isNaN(i))}if(dt(t))return n(t);if(Ae(t)&&mu(t))try{const u=JSON.parse(t);if(dt(u))return n(u)}catch(u){}const r=Number(t);if(Number.isNaN(r))throw`${t} is not a number array`;return[r]}}class eh extends at{validate(t){return Pe(t)&&"amount"in t&&on(t.amount)&&"currency"in t&&Ae(t.currency)}transform(t,n){if(t==null||t==="")return new nr({currency:n==null?void 0:n.currency});let r;if(Pe(t)&&(r=new nr(ie(ie({},n),t))),Ae(t)&&an(t))try{const u=JSON.parse(t);r=new nr(ie(ie({},n),u))}catch(u){}if(r){const u=new Tr,i=new Jt;return u.validate(r.amount)||(r.amount=u.transform(r.amount)),i.validate(r.currency)||(r.currency=i.transform(r.currency)),r}throw`${t} is not a { amount: number, currency: string } object`}}class th extends at{validate(t){return Pe(t)&&"min"in t&&Ae(t.min)&&"max"in t&&Ae(t.max)}transform(t,n){if(t==null||t==="")return new rr;let r;if(Pe(t)&&(r=new rr(ie(ie({},n),t))),Ae(t)&&an(t))try{const u=JSON.parse(t);r=new rr(ie(ie({},n),u))}catch(u){}if(r){const u=new Jt;return u.validate(r.min)||(r.min=u.transform(r.min)),u.validate(r.max)||(r.max=u.transform(r.max)),r}throw`${t} is not a { min: string, max: string } object`}}class nh extends at{validate(t){return Pe(t)&&"result"in t&&on(t.result)&&"unit"in t&&Ae(t.unit)}transform(t,n){if(t==null||t==="")return new ir({unit:n==null?void 0:n.unit});let r;if(Pe(t)&&(r=new ir(ie(ie({},n),t))),Ae(t)&&an(t))try{const u=JSON.parse(t);r=new ir(ie(ie({},n),u))}catch(u){}if(r){const u=new Tr,i=new Jt;return u.validate(r.result)||(r.result=u.transform(r.result)),i.validate(r.unit)||(r.unit=i.transform(r.unit)),r}throw`${t} is not a { result: string, unit: string } object`}}class rh extends at{validate(t){return!!Pe(t)}transform(t,n){if(t==null||t==="")return new ur;let r;if(Pe(t)&&(r=new ur(ie(ie({},n),Jn.exports.camelizeKeys(t)))),Ae(t)&&an(t))try{const u=JSON.parse(t);r=new ur(ie(ie({},n),Jn.exports.camelizeKeys(u)))}catch(u){}if(r){const u=new Jt;return u.validate(r.city)||(r.city=u.transform(r.city)),u.validate(r.district)||(r.district=u.transform(r.district)),u.validate(r.province)||(r.province=u.transform(r.province)),r}throw`${t} is not a { city: string, district: string, province: string } object`}}class uh{static getValueChecker(t){let n;switch(t){case oe.VARCHAR:case oe.TIMESTAMP:case oe.TEXT:case oe.AUTO_NUMBER:n=new Jt;break;case oe.DECIMAL:n=new Tr;break;case oe.EMPLOYEES:case oe.DEPARTMENTS:case oe.IMAGE:case oe.FILE:case oe.ARRAY:n=new Qd;break;case oe.MONEY:n=new eh;break;case oe.TIMESCOPE:n=new th;break;case oe.CALC:n=new nh;break;case oe.DECIMAL_RANGE:n=new Yd;break;case oe.ADDRESS:n=new rh;break}return n}}function ih(e){if(["min","max","currency","unit"].includes(e))return oe.VARCHAR;if(["result","amount"].includes(e))return oe.DECIMAL}function Fi(e,t,n,r){var o;let u=(o=ih(t))!=null?o:e,i=uh.getValueChecker(u);if(!i||i.validate(n))return n;try{const s=i.transform(n,r);return s!==void 0?s:n}catch(s){throw`${t} ${s}`}}function oh(e,t,n){return Object.entries(e).reduce((r,[u,i])=>{const o=t[u];return r[u]=Fi(i,u,o,n[u]),r},Object.assign({},t))}typeof window!="undefined"&&(window.engines={});let Bt=null,Gt="";class jr extends Fu{constructor(t){super(),this.rawStore={},this.isMounted=!1,this.id=nn(8),this.__pluginsApplied=!1,this.actionManager=new Gd,this._jobTasks=[],this.createControlInstance=this.createInstance,this.$options=Object.freeze(t);const{autoMount:n=!0,schema:r,beforeCreateInstance:u,externalParams:i,language:o=nu,debug:s=!1}=this.$options;Se.setLocale(o),this.debug=s,this.runtime=new me({schema:r,beforeCreateInstance:u}),this.externalParams=i,this.store=new jd({instance:this.runtime.instance}),this.debugLog("engine is Instantiation complete"),n&&this.mount()}debugLog(...t){this.debug&&zn(...t)}use(t){return this.__pluginsApplied||this.__plugins.push(t),this}registerControl(...t){return this.runtime.register(...t),this}static register(t){return me.register(t,"Runtime")}static judgeControlIsRegistered(t){return me.staticRegisteredTypes.has(t.Runtime.controlType)}mount(){this.debugLog("engine\u7684mount\u65B9\u6CD5\u5F00\u59CB\u8C03\u7528");const{plugins:t=[]}=this.$options;this._handlerProxyState(),this.__plugins=t,this.applyPlugins(),this.setStates(this.getState()),this.debugLog("engine\u7684mount\u65B9\u6CD5\u8C03\u7528\u7ED3\u675F"),this.debug&&typeof window!="undefined"&&(window.engines[this.id]=this)}destroy(){this.debug&&typeof window!="undefined"&&delete window.engines[this.id]}_handlerProxyState(){this.store.state=An(this.store.state,this._proxyStateCallback.bind(this),this._proxyStateBeforeSetCallback.bind(this))}_proxyStateBeforeSetCallback(t,n,r,u){const i=Pr(this.runtime.flatInstances,n,this.runtime.instanceMap);if(!i)return r;if(this.assertInstance(i,ne.SUBTABLE)){if(r===null)return[];const c=i.props.headers.reduce((l,a)=>{const d=a.children[0];return d&&d.controlType===V.FORM&&(l[d.id]=d.fieldType),l},{}),f=this.getEmptyState(i.id);return r==null?void 0:r.map(l=>oh(c,l,f))}const o=n.split("."),s=o[o.length-1];try{return Fi(i.fieldType,s,r,u)}catch(c){throw At(`the id=${i.id}'s instance setState error, %o ${c}.`,r),c}}_proxyStateCallback(t,n,r,u,i){Array.isArray(t)?this._handlerArrayUpdate(t,n,r,u,i):this._handlerObjectUpdate(t,n,r,u)}_handlerArrayUpdate(t,n,r,u,i){const o=Pr(this.runtime.flatInstances,n,this.runtime.instanceMap);if((o==null?void 0:o.controlType)!==V.LIST)return;const s=h=>{const D=[];for(let g=0;g<h;g++){const A=this.listControlCreateRow(o,"subtable-row");A&&D.push(A)}return D},c=Bt;let f=[],l=[],a=[],d=!1;if(r&&u){switch(r){case"push":case"unshift":const D=u.length;f=s(D),l=u,o.children[r](...f);break;case"splice":if(u.length>2){const g=u.length-2,A=u.slice(2);f=s(g),l=A;const p=u[0],y=u[1];o.children[r](p,y,...f)}else{const g=u[0],A=u[1];g+A===o.children.length-1&&(d=!0),o.children[r](...u)}break;default:o.children[r](...u);break}r==="splice"?a=i:["pop","shift"].includes(r)&&(a=[i]);const h=this.getState(o.id);this._handlerSubtableUpdateUid(h),this.runtime.getFlatInstances(),this.emit("list-change",{instance:o,value:h,options:Object.assign({},c,{changed:f,data:l,deleted:a!=null?a:[],jsonValue:JSON.stringify(h),isDeleteLastOne:d,type:r,args:u})}),Bt=null}}_handlerSubtableUpdateUid(t){t.forEach(n=>{n.uid||Object.assign(n,{uid:"new:"+Zt("uid")})})}_handlerObjectUpdate(t,n,r,u){const i=Pr(this.runtime.flatInstances,n,this.runtime.instanceMap);if(!i)return;const o=this.getInstanceRowIndex(i),s=Bt||{};if(i.controlType===V.LIST&&i.type===ne.SUBTABLE){i.children.length=0;const c=r;let f=[];for(let a=0;a<c.length;a++){const d=this.listControlCreateRow(i,"subtable-row");d&&f.push(d)}i.children.push(...f);let l=u!=null?u:[];(s==null?void 0:s.setData)===!0?l=[]:this.runtime.getFlatInstances(),this._handlerSubtableUpdateUid(c),this.emit("list-change",{instance:i,value:r,options:tu(ie({},s),{changed:f,data:c,deleted:l,type:"push",jsonValue:JSON.stringify(c)})})}else this.emit("change",{instance:i,value:this.getState(i.id,o),rowIndex:o,options:tu(ie({},s),{oldValue:u})})}applyPlugins(){this.__pluginsApplied||(this.__plugins.forEach(t=>{var n;try{Gt=(n=t.pluginName)!=null?n:t.constructor.name,t.apply(this)}catch(r){Ze(`${Gt} Plugin apply Error
2
- ${r}`)}finally{Gt=""}}),this.__pluginsApplied=!0)}listControlCreateRow(t,n){let r;if(n==="subtable-row"?r={children:[],controlType:V.LAYOUT,id:nn(),type:"subtable-row",props:{caption:"",isHide:!1,style:{height:"",heightConfig:"fill",width:"",widthConfig:"fill"}},fieldType:void 0,customEvents:[],pageStatus:0,rules:[],parent:void 0}:r=this.runtime.createControlInstance(n),!!r){if(r.controlType===V.LAYOUT){const u=r,i=K(t.props.headers),o=this.createControl(i);for(let s of o)s.parent||this.runtime.resetInstanceParent(s,u);u.children.push(...o)}return r.parent=t,r}}listControlAddRow(t,n="subtable-row"){const r=this.listControlCreateRow(t,n);!r||t.children.push(r)}emit(t,n){return ze(this,null,function*(){if(t==="engine-mounted"){if(this.isMounted)return At("The engine-mounted life cycle can only be triggered once"),Promise.resolve([]);if(this._jobTasks.length){console.time("engine-mounted need wait");const o=[...this._jobTasks];yield Promise.all(o),console.timeEnd("engine-mounted need wait")}this.isMounted=!0}let r,u;this.isMounted||(u=new Promise(o=>{r=o}),this._jobTasks.push(u));const i=yield qo(jr.prototype,this,"emit").call(this,t,n);return r&&u&&(r(),this._jobTasks.splice(this._jobTasks.indexOf(u),1)),i})}on(t,n){return Gt&&(n.applyingPluginName=Gt),super.on(t,n)}createControl(...t){return this.runtime.createControl(...t)}createInstance(t,n){return this.runtime.createControlInstance(t,n)}schemaEvent(t,n){this.emit(t,n)}updateInstanceProps(t,n,r,u){return this.setInstance(t,n,r,u)}getRule(t,n){return me.staticGetRules(t,n)}getAllRules(t){var r,u;const n=this.runtime.allRules;return t===void 0?n:{rules:(r=n.rules[t])==null?void 0:r.fields,antdRules:(u=n.antdRules[t])==null?void 0:u.fields}}getRules(t,n=!1){var s,c,f,l,a,d,h;const r=this.runtime.rules,u=this.runtime.fieldCodeRules,i=this.store.controlIdMapping,o=n?u:r;if(t===void 0)return n?u:o;{if(t=n?(s=i[t])!=null&&s.children?(c=i[t].dataBind)==null?void 0:c.dataCode:((f=i[t].dataBind)==null?void 0:f.fieldCode)||t:t,t in o)return(l=o[t])==null?void 0:l.fields;let D;for(const g in o)if(t in(((a=o[g])==null?void 0:a.fields)||{})){D=(h=(d=o[g])==null?void 0:d.fields)==null?void 0:h[t];break}return D}}getAntdRules(t){var n;return t===void 0?this.runtime.antdRules:(n=this.runtime.antdRules[t])==null?void 0:n.fields}getState(t,n){return t===void 0?this.store.state:this.store.getState(t,n)}getEmptyState(t){return K(t===void 0?this.store.emptyState:this.store.getEmptyState(t))}setPayloadOptions(t){Bt=t}setState(t,n,r,u){Bt=u,this.debugLog("[%o]: \u89E6\u53D1setState, \u4FEE\u6539\u7684\u503C\u4E3A%o, rowIndex=%o, options=%o",t,n,r,u),this.store.setState(t,n,r),this.debugLog("[%o]: setState\u5B8C\u6210, \u4FEE\u6539\u7684\u503C\u4E3A%o, rowIndex=%o",t,n,r),Bt=null}setStates(t,n,r){let u=t!=null?t:{};Object.keys(u).forEach(i=>{Object.entries(this.store.controlIdMapping).forEach(([o,s])=>{if(s.dataView===i){const c=u[i][o];c!==void 0&&this.setState(o,c,n,r)}else(o===i||s.children&&s.children[i])&&u[i]!==void 0&&this.setState(i,u[i],n,r)})})}getField(t,n,r){if(!n){const c=this.getDataBindMapping(t);if(c){const{controlId:f}=c;return this.getState(f)}return}const u=this.getDataBindMapping(t,n);if(!u)return;const{dataBind:i,controlId:o}=u,s=this.getState(o,r);return Ne(i)?s:Object.entries(i).reduce((c,[f,l])=>l.fieldCode===n?c[f]:c,s)}getData(t){var u,i,o,s,c,f,l,a;if(!t)return;let n=this.getDataBindMapping(t),r=this.getControlIdMapping();if(n){const{controlId:d}=n,h=this.getField(t);if(Array.isArray(h))return h.map(g=>{var p,y,m,C,w,S;let A={};for(let I in g){const j=(m=(y=(p=r[d])==null?void 0:p.children[I])==null?void 0:y.dataBind)==null?void 0:m.fieldCode;if(j!==""){if(j)A[j]=g[I];else if((C=r[d])!=null&&C.children[I])for(let H in g[I])A[(S=(w=r[d])==null?void 0:w.children[I])==null?void 0:S.dataBind[H].fieldCode]=g[I][H]}}return A});{let D={};for(let g in h)if((i=(u=r[g])==null?void 0:u.dataBind)!=null&&i.fieldCode)D[(o=r[g])==null?void 0:o.dataBind.fieldCode]=h[g];else if((c=(s=r[g])==null?void 0:s.dataBind)!=null&&c.dataCode)D[(f=r[g])==null?void 0:f.dataBind.dataCode]=h[g].map(A=>{var y,m;let p={};for(let C in A){const w=(y=r[g].children[C])==null?void 0:y.dataBind.fieldCode;if(w!=="")if(w)p[w]=A[C];else for(let S in A[C])p[(m=r[g].children[C])==null?void 0:m.dataBind[S].fieldCode]=A[C][S]}return p});else if(r[g])for(let A in h[g])D[(a=(l=r[g])==null?void 0:l.dataBind[A])==null?void 0:a.fieldCode]=h[g][A];return D}}}setField(t,n,r,u,i){var f;const o=this.getDataBindMapping(t,n);if(!o)return;const{dataBind:s,controlId:c}=o;if(Ne(s))this.setState(c,r,u,i);else{const l=(f=K(this.getState(c,u)))!=null?f:this.getEmptyState(c),a=Object.entries(s).reduce((d,[h,D])=>(D.fieldCode===n&&(d[h]=r),d),l);this.setState(c,a,u,i)}}setFields(t,n,r,u){const i=this.getDataBindMapping(t);if(!i)return;let o=[];i.fields.forEach(s=>{var a;const{dataBind:c,controlId:f,fieldCode:l}=s;if(!o.includes(l)&&!!Object.hasOwnProperty.call(n,l))if(Ne(c))this.setState(f,n[l],r,u);else{const d=(a=K(this.getState(f,r)))!=null?a:this.getEmptyState(f),h=Object.entries(c).reduce((D,[g,A])=>{o.push(A.fieldCode);const p=n[A.fieldCode];return p!==void 0&&(D[g]=p),D},d);this.setState(s.controlId,h,r,u)}})}buildFields(t,n){const r=this.getDataBindMapping(t);if(!r||!r.fields)return;let u=[];const i={};return r.fields.forEach(o=>{const{dataBind:s,controlId:c,fieldCode:f}=o;if(!u.includes(f)&&!!Object.hasOwnProperty.call(n,f))if(Ne(s))i[c]=n[f];else{const l=this.getEmptyState(c);i[o.controlId]=Object.entries(s).reduce((a,[d,h])=>{u.push(h.fieldCode);const D=n[h.fieldCode];return D!==void 0&&(a[d]=D),a},l)}}),i}setData(t,n){this.debugLog("engine setData\u65B9\u6CD5\u6267\u884C\uFF0C\u53C2\u6570\u4E3A%o\uFF0C%o\u3002",t,n);const r=n==null?void 0:n.onlySetData;let u=this.store.defaultState;r===!0&&(u={}),Object.keys(t).map(i=>{var s,c,f,l;const o=t[i];if(Array.isArray(o)){const a=this.getDataBindMapping(i);if(!a)return;u[a.dataViewId]||(u[a.dataViewId]={}),o.length?u[a.dataViewId][a.controlId]=[]:u[a.dataViewId][a.controlId]=(s=u[a.dataViewId][a.controlId])!=null?s:[];let d={},h={};o.map(D=>{let g=K(this.store.emptyState[a.dataViewId][a.controlId]),A=[];Object.keys(D).map(p=>{var m,C,w;if(A.includes(p))return;h.hasOwnProperty(p)===!1&&(h[p]=(C=(m=this.store.dataBindMapping[i])==null?void 0:m.fields)==null?void 0:C.find(S=>S.fieldCode===p));const y=h[p];if(y){if(Ne(y.dataBind)&&D[p]!==void 0)g[y.controlId]=D[p];else if(!Ne(y.dataBind)){d.hasOwnProperty(y.controlId)===!1&&(d[y.controlId]=K((w=this.getEmptyState(y.controlId))!=null?w:{}));let S=K(d[y.controlId]);Object.keys(y.dataBind).map(I=>{const j=y.dataBind[I];D[j.fieldCode]!==void 0&&(S[I]=D[j.fieldCode]),A.push(j.fieldCode)}),g[y.controlId]=S}}else p==="uid"&&D.uid!==void 0?g.uid=D.uid:p==="virtualStore"&&D.virtualStore!==void 0&&(g.virtualStore=Object.freeze(D.virtualStore))}),u[a.dataViewId][a.controlId].push(g)})}else if(o){let a=[];const d=K(this.store.emptyState);(c=Object.keys(o))!=null&&c.length&&Object.keys(o).map(D=>{var A;if(a.includes(D))return;const g=this.getDataBindMapping(i,D);if(g){if(u[g.dataViewId[0]]||(u[g.dataViewId[0]]={}),Ne(g.dataBind)&&o[D]!==void 0)u[g.dataViewId[0]][g.controlId]=o[D]!==void 0?o[D]:d[g.dataViewId[0]][g.controlId];else if(!Ne(g.dataBind)){let p=(A=this.getEmptyState(g.controlId))!=null?A:{};Object.keys(g.dataBind).map(y=>{const m=g.dataBind[y];o[m.fieldCode]!==void 0&&(p[y]=o[m.fieldCode]),a.push(m.fieldCode)}),u[g.dataViewId[0]][g.controlId]=p}}});const h=this.getDataBindMapping(i);if(h){const D=(f=h==null?void 0:h.fields)==null?void 0:f.map(p=>p==null?void 0:p.controlId),g=this.getEmptyState(h==null?void 0:h.controlId),A=Object.keys((l=u==null?void 0:u[h==null?void 0:h.controlId])!=null?l:{});D==null||D.forEach(p=>{!A.includes(p)&&p!=="uid"&&u[h==null?void 0:h.controlId]&&(Object.keys(u).length?Object.assign(u[h==null?void 0:h.controlId],{[p]:g[p]}):Object.assign(u,{[h.controlId]:{[p]:g[p]}}))}),this.debugLog("engine setData\u65B9\u6CD5\u9ED8\u8BA4\u503C\u53CA\u8868\u5355\u6570\u636E\u7EC4\u5408\u5B8C\u6210\uFF0C\u53C2\u6570\u4E3A%o\u3002",u)}}}),this.debugLog("engine setData\u65B9\u6CD5\u6570\u636E\u7EC4\u5408\u5B8C\u6210\uFF0C\u53C2\u6570\u4E3A%o\u3002",u),this.setStates(u,void 0,ie({setData:!0},n)),this.runtime.getFlatInstances(),this.debugLog("engine setData\u65B9\u6CD5\u6267\u884C\u5B8C\u6210\u3002")}getDataBind(t){return this.store.getDataBind(t)}getInstance(t,n){const r=this.getInstances(t,n===-1);if(r.length>0)return n!==void 0?n===-1?r[0]:r[n]:r[0]}getInstances(t,n=!1){if(t===void 0)return this.runtime.flatInstances;const r=Array.from(this.runtime.instanceMap[t]||[]);if(n){const u=this.findSubtableHeadersControl(t);u!==void 0&&r.unshift(u)}return r}setInstance(t,n,r,u){try{if(typeof t=="string"&&u===-1)this.getInstances(t,u===-1).map(o=>{o&&(this.debugLog("[%o]: \u4FEE\u6539instance: %o\u7684%o\u5C5E\u6027\uFF0C\u4FEE\u6539\u7684\u503C\u4E3A%o\u3002",o.id,o,n,r),Zn(o.props,n,r),this.schemaEvent("schema-change",{instance:o,props:n,value:r,rowIndex:u}))});else{let i;if(typeof t=="string"?i=this.getInstance(t,u):i=t,!i)return;this.debugLog("[%o]: \u4FEE\u6539instance: %o\u7684%o\u5C5E\u6027\uFF0C\u4FEE\u6539\u7684\u503C\u4E3A%o\u3002",i.id,i,n,r),Zn(i.props,n,r),this.schemaEvent("schema-change",{instance:i,props:n,value:r,rowIndex:u})}}catch(i){throw i}}getControlIdMapping(){return this.store.controlIdMapping}getDataBindMapping(t,n){if(!t&&!n)return this.store.dataBindMapping;const r=this.store.dataBindMapping[t];if(!r)return;if(!n)return r;const u=r.fields.find(i=>i.fieldCode===n);if(!!u)return u}getAction(){return this.actionManager}initDataManager(t){this.dataManager=new Kd(t)}getDataManager(){return this.dataManager}assertInstance(t,n){return Ae(n)?t.type===n:n.includes(t.type)}assertInstanceIsCustomControl(t){return!cf(Ae(t)?t:t.type)}getInstanceRowIndex(t){if(!t.parent)return;let n;if(this.assertInstance(t.parent,ne.SUBTABLE_COLUMN)&&this.assertInstance(t.parent.parent,ne.SUBTABLE))n=-1;else if(this.getInstanceParentControl(t,ne.SUBTABLE_COLUMN)){const i=this.runtime.instanceMap[t.id];if(Object.prototype.toString.call(i)==="[object Array]"){const o=i.findIndex(s=>s===t);o>-1&&(n=o)}}return n}getInstanceParentControl(t,n){if(!!t.parent)return this.assertInstance(t.parent,n)?t.parent:this.getInstanceParentControl(t.parent,n)}getInstanceInSubtableHeader(t){const n=this.getInstanceRowIndex(t);if(n===void 0)return;if(n===-1)return t;const r=this.assertInstance(t,ne.SUBTABLE_COLUMN)?t:this.getInstanceParentControl(t,ne.SUBTABLE_COLUMN);if(!r)return;const i=this.getInstanceParentControl(t,ne.SUBTABLE).props.headers.find(o=>o.id===r.id);if(!!i)return i.children.find(o=>o.id===t.id)}setControlConfig(...t){return this.runtime.registerControlConfig(...t)}getControlConfig(t){return this.runtime.getControlConfig(t)}inList(t){const n=this.store.subtableHeadersControlIdMapping;let r;for(const u in n)if(t in n[u]){r=u;break}return r}findSubtableHeadersControl(t){const n=this.store.subtableHeadersControlIdMapping;let r;for(const u in n)if(t in n[u]){r=n[u][t];break}return r}}class ah{}class sh{constructor(t,n,r){this.config=t,this.env=n,this.eventJs=r}apply(t){this.engine=t;const n=this.config;if(!n)return;const r=t.getAction();if(this.eventJs){this.eventJs.exportsFun({ctx:t,utils:r.actionUtils});for(let[u,i]of Object.entries(this.eventJs))r.addAction(u,i)}else{const u=wi(n,t,this.env);if(!u)return;for(let[i,o]of Object.entries(u.funcMap))r.addAction(i,o)}}}function wi(e,t,n){if(!e.module||!e.module.compiled)return;const r=e.module.compiled,u={exports:{ctx:t,utils:t.getAction().actionUtils,env:n}};try{new Function("module","exports",r).call(u,u,u.exports)}catch(s){Ze(s.message+". fail to parse the module"),process.env.NODE_ENV!=="production"&&Ze("fail to parse the module")}const i={},o={};for(const[s,c]of Object.entries(u.exports))typeof c=="function"?i[s]=c:o[s]=c;return{funcMap:i,variables:o}}const ch={"engine-initialized":"did_init","engine-mounted":"did_mount","engine-submit":"will_submit","engine-submit-params":"do_submit","engine-submitted":"did_submit"};class lh{constructor(t){this.config=t}apply(t){this.engine=t,Object.entries(ch).forEach(([n,r])=>{t.on(n,u=>ze(this,null,function*(){const i=yield this.callLifecycleEvent(r,u);return i.includes(!1)?!1:i}))})}callLifecycleEvent(t,n){return ze(this,null,function*(){const r=this.config;return!r||!Array.isArray(r[t])?[]:yield Promise.all(r[t].map(i=>ze(this,null,function*(){return yield this.engine.getAction().execAction(i,n)})))})}}class fh{constructor(t,n){this.config=t,this.customEvents=n}apply(t){this.engine=t,bu.events.forEach(n=>{n.code&&n.key&&this.engineAddEventListener(n.code,n.key)}),this.customEvents.map(n=>{let r=n.key;n.namespace!==void 0&&n.namespace!==null&&n.namespace!==""&&(r=n.namespace+":"+n.key),this.engineAddEventListener(r,r)})}engineAddEventListener(t,n){this.engine.on(t,r=>ze(this,null,function*(){if(!((t==="change"||t==="list-change")&&!this.engine.isMounted)&&r.instance!==void 0)return yield this.callControlEvent(n,r)}))}callControlEvent(t,n){return ze(this,null,function*(){const r=this.config[n.instance.id];if(!r||!Array.isArray(r[t]))return[];const u=yield Promise.all(r[t].map(i=>ze(this,null,function*(){return yield this.engine.getAction().execAction(i,n)})));return u.includes(!1)?!1:u})}}function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cn.apply(null,arguments)}var bi={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function ve(e){return typeof e=="number"}function Qe(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function Bi(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function _i(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Si(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Fn(e){return typeof e=="string"}var Oe=Array.isArray;function _t(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Lr(e){return Array.isArray(e)||_t(e)}function dh(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function hh(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function ph(e){return e&&e.constructor.prototype.isRange===!0||!1}function Mi(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Dh(e){return typeof e=="boolean"}function gh(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function vh(e){return e&&e.constructor.prototype.isHelp===!0||!1}function yh(e){return typeof e=="function"}function mh(e){return e instanceof Date}function Eh(e){return e instanceof RegExp}function Ii(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!Bi(e)&&!_i(e))}function Ah(e){return e===null}function Ch(e){return e===void 0}function Fh(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function wh(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function bh(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Bh(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function _h(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sh(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Mh(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ih(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Nh(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function Oh(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function xh(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Rh(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function $h(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ph(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function Th(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function jh(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function Lh(e){return e&&e.constructor.prototype.isChain===!0||!1}function kr(e){var t=typeof e;return t==="object"?e===null?"null":Qe(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function vt(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return vt(n)});if(e instanceof Date)return new Date(e.valueOf());if(Qe(e))return e;if(Ii(e))return kh(e,vt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function kh(e,t){var n={};for(var r in e)wn(e,r)&&(n[r]=t(e[r]));return n}function Xt(e,t){var n,r,u;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,u=e.length;r<u;r++)if(!Xt(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Xt(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function wn(e,t){return e&&Object.hasOwnProperty.call(e,t)}function qh(e,t){for(var n={},r=0;r<t.length;r++){var u=t[r],i=e[u];i!==void 0&&(n[u]=i)}return n}var Uh=["Matrix","Array"],Vh=["number","BigNumber","Fraction"],Ni=function(t){if(t)throw new Error(`The global config is readonly.
1
+ var Pd=Object.defineProperty,jd=Object.defineProperties;var $d=Object.getOwnPropertyDescriptors;var Oo=Object.getOwnPropertySymbols,kd=Object.getPrototypeOf,Td=Object.prototype.hasOwnProperty,qd=Object.prototype.propertyIsEnumerable,Ud=Reflect.get;var $n=Math.pow,Ro=(Z,ue,fe)=>ue in Z?Pd(Z,ue,{enumerable:!0,configurable:!0,writable:!0,value:fe}):Z[ue]=fe,oe=(Z,ue)=>{for(var fe in ue||(ue={}))Td.call(ue,fe)&&Ro(Z,fe,ue[fe]);if(Oo)for(var fe of Oo(ue))qd.call(ue,fe)&&Ro(Z,fe,ue[fe]);return Z},Qr=(Z,ue)=>jd(Z,$d(ue));var Po=(Z,ue,fe)=>Ud(kd(Z),fe,ue);var ze=(Z,ue,fe)=>new Promise((kn,Ce)=>{var et=U=>{try{kt(fe.next(U))}catch(wt){Ce(wt)}},$t=U=>{try{kt(fe.throw(U))}catch(wt){Ce(wt)}},kt=U=>U.done?kn(U.value):Promise.resolve(U.value).then(et,$t);kt((fe=fe.apply(Z,ue)).next())});(function(Z,ue){typeof exports=="object"&&typeof module!="undefined"?ue(exports,require("crypto")):typeof define=="function"&&define.amd?define(["exports","crypto"],ue):(Z=typeof globalThis!="undefined"?globalThis:Z||self,ue(Z.modelDrivenEngine={},Z.require$$0))})(this,function(Z,ue){"use strict";function fe(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var kn=fe(ue),Ce;(function(e){e.Number="Number",e.Operator="Operator",e.VariableInMainTable="VariableInMainTable",e.VariableInCurrentSubTable="VariableInCurrentSubTable",e.VariableInOtherSubTable="VariableInOtherSubTable",e.UndefinedVariable="UndefinedVariable"})(Ce||(Ce={}));var et;(function(e){e.SUM="SUM",e.AVG="AVG",e.MAX="MAX",e.MIN="MIN"})(et||(et={}));var $t,kt=($t=window.localStorage.getItem("locale"))!==null&&$t!==void 0?$t:"zh-CN",U;(function(e){e.BASE="base",e.FORM="form",e.LAYOUT="layout",e.WRAP="wrap",e.COLUMN="column",e.LIST="list",e.SEARCH="search"})(U||(U={}));var wt;(function(e){e[e.FORM=0]="FORM",e[e.LIST=1]="LIST",e[e.REPORT=2]="REPORT",e[e.DASHBOARD=3]="DASHBOARD",e[e.VUE=4]="VUE",e[e.FREE_PAGE=5]="FREE_PAGE"})(wt||(wt={}));var re;(function(e){e.TITLE="title",e.LINK="link",e.BUTTON="button",e.DIVIDER="divider",e.TEXT="text",e.CREATE_FORM_LIST_BUTTON="list-page-btn-create-form",e.BATCH_SUBMISSION_LIST_BUTTON="list-page-btn-batch-submission",e.BATCH_DELETE_LIST_BUTTON="list-page-btn-batch-delete",e.SUBMISSION_RECORD_LIST_BUTTON="list-page-btn-submission-record",e.IMPORT_RECORD_LIST_BUTTON="list-page-btn-import-record",e.EXPORT_RECORD_LIST_BUTTON="list-page-btn-export-record",e.EXPORT_LIST_BUTTON="list-page-btn-export-list",e.LIST_SELECT_BUTTON="list-select-button",e.ORGANIZATION_SELECTION="organization-selection",e.FORM_SELECT_BUTTON="form-select-button",e.LIST_VIEW_SELECT="list-view-select",e.TEXT_OCR_BUTTON="text-ocr-button",e.INVOICE_CHECK_BUTTON="invoice-check-button",e.LIST_PAGE_BTN_BATCH_PRINT="list-page-btn-batch-print",e.LIST_PAGE_BTN_BATCH_PRINT_RECORD="list-page-btn-batch-print-record",e.VARCHAR_COLUMN="varchar-column",e.TEXT_COLUMN="text-column",e.DECIMAL_COLUMN="decimal-column",e.TIMESCOPE_COLUMN="timescope-column",e.TIMESTAMP_COLUMN="timestamp-column",e.ARRAY_COLUMN="array-column",e.DEPARTMENT_COLUMN="department-column",e.AUTO_NUMBER_COLUMN="auto-number-column",e.FILE_COLUMN="file-column",e.IMAGE_COLUMN="image-column",e.PEOPLE_COLUMN="people-column",e.LOCATION_COLUMN="location-column",e.CUSTOM_COLUMN="custom-column",e.ORDER_COLUMN="order-column",e.OPERATION_COLUMN="operation-column",e.OPERATION_BUTTON="operation-button",e.EMPLOYEE_COLUMN="employee-column",e.Approval_Status_Column="approval-status-column",e.ADDRESS="address",e.AMOUNT="amount",e.ATTACHMENT="attachment",e.AUTO_NUMBER="auto-number",e.CALC="calc",e.CHECKBOX="checkbox",e.DATE_PICKER="date-picker",e.DATE_RANGE="date-range",e.DEPARTMENT="department",e.EMPLOYEE="employee",e.IMAGE="image",e.INPUT="input",e.NUMBER="number",e.RADIO="radio",e.RICH_TEXT="rich-text",e.SCORE="score",e.SEARCH_DATE_RANGE="search-date-range",e.SEARCH_NUMBER_RANGE="search-number-range",e.SEARCH_INPUT="search-input",e.SELECT="select",e.SELECT_MULTIPLE="select-multiple",e.SELECT_RELATION="select-relation",e.VUE_FORM_ITEM="vue-form-item",e.TEXTAREA="textarea",e.EMAIL="email",e.FOOTER="footer",e.HEADER="header",e.ID_CARD="id-card",e.MOBILE="mobile",e.PHONE="phone",e.RADIO_IMAGE="radio-image",e.ELECTRONIC_SIGNATURE="electronic-signature",e.WPS="wps",e.CARD_GROUP="card-group",e.COL="col",e.GRID="grid",e.GRID_ROW="grid-row",e.GRID_TABLE_COLUMN="grid-table-column",e.GRID_LAYOUT_CONTAINER="grid-layout-container",e.ROW="row",e.TWO_COLUMNS="two-columns",e.SUBTABLE_COLUMN="subtable-column",e.SUBTABLE_ROW="subtable-row",e.TAB="tab",e.TAB_PANE="tab-pane",e.TOOLBOX="toolbox",e.DATA_VIEW="data-view",e.LIST_VIEW="list-view",e.ACTION_BAR="action-bar",e.SUBTABLE="subtable",e.GRID_TABLE="grid-table",e.SIMPLE_SEARCH="simple-search",e.PAGINATION="pagination",e.CHECKBOX_IMAGE="checkbox-image",e.DASHBOARD="dashboard",e.TREE="tree",e.EMPLOYEE2="employee2",e.DEPARTMENT2="department2",e.GRID_LAYOUT_WRAP="grid-layout-wrap",e.VUE_PAGE="vue-page"})(re||(re={}));var Yr;(function(e){e.SAVE="save",e.DRAFT="draft",e.UNSUBMIT="unsubmit",e.AUDIT="audit",e.UNAUDIT="unaudit",e.CANCEL="cancel",e.FORM_SUBMIT="form_submit"})(Yr||(Yr={}));var se;(function(e){e.VARCHAR="varchar",e.TEXT="text",e.ARRAY="array",e.ADDRESS="location",e.DECIMAL="decimal",e.DECIMAL_RANGE="decimal_range",e.TIMESTAMP="timestamp",e.EMPLOYEES="people",e.DEPARTMENTS="department",e.MONEY="money",e.TIMESCOPE="timescope",e.FILE="file",e.IMAGE="image",e.AUTO_NUMBER="auto_number",e.CALC="calc",e.LIST="list",e.JSON="json",e.ANY="ANY"})(se||(se={}));var ei;(function(e){e.YEAR="year",e.MONTH="month",e.DATE="date",e.DATEHOUR="datehour",e.DATEMIN="datemin",e.DATETIME="datetime"})(ei||(ei={}));var ti="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",jo=ti+"0123456789";function tn(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15,t="",n=0;n<e;n++){var r=n===0?ti:jo,i=Math.random()*r.length;t+=r[parseInt(String(i),10)]}return t}function Tn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $o(e){if(Array.isArray(e))return Tn(e)}function ko(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nn(e,t,n){return ui()?nn=Reflect.construct:nn=function(i,u,o){var a=[null];a.push.apply(a,u);var c=Function.bind.apply(i,a),l=new c;return o&&qt(l,o.prototype),l},nn.apply(null,arguments)}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Tt(e)}function ri(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qt(e,t)}function To(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function qo(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Uo(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lo(e,t){return t&&(Ho(t)==="object"||typeof t=="function")?t:ko(e)}function qt(e,t){return qt=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},qt(e,t)}function ii(e){return $o(e)||qo(e)||Vo(e)||Uo()}function Ho(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Vo(e,t){if(!!e){if(typeof e=="string")return Tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tn(e,t)}}function qn(e){var t=typeof Map=="function"?new Map:void 0;return qn=function(r){if(r===null||!To(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return nn(r,arguments,Tt(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),qt(i,r)},qn(e)}function ui(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function oi(e){var t=ui();return function(){var r=Tt(e),i;if(t){var u=Tt(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return Lo(this,i)}}var Un=console;function At(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t.slice(1);(r=Un).warn.apply(r,["\u{1F9D0} Driven Warning:"+t[0]].concat(ii(i)))}function Ln(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t.slice(1);(r=Un).log.apply(r,["\u{1F680} Driven Log:"+t[0]].concat(ii(i)))}function zo(e){return e+" \u{1F41B}\u{1F41B}\u{1F41B}"}var Hn=function(e){ri(n,e);var t=oi(n);function n(r){ni(this,n);var i;return i=t.call(this,r),i.name="\u{1F4A5} Driven Error",i.message=r?zo(r):"An unknown error occurred in the Driven, please contact the person in charge \u{1F691}\u{1F691}\u{1F691}",i}return n}(qn(Error)),Wo=function(e){ri(n,e);var t=oi(n);function n(r){ni(this,n);var i;return i=t.call(this,r),i.name="\u{1F6A8} Driven Reference Error",i}return n}(Hn);function We(e){throw new Hn(e)}function si(e){throw new Wo(e)}function rn(e){Un.error(new Hn(e))}function Ze(e,t){Array.isArray(e)&&e.map(function(n){switch(n.controlType){case"layout":Ze(n==null?void 0:n.children,t);break;case"wrap":Ze(n==null?void 0:n.children,t);break;case"search":Ze(n==null?void 0:n.children,t);break;case"form":t(n)}})}const Zo=(e,t)=>{if(!e)return console.error("getLocaleText\u7684key\u4E0D\u80FD\u4E3A\u7A7A"),"";const n=e.split(".");let r;const i=(window.baitedaWorkers||{}).languageMessages||{};n.forEach((o,a)=>{a===0?r=i[o]:r&&(r=r[o])});let u="";return r&&(u=r),t&&Object.keys(t).forEach(o=>{const a=t[o];u=u.replace(new RegExp(`\\{\\s*${o}\\s*\\}`,"g"),a)}),u||(u=e),u};function Xo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ai(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jo(e,t,n){return t&&ai(e.prototype,t),n&&ai(e,n),e}var W=function(){function e(){Xo(this,e)}return Jo(e,null,[{key:"getMessage",value:function(n){return Zo("CMD."+n)}}]),e}();function Vn(e,t,n){var r=t.replace(/\[(\d)]/g,function(u,o){return"."+o}).split("."),i=!1;return r.reduce(function(u,o,a,c){var l=u;if(!!u){if(!Object.prototype.hasOwnProperty.call(u,o)){At("Can not set ".concat(t,"'s ").concat(o," property in current %o, Because there is no ").concat(o," property on the %o"),u,u);return}return a===c.length-1&&!Object.is(l[o],n)&&(l[o]=n,i=!0),l[o]}},e),i}var tt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zn={exports:{}};(function(e){(function(t){var n=function(p,v,m){if(!l(v)||s(v)||d(v)||h(v)||c(v))return v;var C,E=0,S=0;if(f(v))for(C=[],S=v.length;E<S;E++)C.push(n(p,v[E],m));else{C={};for(var N in v)Object.prototype.hasOwnProperty.call(v,N)&&(C[p(N,m)]=n(p,v[N],m))}return C},r=function(p,v){v=v||{};var m=v.separator||"_",C=v.split||/(?=[A-Z])/;return p.split(C).join(m)},i=function(p){return g(p)?p:(p=p.replace(/[\-_\s]+(.)?/g,function(v,m){return m?m.toUpperCase():""}),p.substr(0,1).toLowerCase()+p.substr(1))},u=function(p){var v=i(p);return v.substr(0,1).toUpperCase()+v.substr(1)},o=function(p,v){return r(p,v).toLowerCase()},a=Object.prototype.toString,c=function(p){return typeof p=="function"},l=function(p){return p===Object(p)},f=function(p){return a.call(p)=="[object Array]"},s=function(p){return a.call(p)=="[object Date]"},d=function(p){return a.call(p)=="[object RegExp]"},h=function(p){return a.call(p)=="[object Boolean]"},g=function(p){return p=p-0,p===p},D=function(p,v){var m=v&&"process"in v?v.process:v;return typeof m!="function"?p:function(C,E){return m(C,p,E)}},A={camelize:i,decamelize:o,pascalize:u,depascalize:o,camelizeKeys:function(p,v){return n(D(i,v),p)},decamelizeKeys:function(p,v){return n(D(o,v),p,v)},pascalizeKeys:function(p,v){return n(D(u,v),p)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=A:t.humps=A})(tt)})(zn);var fi={};Object.defineProperty(fi,"__esModule",{value:!0});function Wn(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(t=>typeof t!="object"||t===null?t:Wn(t));{const t={};for(const n in e){const r=e[n];t[n]=typeof r!="object"||r===null?r:Wn(r)}return t}}var Go=fi.default=Wn;function li(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Q(e){if(e!==void 0)return(typeof e=="undefined"?"undefined":li(e))==="object"?Go(e):e}function je(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ko(e){return e!=null&&(typeof e=="undefined"?"undefined":li(e))==="object"&&Array.isArray(e)===!1}function dt(e){return Array.isArray(e)}function be(e){return typeof e=="string"}function un(e){return typeof e=="number"}function di(e){return typeof e=="function"}function Qo(e){return dt(e)&&e.every(function(t){return be(t)})}function Yo(e){return dt(e)&&e.every(function(t){return un(t)||t===""})}function hi(e){return/^\[.*?]$/.test(e)}function on(e){return/^{.*?}$/.test(e)}function es(e){return Object.values(re).includes(e)}function Zn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ts(e){if(Array.isArray(e))return Zn(e)}function pi(e,t,n,r,i,u,o){try{var a=e[u](o),c=a.value}catch(l){n(l);return}a.done?t(c):Promise.resolve(c).then(r,i)}function ns(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function o(c){pi(u,r,i,o,a,"next",c)}function a(c){pi(u,r,i,o,a,"throw",c)}o(void 0)})}}function rs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function is(e,t,n){return t&&gi(e.prototype,t),n&&gi(e,n),e}function Di(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function us(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function os(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Xn(e){return ts(e)||us(e)||ss(e)||os()}function ss(e,t){if(!!e){if(typeof e=="string")return Zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zn(e,t)}}function as(e,t){var n,r,i,u,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=l[0]&2?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(f){l=[6,f],r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var yi=function(){function e(){rs(this,e),Di(this,"_events",new Map),Di(this,"debug",!1)}return is(e,[{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;u++)i[u-1]=arguments[u];var o=this;return ns(function(){var a,c,l,f,s,d,h,g,D,A,p,v;return as(this,function(m){switch(m.label){case 0:if(a=o._events.get(n),c=[],!a)return[3,10];l=a.slice(),f=!0,s=!1,d=void 0,m.label=1;case 1:m.trys.push([1,8,9,10]),h=l[Symbol.iterator](),m.label=2;case 2:if(f=(g=h.next()).done)return[3,7];if(D=g.value,!a.includes(D))return[3,6];m.label=3;case 3:return m.trys.push([3,5,,6]),o.debug&&Ln.apply(void 0,["\u6B63\u5728\u6267\u884C ".concat(n," \u4E8B\u4EF6: ").concat(D.applyingPluginName?"\u5F53\u524D\u6267\u884C\u7684\u63D2\u4EF6\u4E3A:"+D.applyingPluginName:"",", \u5F53\u524D\u6267\u884C\u51FD\u6570\u7684\u53C2\u6570\u4E3A").concat(i.map(function(){return"%o"}).join(","),"\u3002")].concat(Xn(i))),[4,D.apply(null,Xn(i))];case 4:return A=m.sent(),o.debug&&Ln.apply(void 0,["\u6B63\u5728\u6267\u884C ".concat(n," \u4E8B\u4EF6: ").concat(D.applyingPluginName?"\u5F53\u524D\u6267\u884C\u7684\u63D2\u4EF6\u4E3A:"+D.applyingPluginName:"",", \u5F53\u524D\u6267\u884C\u51FD\u6570\u7684\u53C2\u6570\u4E3A").concat(i.map(function(){return"%o"}).join(","),"; \u51FD\u6570\u7684\u8FD4\u56DE\u7ED3\u679C\u4E3A%o")].concat(Xn(i),[A])),c.push(A),A===!1?[3,7]:[3,6];case 5:return p=m.sent(),rn(String(p)+":"+String(p.stack)),[3,6];case 6:return f=!0,[3,2];case 7:return[3,10];case 8:return v=m.sent(),s=!0,d=v,[3,10];case 9:try{!f&&h.return!=null&&h.return()}finally{if(s)throw d}return[7];case 10:return[2,c]}})})()}},{key:"on",value:function(n,r){if(this._events.has(n)){var i;(i=this._events.get(n))===null||i===void 0||i.push(r)}else this._events.set(n,[r])}},{key:"off",value:function(n,r){if(this._events.has(n)){var i=this._events.get(n),u=i==null?void 0:i.indexOf(r);i==null||i.splice(u,1)}}},{key:"delete",value:function(n){this._events.has(n)&&this._events.delete(n)}},{key:"clear",value:function(){this._events=new Map}}]),e}();function cs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fs(e,t,n){return t&&vi(e.prototype,t),n&&vi(e,n),e}function ls(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ds=[{key:"on_click",name:W.getMessage("click"),code:"click"},{key:"on_click_finish",name:W.getMessage("finished"),code:"click-finish"},{key:"on_change",name:W.getMessage("valueChange"),code:"change"},{key:"on_search",name:W.getMessage("search"),code:"search"},{key:"on_list_change",name:W.getMessage("listDataChange"),code:"list-change"},{key:"on_list_search",name:W.getMessage("listDataCreate"),code:"list-search"},{key:"on_list_mounted",name:W.getMessage("listDataBack"),code:"list-mounted"},{key:"on_list_delete",name:W.getMessage("listDataDelete"),code:"list-delete"},{key:"on_list_before_insert",name:W.getMessage("listDataAdd"),code:"list-before-insert"},{key:"on_input",name:W.getMessage("onInput"),code:"input"},{key:"on_blur",name:W.getMessage("onBlur"),code:"blur"},{key:"on_focus",name:W.getMessage("onFocus"),code:"focus"},{key:"on_wps_open",name:W.getMessage("onOpenFile"),code:"wps-open"},{key:"on_wps_save",name:W.getMessage("onSaveFile"),code:"wps-save"},{key:"on_wps_rename",name:W.getMessage("rename"),code:"wps-rename"},{key:"on_list_actions",name:W.getMessage("onClickBtn"),code:"list-actions"},{key:"on_list_render_operation",name:W.getMessage("cellRender"),code:"list-render-operation"},{key:"on_list_rowclick",name:W.getMessage("rowClick"),code:"list-rowclick"},{key:"on_list_before_rowdelete",name:W.getMessage("rowDelete"),code:"list-before-rowdelete"},{key:"on_list_before_import",name:W.getMessage("listDataImport"),code:"list-before-import"},{key:"on_list_rows_checked",name:W.getMessage("rowSelected"),code:"list-rows-checked"},{key:"on_change_tab",name:W.getMessage("tabChange"),code:"change-tab"},{key:"on_modal_ok",name:W.getMessage("modalConfirm"),code:"modal-ok"}],mi=function(){function e(){cs(this,e)}return fs(e,null,[{key:"getEventsFromKeys",value:function(n){var r=typeof n=="string"?[n]:n;return e.events.filter(function(i){return r.includes(i.key)})}},{key:"getEventsFromControl",value:function(n){var r=[],i=n.eventKeys;r=r.concat(e.events.filter(function(o){return i.includes(o.key)}));var u=n.customEvents.map(function(o){var a=o.key;return o.namespace!==void 0&&o.namespace!==null&&o.namespace!==""&&(a=o.namespace+":"+o.key),{key:a,code:o.key,name:o.name}});return r=r.concat(u),r}}]),e}();ls(mi,"events",ds);function Jn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hs(e){if(Array.isArray(e))return Jn(e)}function ps(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gs(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wi(e){return hs(e)||ps(e)||Ds(e)||gs()}function Ds(e,t){if(!!e){if(typeof e=="string")return Jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jn(e,t)}}function Gn(e,t){var n;!((n=Object.getOwnPropertyDescriptors(e)[t])===null||n===void 0)&&n.enumerable&&Object.defineProperty(e,t,{enumerable:!1})}function Ai(e,t,n){n!=="Runtime"&&(e.parent=t,Gn(e,"parent"))}function ys(e,t,n){e.forEach(function(r){Ai(r,t,n)})}var Ci=Symbol("targetKey");function bi(e){var t;return(t=e[Ci])!==null&&t!==void 0?t:e}function Ei(e,t,n){return ys(e,t,n),new Proxy(e,{get:function(i,u){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];var l;return u===Ci?i:(l=Reflect).get.apply(l,[i,u].concat(wi(a)))},set:function(i,u,o){for(var a=arguments.length,c=new Array(a>3?a-3:0),l=3;l<a;l++)c[l-3]=arguments[l];var f;if(dt(e)&&u==="length"&&o===e.length)return!0;var s=(f=Reflect).set.apply(f,[i,u,o].concat(wi(c)));return je(o)&&Ai(o,t,n),s}})}function Kn(e,t,n,r,i){var u=r!=null?r:e,o=Ei(bi(n!=null?n:[]),u,i);Object.defineProperty(e,t,{get:function(){return o},set:function(c){o=Ei(bi(c),u,i)},enumerable:!0})}function vs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ms(e,t,n){return t&&Fi(e.prototype,t),n&&Fi(e,n),e}function nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _i=[],Ut=function(){function e(t){vs(this,e),nt(this,"registeredControlTypes",new Set),nt(this,"controlConfigMap",new Map),nt(this,"_controls",[]),nt(this,"_type",void 0),this._type=t,this._initControls(t)}return ms(e,[{key:"registerControlConfig",value:function(n,r){return this.controlConfigMap.set(n,r),this}},{key:"getControlConfig",value:function(n){return this.controlConfigMap.get(n)}},{key:"getControls",value:function(){return this._controls}},{key:"register",value:function(n){n.__is_control__||We("".concat(n.name," is not a Control"));var r=this._controls.findIndex(function(i){return i.controlType===n.controlType});return r>-1&&(At("The ".concat(n.controlType," is repeat register, So it overwrites the one that was registered before.")),this._controls.splice(r,1)),this.registeredControlTypes.add(n.controlType),this._controls.push(n),this}},{key:"isLayoutControl",value:function(n){return n.controlType===U.LAYOUT}},{key:"isFormControl",value:function(n){return n.controlType===U.FORM}},{key:"isListControl",value:function(n){return n.controlType===U.LIST}},{key:"isColumnControl",value:function(n){return n.controlType===U.COLUMN}},{key:"createControl",value:function(n,r){var i=this;if(Array.isArray(n))return n.map(function(f){return i.createControl(f,r)});if(n.children&&(n.children=n.children.map(function(f){return i.createControl(f,r)})),this.isListControl(n)){var u=n.props;u.headers&&(u.headers=u.headers.map(function(f){return i.createControl(f,r)}))}var o=this.getControlFormType(n.type);if(o){var a=n;if(typeof r=="function"){var c=r(a);c&&(a=c)}var l;return o.mode==="Runtime"?(l=a,l.fieldType=o.controlFieldType,this._setParentPrototypeToSchema(l,this)):l=new o(a),l}else We("The constructor of ".concat(n.type," could not be found, please confirm that the constructor has been registered"))}},{key:"resetInstanceParent",value:function(n,r){delete n.parent,Object.defineProperty(n,"parent",{configurable:!0,get:function(){return r}}),Gn(n,"parent")}},{key:"_setParentPrototypeToSchema",value:function(n,r){r._type==="Runtime"&&(Object.defineProperty(n,"parent",{configurable:!0,get:function(){var u=n.id,o=r._controlParentIdMap,a=r.instanceMap;if(!(!o||!a)){var c=o[u],l=a[u];if(!(!c&&!l)){var f=l.findIndex(function(h){return h==n}),s=a[c]||[],d;return s.length!==l.length?d=s[0]:d=s[f],d}}}}),Gn(n,"parent"))}},{key:"createControlInstance",value:function(n,r){var i=this.getControlFormType(n);if(i)return new i(r)}},{key:"getControlFormType",value:function(n){return this._controls.find(function(r){return r.controlType===n})}},{key:"_initControls",value:function(n){var r=this;this.constructor.staticControls.forEach(function(i){r.register(i[n]),e.staticControlsRuntimeRules.set(i.Runtime.controlType,i.Property.RuntimeRules),i.Property.mode=n})}}],[{key:"staticGetRules",value:function(n,r){var i=e.staticControlsRuntimeRules.get(n),u=[];if(i){var o=new i(r);u=Array.from(o)}return u}},{key:"register",value:function(n,r){var i=n.Designer,u=n.Runtime,o=n.Property;(!i||!u||!i.__is_control__||!u.__is_control__)&&We("".concat(n," is can't register as a Control"));var a=this.staticControls.findIndex(function(c){return c.Designer.controlType===i.controlType});return a>-1&&(At("The ".concat(i.controlType," is repeat register, So it overwrites the one that was registered before.")),this.staticControls.splice(a,1)),this.staticRegisteredTypes.add(i.controlType),this.staticControls.push(n),o.mode=r,this}}]),e}();nt(Ut,"staticControlsRuntimeRules",new Map),nt(Ut,"staticControls",_i),nt(Ut,"staticRegisteredTypes",new Set(_i.map(function(e){return e.Designer.controlType}))),nt(Ut,"staticRegisteredConfigs",new Map);function ht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qn=function e(t){ht(this,e),ie(this,"dataCode",void 0),ie(this,"fieldCode",void 0),ie(this,"fieldType",void 0),ie(this,"aliasCode",void 0);var n;this.dataCode=(n=t==null?void 0:t.dataCode)!==null&&n!==void 0?n:"";var r;this.fieldCode=(r=t==null?void 0:t.fieldCode)!==null&&r!==void 0?r:"";var i;this.fieldType=(i=t==null?void 0:t.fieldType)!==null&&i!==void 0?i:"",this.aliasCode=t==null?void 0:t.aliasCode},ws=function e(t){ht(this,e),ie(this,"minWidth",void 0),ie(this,"maxWidth",void 0),ie(this,"flex",void 0);var n;this.minWidth=(n=t==null?void 0:t.minWidth)!==null&&n!==void 0?n:150,this.maxWidth=t==null?void 0:t.maxWidth;var r;this.flex=(r=t==null?void 0:t.flex)!==null&&r!==void 0?r:1},Yn=function e(t){ht(this,e),ie(this,"amount",void 0),ie(this,"currency",void 0);var n;this.amount=(n=t==null?void 0:t.amount)!==null&&n!==void 0?n:"";var r;this.currency=(r=t==null?void 0:t.currency)!==null&&r!==void 0?r:"CNY"},er=function e(t){ht(this,e),ie(this,"min",void 0),ie(this,"max",void 0);var n;this.min=(n=t==null?void 0:t.min)!==null&&n!==void 0?n:"";var r;this.max=(r=t==null?void 0:t.max)!==null&&r!==void 0?r:""},tr=function e(t){ht(this,e),ie(this,"city",void 0),ie(this,"cityDisplay",void 0),ie(this,"district",void 0),ie(this,"districtDisplay",void 0),ie(this,"province",void 0),ie(this,"provinceDisplay",void 0);var n;this.city=(n=t==null?void 0:t.city)!==null&&n!==void 0?n:"";var r;this.cityDisplay=(r=t==null?void 0:t.cityDisplay)!==null&&r!==void 0?r:"";var i;this.district=(i=t==null?void 0:t.district)!==null&&i!==void 0?i:"";var u;this.districtDisplay=(u=t==null?void 0:t.districtDisplay)!==null&&u!==void 0?u:"";var o;this.province=(o=t==null?void 0:t.province)!==null&&o!==void 0?o:"";var a;this.provinceDisplay=(a=t==null?void 0:t.provinceDisplay)!==null&&a!==void 0?a:""},nr=function e(t){ht(this,e),ie(this,"result",void 0),ie(this,"unit",void 0);var n;this.result=(n=t==null?void 0:t.result)!==null&&n!==void 0?n:0;var r;this.unit=(r=t==null?void 0:t.unit)!==null&&r!==void 0?r:""},Bi;(function(e){e.CNY="CNY",e.USD="USD",e.JPY="JPY",e.EUR="EUR",e.INR="INR",e.IDR="IDR",e.BRL="BRL",e.AED="AED",e.AUD="AUD",e.CAD="CAD",e.EGP="EGP",e.GBP="GBP",e.ZAR="ZAR",e.KRW="KRW",e.MAD="MAD",e.MXN="MXN",e.MYR="MYR",e.PHP="PHP",e.PLN="PLN",e.RUB="RUB",e.SGD="SGD",e.THB="THB",e.TRY="TRY",e.TWD="TWD",e.VND="VND",e.HKD="HKD",e.IEP="IEP"})(Bi||(Bi={}));var Si;(function(e){e.DEFAULT_DISPLAY="defaultDisplay",e.REQUIRED="required",e.IS_HIDE="isHide",e.IS_SHOW_UNIT="isShowUnit",e.IMD_SEARCH="immediatelySearch",e.MULTIPLE="multiple",e.SUBMIT_SELECT_CURRENCY="submitSelectCurrency",e.CAPTION="caption",e.IS_HIDE_CAPTION="isHideCaption",e.DEFAULT_SHOW_OPTIONS="defaultShowOptions",e.CAN_SEARCH="canSearch",e.CAN_CHECK="canCheck",e.CAN_EDIT="canEdit",e.CAN_DELETE="canDelete",e.SHOW_UPPER_CASE="showUpperCase",e.MICROMETER="micrometer",e.PRECISION="precision",e.PERCENTAGE="percentage",e.OPTIONAL_LEVEL="optionalLevel",e.CONTAINS_SUB_NODE="containsSubNode",e.DEFAULT_COLLAPSE="defaultCollapse",e.CAN_VIEW_FORM="canViewForm",e.VIEW_FORM_MODEL_TYPE="viewFormModelType",e.SERVER_PAGINATION="serverPagination",e.IS_SHOW_CAPTION_TIP="isShowCaptionTip",e.IS_SHOW_WATERMARK="isShowWatermark",e.ENCRYPTED="encrypted",e.IS_INLINE_EDIT="isInlineEdit",e.REVISIONS_MODE="revisionsMode",e.ALLOW_COPY_OPTIONS="allowCopyOptions",e.IS_PASTE="isPaste",e.SORTABLE="sortable"})(Si||(Si={}));var rr;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.READONLY=1]="READONLY",e[e.EDITABLE=2]="EDITABLE",e[e.PRINT=5]="PRINT"})(rr||(rr={}));var As=function e(t){ht(this,e),ie(this,"width",void 0),ie(this,"height",void 0),ie(this,"widthConfig",void 0),ie(this,"heightConfig",void 0);var n;this.width=(n=t==null?void 0:t.width)!==null&&n!==void 0?n:"";var r;this.height=(r=t==null?void 0:t.height)!==null&&r!==void 0?r:"";var i;this.widthConfig=(i=t==null?void 0:t.widthConfig)!==null&&i!==void 0?i:"fill";var u;this.heightConfig=(u=t==null?void 0:t.heightConfig)!==null&&u!==void 0?u:"fill"};function Cs(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ir(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sn(e,t,n){return Mi()?sn=Reflect.construct:sn=function(i,u,o){var a=[null];a.push.apply(a,u);var c=Function.bind.apply(i,a),l=new c;return o&&Ht(l,o.prototype),l},sn.apply(null,arguments)}function Xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lt(e){return Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Lt(e)}function bs(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ht(e,t)}function Es(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Fs(e,t){return t&&(_s(t)==="object"||typeof t=="function")?t:Cs(e)}function Ht(e,t){return Ht=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ht(e,t)}function _s(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function ur(e){var t=typeof Map=="function"?new Map:void 0;return ur=function(r){if(r===null||!Es(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return sn(r,arguments,Lt(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ht(i,r)},ur(e)}function Mi(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Bs(e){var t=Mi();return function(){var r=Lt(e),i;if(t){var u=Lt(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return Fs(this,i)}}var or=function e(t){ir(this,e),Xe(this,"isHide",{type:"boolean"})},Ni=function(e){bs(n,e);var t=Bs(n);function n(r){return ir(this,n),t.call(this)}return n}(ur(Array)),Je=function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";ir(this,e),Xe(this,"isHide",void 0),Xe(this,"className",void 0),Xe(this,"style",void 0),Xe(this,"caption",void 0),Xe(this,"defaultState",void 0);var r;this.isHide=(r=t==null?void 0:t.isHide)!==null&&r!==void 0?r:!1,this.style=new As(t==null?void 0:t.style);var i;this.caption=(i=t==null?void 0:t.caption)!==null&&i!==void 0?i:n};Xe(Je,"mode",void 0),Xe(Je,"Rules",or),Xe(Je,"RuntimeRules",Ni);function Le(){return Le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(this,arguments)}function Ss(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},sr(e)}function an(e,t){return an=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},an(e,t)}function Ms(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function cn(e,t,n){return Ms()?cn=Reflect.construct:cn=function(i,u,o){var a=[null];a.push.apply(a,u);var c=Function.bind.apply(i,a),l=new c;return o&&an(l,o.prototype),l},cn.apply(null,arguments)}function Ns(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ar(e){var t=typeof Map=="function"?new Map:void 0;return ar=function(r){if(r===null||!Ns(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return cn(r,arguments,sr(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),an(i,r)},ar(e)}var Is=/%[sdj%]/g,Ii=function(){};typeof process!="undefined"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window!="undefined"&&typeof document!="undefined"&&(Ii=function(t,n){typeof console!="undefined"&&console.warn&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function cr(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=1,i=t[0],u=t.length;if(typeof i=="function")return i.apply(null,t.slice(1));if(typeof i=="string"){var o=String(i).replace(Is,function(a){if(a==="%%")return"%";if(r>=u)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(c){return"[Circular]"}break;default:return a}});return o}return i}function xs(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function le(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||xs(t)&&typeof e=="string"&&!e)}function Os(e,t,n){var r=[],i=0,u=e.length;function o(a){r.push.apply(r,a),i++,i===u&&n(r)}e.forEach(function(a){t(a,o)})}function xi(e,t,n){var r=0,i=e.length;function u(o){if(o&&o.length){n(o);return}var a=r;r=r+1,a<i?t(e[a],u):n([])}u([])}function Rs(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n])}),t}var Oi=function(e){Ss(t,e);function t(n,r){var i;return i=e.call(this,"Async Validation Error")||this,i.errors=n,i.fields=r,i}return t}(ar(Error));function Ps(e,t,n,r){if(t.first){var i=new Promise(function(s,d){var h=function(A){return r(A),A.length?d(new Oi(A,cr(A))):s()},g=Rs(e);xi(g,n,h)});return i.catch(function(s){return s}),i}var u=t.firstFields||[];u===!0&&(u=Object.keys(e));var o=Object.keys(e),a=o.length,c=0,l=[],f=new Promise(function(s,d){var h=function(D){if(l.push.apply(l,D),c++,c===a)return r(l),l.length?d(new Oi(l,cr(l))):s()};o.length||(r(l),s()),o.forEach(function(g){var D=e[g];u.indexOf(g)!==-1?xi(D,n,h):Os(D,n,h)})});return f.catch(function(s){return s}),f}function Ri(e){return function(t){return t&&t.message?(t.field=t.field||e.fullField,t):{message:typeof t=="function"?t():t,field:t.field||e.fullField}}}function Pi(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]=Le(Le({},e[n]),r):e[n]=r}}return e}function ji(e,t,n,r,i,u){e.required&&(!n.hasOwnProperty(e.field)||le(t,u||e.type))&&r.push(Ne(i.messages.required,e.fullField))}function js(e,t,n,r,i){(/^\s+$/.test(t)||t==="")&&r.push(Ne(i.messages.whitespace,e.fullField))}var fr={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Vt={integer:function(t){return Vt.number(t)&&parseInt(t,10)===t},float:function(t){return Vt.number(t)&&!Vt.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(n){return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Vt.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&!!t.match(fr.email)&&t.length<255},url:function(t){return typeof t=="string"&&!!t.match(fr.url)},hex:function(t){return typeof t=="string"&&!!t.match(fr.hex)}};function $s(e,t,n,r,i){if(e.required&&t===void 0){ji(e,t,n,r,i);return}var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],o=e.type;u.indexOf(o)>-1?Vt[o](t)||r.push(Ne(i.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Ne(i.messages.types[o],e.fullField,e.type))}function ks(e,t,n,r,i){var u=typeof e.len=="number",o=typeof e.min=="number",a=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=t,f=null,s=typeof t=="number",d=typeof t=="string",h=Array.isArray(t);if(s?f="number":d?f="string":h&&(f="array"),!f)return!1;h&&(l=t.length),d&&(l=t.replace(c,"_").length),u?l!==e.len&&r.push(Ne(i.messages[f].len,e.fullField,e.len)):o&&!a&&l<e.min?r.push(Ne(i.messages[f].min,e.fullField,e.min)):a&&!o&&l>e.max?r.push(Ne(i.messages[f].max,e.fullField,e.max)):o&&a&&(l<e.min||l>e.max)&&r.push(Ne(i.messages[f].range,e.fullField,e.min,e.max))}var Ct="enum";function Ts(e,t,n,r,i){e[Ct]=Array.isArray(e[Ct])?e[Ct]:[],e[Ct].indexOf(t)===-1&&r.push(Ne(i.messages[Ct],e.fullField,e[Ct].join(", ")))}function qs(e,t,n,r,i){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Ne(i.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var u=new RegExp(e.pattern);u.test(t)||r.push(Ne(i.messages.pattern.mismatch,e.fullField,t,e.pattern))}}}var H={required:ji,whitespace:js,type:$s,range:ks,enum:Ts,pattern:qs};function Us(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"string")&&!e.required)return n();H.required(e,t,r,u,i,"string"),le(t,"string")||(H.type(e,t,r,u,i),H.range(e,t,r,u,i),H.pattern(e,t,r,u,i),e.whitespace===!0&&H.whitespace(e,t,r,u,i))}n(u)}function Ls(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&H.type(e,t,r,u,i)}n(u)}function Hs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(t===""&&(t=void 0),le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&(H.type(e,t,r,u,i),H.range(e,t,r,u,i))}n(u)}function Vs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&H.type(e,t,r,u,i)}n(u)}function zs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),le(t)||H.type(e,t,r,u,i)}n(u)}function Ws(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&(H.type(e,t,r,u,i),H.range(e,t,r,u,i))}n(u)}function Zs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&(H.type(e,t,r,u,i),H.range(e,t,r,u,i))}n(u)}function Xs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(t==null&&!e.required)return n();H.required(e,t,r,u,i,"array"),t!=null&&(H.type(e,t,r,u,i),H.range(e,t,r,u,i))}n(u)}function Js(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&H.type(e,t,r,u,i)}n(u)}var Gs="enum";function Ks(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i),t!==void 0&&H[Gs](e,t,r,u,i)}n(u)}function Qs(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"string")&&!e.required)return n();H.required(e,t,r,u,i),le(t,"string")||H.pattern(e,t,r,u,i)}n(u)}function Ys(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t,"date")&&!e.required)return n();if(H.required(e,t,r,u,i),!le(t,"date")){var a;t instanceof Date?a=t:a=new Date(t),H.type(e,a,r,u,i),a&&H.range(e,a.getTime(),r,u,i)}}n(u)}function ea(e,t,n,r,i){var u=[],o=Array.isArray(t)?"array":typeof t;H.required(e,t,r,u,i,o),n(u)}function lr(e,t,n,r,i){var u=e.type,o=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(le(t,u)&&!e.required)return n();H.required(e,t,r,o,i,u),le(t,u)||H.type(e,t,r,o,i)}n(o)}function ta(e,t,n,r,i){var u=[],o=e.required||!e.required&&r.hasOwnProperty(e.field);if(o){if(le(t)&&!e.required)return n();H.required(e,t,r,u,i)}n(u)}var zt={string:Us,method:Ls,number:Hs,boolean:Vs,regexp:zs,integer:Ws,float:Zs,array:Xs,object:Js,enum:Ks,pattern:Qs,date:Ys,url:lr,hex:lr,email:lr,required:ea,any:ta};function dr(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var hr=dr();function rt(e){this.rules=null,this._messages=hr,this.define(e)}rt.prototype={messages:function(t){return t&&(this._messages=Pi(dr(),t)),this._messages},define:function(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={};var n,r;for(n in t)t.hasOwnProperty(n)&&(r=t[n],this.rules[n]=Array.isArray(r)?r:[r])},validate:function(t,n,r){var i=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var u=t,o=n,a=r;if(typeof o=="function"&&(a=o,o={}),!this.rules||Object.keys(this.rules).length===0)return a&&a(),Promise.resolve();function c(D){var A,p=[],v={};function m(C){if(Array.isArray(C)){var E;p=(E=p).concat.apply(E,C)}else p.push(C)}for(A=0;A<D.length;A++)m(D[A]);p.length?v=cr(p):(p=null,v=null),a(p,v)}if(o.messages){var l=this.messages();l===hr&&(l=dr()),Pi(l,o.messages),o.messages=l}else o.messages=this.messages();var f,s,d={},h=o.keys||Object.keys(this.rules);h.forEach(function(D){f=i.rules[D],s=u[D],f.forEach(function(A){var p=A;typeof p.transform=="function"&&(u===t&&(u=Le({},u)),s=u[D]=p.transform(s)),typeof p=="function"?p={validator:p}:p=Le({},p),p.validator=i.getValidationMethod(p),p.field=D,p.fullField=p.fullField||D,p.type=i.getType(p),p.validator&&(d[D]=d[D]||[],d[D].push({rule:p,value:s,source:u,field:D}))})});var g={};return Ps(d,o,function(D,A){var p=D.rule,v=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");v=v&&(p.required||!p.required&&D.value),p.field=D.field;function m(S,N){return Le(Le({},N),{},{fullField:p.fullField+"."+S})}function C(S){S===void 0&&(S=[]);var N=S;if(Array.isArray(N)||(N=[N]),!o.suppressWarning&&N.length&&rt.warning("async-validator:",N),N.length&&p.message!==void 0&&(N=[].concat(p.message)),N=N.map(Ri(p)),o.first&&N.length)return g[p.field]=1,A(N);if(!v)A(N);else{if(p.required&&!D.value)return p.message!==void 0?N=[].concat(p.message).map(Ri(p)):o.error&&(N=[o.error(p,Ne(o.messages.required,p.field))]),A(N);var $={};if(p.defaultField)for(var z in D.value)D.value.hasOwnProperty(z)&&($[z]=p.defaultField);$=Le(Le({},$),D.rule.fields);for(var V in $)if($.hasOwnProperty(V)){var O=Array.isArray($[V])?$[V]:[$[V]];$[V]=O.map(m.bind(null,V))}var j=new rt($);j.messages(o.messages),D.rule.options&&(D.rule.options.messages=o.messages,D.rule.options.error=o.error),j.validate(D.value,D.rule.options||o,function(G){var X=[];N&&N.length&&X.push.apply(X,N),G&&G.length&&X.push.apply(X,G),A(X.length?X:null)})}}var E;p.asyncValidator?E=p.asyncValidator(p,D.value,C,D.source,o):p.validator&&(E=p.validator(p,D.value,C,D.source,o),E===!0?C():E===!1?C(p.message||p.field+" fails"):E instanceof Array?C(E):E instanceof Error&&C(E.message)),E&&E.then&&E.then(function(){return C()},function(S){return C(S)})},function(D){c(D)})},getType:function(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!zt.hasOwnProperty(t.type))throw new Error(Ne("Unknown rule type %s",t.type));return t.type||"string"},getValidationMethod:function(t){if(typeof t.validator=="function")return t.validator;var n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?zt.required:zt[this.getType(t)]||!1}},rt.register=function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");zt[t]=n},rt.warning=Ii,rt.messages=hr,rt.validators=zt;var na={required:"%s \u5FC5\u586B",maxLength:"%s \u8D85\u51FA\u6700\u5927\u957F\u5EA6\u9650\u5236",minLength:"%s \u5C0F\u4E8E\u6700\u5C0F\u957F\u5EA6\u9650\u5236",string:{range:"%s \u4E0D\u5728\u6307\u5B9A\u957F\u5EA6\u5185"}};function ra(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=new rt(e);return n.messages(Object.assign(na,t)),n}var ia=new yi;function pr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ua(e){if(Array.isArray(e))return e}function oa(e){if(Array.isArray(e))return pr(e)}function $i(e,t,n,r,i,u,o){try{var a=e[u](o),c=a.value}catch(l){n(l);return}a.done?t(c):Promise.resolve(c).then(r,i)}function ki(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function o(c){$i(u,r,i,o,a,"next",c)}function a(c){$i(u,r,i,o,a,"throw",c)}o(void 0)})}}function sa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ti(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aa(e,t,n){return t&&Ti(e.prototype,t),n&&Ti(e,n),e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qi(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Ui(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ca(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){J(e,i,n[i])})}return e}function la(e){return ua(e)||Ui(e)||Hi(e)||ca()}function gr(e){return oa(e)||Ui(e)||Hi(e)||fa()}function da(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Hi(e,t){if(!!e){if(typeof e=="string")return pr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pr(e,t)}}function Vi(e,t){var n,r,i,u,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=l[0]&2?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(f){l=[6,f],r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var ye=function(){function t(n){var r=this;sa(this,t),J(this,"id",void 0),J(this,"name",void 0),J(this,"icon",void 0),J(this,"type",void 0),J(this,"controlType",void 0),J(this,"props",void 0),J(this,"setting",[]),J(this,"fieldType",void 0),J(this,"eventKeys",[]),J(this,"customEvents",[]),J(this,"parent",null),J(this,"slots",void 0),J(this,"slotPosition",void 0),J(this,"updateSetting",Wi),J(this,"removeSetting",zi),this._callControlHooks("preInstance",n);var i=qi(this,t)?this.constructor:void 0,u=i.controlName,o=i.controlIcon,a=i.controlType,c=i.controlFieldType,l=i.controlEventKeys,f=i.controlCustomEvents,s=i.name,d=i.setting,h=i.slots,g=i.slotPosition;u&&o&&a||si("The ".concat(s," controlName,controlIcon,controlType is not define"));var D;this.id=(D=n==null?void 0:n.id)!==null&&D!==void 0?D:tn(10),this.name=u,this.icon=o;var A;this.type=(A=n==null?void 0:n.type)!==null&&A!==void 0?A:a,this.props=new Je(n==null?void 0:n.props,(qi(this,t)?this.constructor:void 0).controlName);var p;this.controlType=(p=n==null?void 0:n.controlType)!==null&&p!==void 0?p:"base",this.setting=Q(d);var v;this.fieldType=(v=n==null?void 0:n.fieldType)!==null&&v!==void 0?v:c,this.eventKeys=Q(l),this.customEvents=Q(f),this.slots=Q(h),this.slotPosition=Q(g),Promise.resolve().then(function(){r._callControlHooks("postInstance",n)})}return aa(t,[{key:"rules",get:function(){var r=this.props.constructor.Rules;return r?new r(this.props):{}}},{key:"_callControlHooks",value:function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];var o,a=la(i),c=a[0],l=a.slice(1);return(o=ia).emit.apply(o,[c,this].concat(gr(l)))}},{key:"preUpdate",value:function(r,i){this._callControlHooks("preUpdateProps",r,i)}},{key:"postUpdate",value:function(r,i){this._callControlHooks("postUpdateProps",r,i)}},{key:"updateProps",value:function(r,i){this.preUpdate(r,i),Vn(this.props,r,i),this.postUpdate(r,i)}},{key:"preValidate",value:function(){var r=this;return ki(function(){var i,u,o;return Vi(this,function(a){switch(a.label){case 0:return i=Li({},r.rules),[4,r._callControlHooks("preValidate",i)];case 1:return u=a.sent(),o=u[u.length-1],[2,o===!1?void 0:o]}})})()}},{key:"validate",value:function(r,i){var u=this;return ki(function(){var o,a,c,l;return Vi(this,function(f){switch(f.label){case 0:return[4,u.preValidate()];case 1:o=f.sent(),a=o!==void 0?o:Li({},u.rules),Array.isArray(i)&&i.forEach(function(s){a.hasOwnProperty(s)&&delete a[s]}),c=ra(a,r),f.label=2;case 2:return f.trys.push([2,4,,5]),[4,c.validate(u.props)];case 3:return f.sent(),[2,!0];case 4:throw l=f.sent(),l.control||(l.control=u),l;case 5:return[2]}})})()}},{key:"toDataBindModel",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this.fieldType,u=this.id,o=this.type,a=this.props,c=a.dataBind,l=a.datasourceBind,f=a.optionConfig,s=a.caption,d=a.required,h=a.maxLength,g=a.options,D=a.encrypted,A=a.encryptedMode;if(!(!i&&!c&&!l)){var p={parentId:r,fieldType:i,controlId:u,caption:s,type:o,props:{}};switch(c&&(p.dataBind=c),f){case"datasource":case void 0:l&&(p.datasourceBind=l);break;case"custom":p.props.options=g;break}return d!==void 0&&(p.required=d),h!==void 0&&(p.maxLength=h),D!==void 0&&(p.encrypted=D),A!==void 0&&(p.encryptedMode=A),p}}},{key:"preToSchema",value:function(){this._callControlHooks("preToSchema",this)}},{key:"toSchema",value:function(){return this.preToSchema(),{id:this.id,type:this.type,props:Q(this.props),fieldType:this.fieldType,controlType:this.controlType}}}],[{key:"updateBasicControl",value:function(r,i){if(r==="setting"){if(i.add){var u;(u=this.setting).push.apply(u,gr(i.add))}i.remove&&this.removeSettingItem(i.remove),i.update}}}]),t}();J(ye,"mode","Designer"),J(ye,"slots",void 0),J(ye,"slotPosition",void 0),J(ye,"controlName","\u63A7\u4EF6"),J(ye,"controlIcon","icon"),J(ye,"controlType","control"),J(ye,"controlFieldType",void 0),J(ye,"controlEventKeys",[]),J(ye,"controlCustomEvents",[]),J(ye,"setting",[]),J(ye,"__is_control__",!0),J(ye,"removeSettingItem",zi),J(ye,"updateSettingItem",Wi);function zi(e){var t=this,n=Array.isArray(e)?e:[e];n.forEach(function(r){var i,u=typeof r!="string",o=(i=t.setting)===null||i===void 0?void 0:i.findIndex(function(l){return l.key===(u?r.key:r)});if(o!==-1){var a,c;u?t.setting[o].showItems=(a=t.setting[o].showItems)===null||a===void 0?void 0:a.filter(function(l){return!r.hideItems.includes(l)}):t.setting.splice(o,1),u&&!(!((c=t.setting[o].showItems)===null||c===void 0)&&c.length)&&t.setting.splice(o,1)}})}function Wi(e,t){var n=this,r=typeof e=="string"?[e]:e;r.forEach(function(i){var u=n.setting.find(function(l){return l.key===i});if(u){if(typeof t=="boolean")u.visible=t;else if((typeof t=="undefined"?"undefined":da(t))==="object"){var o,a=(o=t.type)!==null&&o!==void 0?o:"replace";if(a==="replace")u.showItems=t.showItems;else{var c;(c=u.showItems).push.apply(c,gr(t.showItems))}}}})}function ha(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pa(e,t,n){return t&&Zi(e.prototype,t),n&&Zi(e,n),e}function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ga(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var Wt=function(){function t(n){ha(this,t),Ie(this,"id",void 0),Ie(this,"type",void 0),Ie(this,"controlType",void 0),Ie(this,"props",void 0),Ie(this,"fieldType",void 0),Ie(this,"customEvents",[]),Ie(this,"pageStatus",void 0),Ie(this,"parent",null);var r=ga(this,t)?this.constructor:void 0,i=r.controlType,u=r.controlFieldType,o=r.name,a=r.controlCustomEvents;i||si("The ".concat(o," controlType is not define"));var c;this.id=(c=n==null?void 0:n.id)!==null&&c!==void 0?c:tn(10);var l;this.type=(l=n==null?void 0:n.type)!==null&&l!==void 0?l:i,this.props=new Je(n==null?void 0:n.props),this.customEvents=a;var f;this.controlType=(f=n==null?void 0:n.controlType)!==null&&f!==void 0?f:"base";var s;this.fieldType=(s=n==null?void 0:n.fieldType)!==null&&s!==void 0?s:u;var d;this.pageStatus=(d=n==null?void 0:n.pageStatus)!==null&&d!==void 0?d:rr.UNKNOWN}return pa(t,[{key:"rules",get:function(){var r=this.props.constructor.RuntimeRules;if(r){var i=new r(this.props);return Array.from(i)}return[]}}]),t}();Ie(Wt,"mode","Runtime"),Ie(Wt,"controlType","control"),Ie(Wt,"controlFieldType",void 0),Ie(Wt,"__is_control__",!0),Ie(Wt,"controlCustomEvents",[]);function xe(e){return(e==null?void 0:e.dataCode)!==void 0&&(e==null?void 0:e.fieldCode)!==void 0}function de(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(e){return fn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fn(e)}function yr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vr(e,t)}function Da(e,t){return t&&(ya(t)==="object"||typeof t=="function")?t:de(e)}function vr(e,t){return vr=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},vr(e,t)}function ya(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function va(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function mr(e){var t=va();return function(){var r=fn(e),i;if(t){var u=fn(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return Da(this,i)}}var ma=function(e){yr(n,e);var t=mr(n);function n(r){Dr(this,n);var i;i=t.call(this,r),ae(de(i),"dataBind",{}),ae(de(i),"caption",{type:"string",required:!0,message:W.getMessage("pleaseEnterCaption")}),ae(de(i),"isHideCaption",{type:"boolean"}),ae(de(i),"labelPosition",{type:"enum",enum:["top","left"]}),ae(de(i),"defaultState",{type:"enum",enum:["default","readonly"]}),ae(de(i),"required",{type:"boolean"}),ae(de(i),"captionTip",{type:"string",required:!1,message:W.getMessage("pleaseEnterCaptionTip")});var u={fieldCode:{type:"string",required:!0,message:W.getMessage("pleaseEnterFieldCode")},dataCode:{type:"string",required:!0,message:W.getMessage("pleaseEnterFieldCode")}};if(xe(r.dataBind))i.dataBind={type:"object",required:!0,fields:Q(u),message:W.getMessage("pleaseEnterFieldCode")};else{var o={type:"object",required:!0,fields:{},message:W.getMessage("pleaseEnterFieldCode")};Object.keys(r.dataBind).forEach(function(a){o.fields[a]={type:"object",required:!0,fields:Q(u),message:W.getMessage("pleaseEnterFieldCode")}}),i.dataBind=o}return r.isShowCaptionTip&&(i.captionTip.required=!0),i}return n}(or),wa=function(e){yr(n,e);var t=mr(n);function n(r){Dr(this,n);var i;i=t.call(this,r);var u=r.isHide?!1:r.required;return u&&i.push({type:"string",required:u,message:r.requiredMessage!==""?r.requiredMessage:W.getMessage("runtimeRequired",{caption:r.caption})}),i}return n}(Ni),wr=function(e){yr(n,e);var t=mr(n);function n(r){Dr(this,n);var i;i=t.call(this,r),ae(de(i),"caption",void 0),ae(de(i),"isHideCaption",void 0),ae(de(i),"isShowCaptionTip",void 0),ae(de(i),"captionTip",void 0),ae(de(i),"labelPosition",void 0),ae(de(i),"dataBind",void 0),ae(de(i),"defaultValue",void 0),ae(de(i),"placeholder",void 0),ae(de(i),"defaultState",void 0),ae(de(i),"required",void 0),ae(de(i),"requiredMessage",void 0);var u;i.caption=(u=r==null?void 0:r.caption)!==null&&u!==void 0?u:"";var o;i.isHideCaption=(o=r==null?void 0:r.isHideCaption)!==null&&o!==void 0?o:!1;var a;i.isShowCaptionTip=(a=r==null?void 0:r.isShowCaptionTip)!==null&&a!==void 0?a:!1;var c;i.captionTip=(c=r==null?void 0:r.captionTip)!==null&&c!==void 0?c:"";var l;i.defaultState=(l=r==null?void 0:r.defaultState)!==null&&l!==void 0?l:"default";var f;i.labelPosition=(f=r==null?void 0:r.labelPosition)!==null&&f!==void 0?f:"top";var s;i.placeholder=(s=r==null?void 0:r.placeholder)!==null&&s!==void 0?s:"";var d;i.required=(d=r==null?void 0:r.required)!==null&&d!==void 0?d:!1;var h;i.requiredMessage=(h=r==null?void 0:r.requiredMessage)!==null&&h!==void 0?h:"",i.dataBind=new Qn(r==null?void 0:r.dataBind);var g;return i.defaultValue=(g=r==null?void 0:r.defaultValue)!==null&&g!==void 0?g:"",i}return n}(Je);ae(wr,"Rules",ma),ae(wr,"RuntimeRules",wa);function Ar(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Aa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ln(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},dn(e)}function Ca(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cr(e,t)}function ba(e,t){return t&&(Ea(t)==="object"||typeof t=="function")?t:Ar(e)}function Cr(e,t){return Cr=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Cr(e,t)}function Ea(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Fa(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _a(e){var t=Fa();return function(){var r=dn(e),i;if(t){var u=dn(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return ba(this,i)}}var Xi=function(e){Ca(n,e);var t=_a(n);function n(r){Aa(this,n);var i;return i=t.call(this,r),ln(Ar(i),"controlType","form"),ln(Ar(i),"props",void 0),i.props=new wr(r==null?void 0:r.props),i}return n}(ye);ln(Xi,"controlEventKeys",["on_change","on_focus","on_blur"]),ln(Xi,"controlCustomAttributes",void 0);function Ba(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hn(e){return hn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},hn(e)}function Ma(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&br(e,t)}function Na(e,t){return t&&(Ia(t)==="object"||typeof t=="function")?t:Ba(e)}function br(e,t){return br=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},br(e,t)}function Ia(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function xa(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Oa(e){var t=xa();return function(){var r=hn(e),i;if(t){var u=hn(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return Na(this,i)}}var Ra=function(e){Ma(n,e);var t=Oa(n);function n(r){return Sa(this,n),t.call(this,r)}return n}(Je);function Er(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pa(e){if(Array.isArray(e))return Er(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ji(e,t,n,r,i,u,o){try{var a=e[u](o),c=a.value}catch(l){n(l);return}a.done?t(c):Promise.resolve(c).then(r,i)}function ja(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function o(c){Ji(u,r,i,o,a,"next",c)}function a(c){Ji(u,r,i,o,a,"throw",c)}o(void 0)})}}function $a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ka(e,t,n){return t&&Gi(e.prototype,t),n&&Gi(e,n),e}function it(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e,t,n){return typeof Reflect!="undefined"&&Reflect.get?bt=Reflect.get:bt=function(i,u,o){var a=Za(i,u);if(!!a){var c=Object.getOwnPropertyDescriptor(a,u);return c.get?c.get.call(o||i):c.value}},bt(e,t,n||e)}function ut(e){return ut=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ut(e)}function Ta(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fr(e,t)}function qa(e,t){return t!=null&&typeof Symbol!="undefined"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Ua(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function La(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){it(e,i,n[i])})}return e}function Va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function za(e,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Va(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Wa(e,t){return t&&(Xa(t)==="object"||typeof t=="function")?t:pt(e)}function Fr(e,t){return Fr=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Fr(e,t)}function Za(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=ut(e),e!==null););return e}function Ki(e){return Pa(e)||Ua(e)||Ja(e)||La()}function Xa(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Ja(e,t){if(!!e){if(typeof e=="string")return Er(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Er(e,t)}}function Ga(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Ka(e){var t=Ga();return function(){var r=ut(e),i;if(t){var u=ut(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return Wa(this,i)}}function Qa(e,t){var n,r,i,u,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=l[0]&2?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(f){l=[6,f],r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Ya=1e4,Qi=function(t){Ta(r,t);var n=Ka(r);function r(i){$a(this,r);var u;u=n.call(this,i),it(pt(u),"controlType","layout"),it(pt(u),"children",void 0),it(pt(u),"excludes",void 0),it(pt(u),"childrenMaxLength",void 0),it(pt(u),"props",void 0);var o=qa(this,r)?this.constructor:void 0,a=o.excludes,c=o.childrenMaxLength;return u.props=new Ra(i==null?void 0:i.props),Kn(pt(u),"children",i==null?void 0:i.children,void 0,"Designer"),u.excludes=Q(a),u.childrenMaxLength=c,u}return ka(r,[{key:"judgeExcludesChildren",value:function(u){return this.excludes===!1||Array.isArray(this.excludes)&&!this.excludes.includes(u)}},{key:"judgeJoinChildren",value:function(u){var o=this.judgeExcludesChildren(u);return o&&this.childrenMaxLength>this.children.length}},{key:"validate",value:function(u,o){var a=this,c=this,l=function(){return bt(ut(r.prototype),"validate",a)};return ja(function(){return Qa(this,function(f){switch(f.label){case 0:return[4,l().call(c,u,o)];case 1:return f.sent(),[4,Promise.all(c.children.map(function(s){return s.validate(u,o)}))];case 2:return f.sent(),[2,!0]}})})()}},{key:"toDataBindModel",value:function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,o=bt(ut(r.prototype),"toDataBindModel",this).call(this),a=o?[o]:[];return this.children.reduce(function(c,l){var f=l.toDataBindModel(u);if(Array.isArray(f)){var s=f.filter(function(d){return!!d});return Ki(c).concat(Ki(s))}return f&&c.push(f),c},a)}},{key:"toSchema",value:function(){var u=bt(ut(r.prototype),"toSchema",this).call(this),o=this.children.map(function(a){var c=a.toSchema();return c});return za(Ha({},u),{children:o})}}]),r}(ye);it(Qi,"excludes",!1),it(Qi,"childrenMaxLength",Ya);function Ge(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ec(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(e){return pn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},pn(e)}function tc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_r(e,t)}function nc(e,t){return t&&(rc(t)==="object"||typeof t=="function")?t:Ge(e)}function _r(e,t){return _r=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},_r(e,t)}function rc(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function ic(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function uc(e){var t=ic();return function(){var r=pn(e),i;if(t){var u=pn(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return nc(this,i)}}var oc=function(e){tc(n,e);var t=uc(n);function n(r,i,u){ec(this,n);var o;o=t.call(this,i),Et(Ge(o),"headers",void 0),Et(Ge(o),"footers",void 0),Et(Ge(o),"pageIndex",void 0),Et(Ge(o),"pageSize",void 0),Et(Ge(o),"pageSizeOptions",void 0),Et(Ge(o),"totalCount",void 0),Kn(Ge(o),"headers",i==null?void 0:i.headers,r,u),Kn(Ge(o),"footers",i==null?void 0:i.footers,r);var a;o.pageIndex=(a=i==null?void 0:i.pageIndex)!==null&&a!==void 0?a:1;var c;o.pageSize=(c=i==null?void 0:i.pageSize)!==null&&c!==void 0?c:20;var l;o.pageSizeOptions=(l=i==null?void 0:i.pageSizeOptions)!==null&&l!==void 0?l:[20];var f;return o.totalCount=(f=i==null?void 0:i.totalCount)!==null&&f!==void 0?f:0,o}return n}(Je);function Br(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sc(e){if(Array.isArray(e))return Br(e)}function gn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yi(e,t,n,r,i,u,o){try{var a=e[u](o),c=a.value}catch(l){n(l);return}a.done?t(c):Promise.resolve(c).then(r,i)}function ac(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function o(c){Yi(u,r,i,o,a,"next",c)}function a(c){Yi(u,r,i,o,a,"throw",c)}o(void 0)})}}function cc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fc(e,t,n){return t&&eu(e.prototype,t),n&&eu(e,n),e}function Dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ft(e,t,n){return typeof Reflect!="undefined"&&Reflect.get?Ft=Reflect.get:Ft=function(i,u,o){var a=Dc(i,u);if(!!a){var c=Object.getOwnPropertyDescriptor(a,u);return c.get?c.get.call(o||i):c.value}},Ft(e,t,n||e)}function ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ot(e)}function lc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sr(e,t)}function dc(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function tu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Dn(e,i,n[i])})}return e}function pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nu(e,t){return t=t!=null?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pc(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function gc(e,t){return t&&(yc(t)==="object"||typeof t=="function")?t:gn(e)}function Sr(e,t){return Sr=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Sr(e,t)}function Dc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=ot(e),e!==null););return e}function ru(e){return sc(e)||dc(e)||vc(e)||hc()}function yc(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function vc(e,t){if(!!e){if(typeof e=="string")return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Br(e,t)}}function mc(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function wc(e){var t=mc();return function(){var r=ot(e),i;if(t){var u=ot(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return gc(this,i)}}function Ac(e,t){var n,r,i,u,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(l){return function(f){return c([l,f])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=l[0]&2?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(l[0]===6&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(f){l=[6,f],r=0}finally{n=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Cc=function(e){lc(n,e);var t=wc(n);function n(r){cc(this,n);var i;return i=t.call(this,r),Dn(gn(i),"controlType","list"),Dn(gn(i),"props",void 0),i.props=new oc(gn(i),r==null?void 0:r.props,"Designer"),i}return fc(n,[{key:"validate",value:function(i,u){var o=this,a=this,c=function(){return Ft(ot(n.prototype),"validate",o)};return ac(function(){return Ac(this,function(l){switch(l.label){case 0:return[4,c().call(a,i)];case 1:return l.sent(),[4,Promise.all(a.props.headers.map(function(f){return f.validate(i,u)}))];case 2:return l.sent(),[2,!0]}})})()}},{key:"toDataBindModel",value:function(){var i=Ft(ot(n.prototype),"toDataBindModel",this).call(this),u=i?[i]:[],o=this.id;return this.props.headers.reduce(function(a,c){var l=c.toDataBindModel(o);if(Array.isArray(l)){var f=l.filter(function(s){return!!s});return ru(a).concat(ru(f))}return l&&a.push(l),a},u)}},{key:"toSchema",value:function(){var i=Ft(ot(n.prototype),"toSchema",this).call(this),u=this.props.headers.map(function(o){return o.toSchema()});return nu(tu({},i),{props:nu(tu({},this.props),{headers:u})})}}]),n}(ye);Dn(Cc,"controlFieldType",se.LIST);function Ee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yn(e){return yn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},yn(e)}function uu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mr(e,t)}function bc(e,t){return t&&(Ec(t)==="object"||typeof t=="function")?t:Ee(e)}function Mr(e,t){return Mr=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Mr(e,t)}function Ec(e){return e&&typeof Symbol!="undefined"&&e.constructor===Symbol?"symbol":typeof e}function Fc(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function ou(e){var t=Fc();return function(){var r=yn(e),i;if(t){var u=yn(this).constructor;i=Reflect.construct(r,arguments,u)}else i=r.apply(this,arguments);return bc(this,i)}}var _c=function(e){uu(n,e);var t=ou(n);function n(r){iu(this,n);var i;return i=t.call(this,r),Fe(Ee(i),"caption",{type:"string",required:!0,message:W.getMessage("pleaseEnterCaption")}),Fe(Ee(i),"width",{type:"number",required:!1,message:W.getMessage("pleaseEnterColumnWidth")}),i.width.required=r.widthType==="px",i}return n}(or),Bc=function(e){uu(n,e);var t=ou(n);function n(r){iu(this,n);var i;i=t.call(this,r),Fe(Ee(i),"widthType",void 0),Fe(Ee(i),"width",void 0),Fe(Ee(i),"caption",void 0),Fe(Ee(i),"dataBind",void 0),Fe(Ee(i),"autoWidth",void 0),Fe(Ee(i),"fixed",void 0),Fe(Ee(i),"sort",void 0),Fe(Ee(i),"align",void 0),Fe(Ee(i),"colSpan",void 0),Fe(Ee(i),"autoHeight",void 0),Fe(Ee(i),"children",void 0);var u;i.width=(u=r==null?void 0:r.width)!==null&&u!==void 0?u:150,i.widthType=(r==null?void 0:r.widthType)||"auto";var o;i.caption=(o=r==null?void 0:r.caption)!==null&&o!==void 0?o:"";var a;i.fixed=(a=r==null?void 0:r.fixed)!==null&&a!==void 0?a:"none",i.autoWidth=new ws(r==null?void 0:r.autoWidth),i.dataBind=new Qn(r==null?void 0:r.dataBind);var c;i.sort=(c=r==null?void 0:r.sort)!==null&&c!==void 0?c:!0,i.align=r==null?void 0:r.align,i.colSpan=r==null?void 0:r.colSpan;var l;return i.autoHeight=(l=r==null?void 0:r.autoHeight)!==null&&l!==void 0?l:!1,i}return n}(Je);Fe(Bc,"Rules",_c);function vn(e){return e.controlType===U.LAYOUT||e.controlType===U.WRAP||e.controlType===U.LIST||e.controlType===U.SEARCH||e.controlType===U.COLUMN&&e.type!==re.OPERATION_COLUMN}function gt(e,t){Array.isArray(e)&&e.map(n=>{n.controlType===U.LIST?t(n,[]):vn(n)?gt(n==null?void 0:n.children,t):n.controlType===U.FORM&&t(n)})}function Dt(e,t){Array.isArray(e)&&e.map(n=>{n.type===re.DATA_VIEW||n.type===re.SIMPLE_SEARCH?t(n):vn(n)&&Dt(n==null?void 0:n.children,t)})}let su=0;function Zt(e=""){const t=Date.now(),n=Math.floor(Math.random()*1e9);return su++,e+"_"+n+su+String(t)}class we extends Ut{constructor(t){super("Runtime"),this._flatInstances=[],this._instanceMap={},this._controlParentIdMap={};const{schema:n}=t;this._schema=n,this._instance=this.createControl(n,t.beforeCreateInstance),this.getFlatInstances()}getFlatInstances(){const t=[],n={},r={};return Nr(this._instance,"",(i,u)=>{var o;u&&(r[i.id]=u),n[i.id]||(n[i.id]=[]),!(i.type==="subtable-column"&&n[i.id].length>0)&&(t.push(i),!(((o=i.parent)==null?void 0:o.type)===re.SUBTABLE_COLUMN&&i.parent.parent===void 0)&&n[i.id].push(i))}),this._flatInstances=t,this._instanceMap=n,this._controlParentIdMap=r,this._flatInstances}get schema(){return this._schema}get instance(){return this._instance}get flatInstances(){return this._flatInstances}get instanceMap(){return this._instanceMap}get allRules(){let t={},n={},r={};return Dt(this._instance,i=>{let u=we.staticGetRules(i.type,i.props);n[i.id]=Q(u[0]),t[i.id]=Q(u[0]),r[i.id]=Q(u[0]),gt(i.children,o=>{(o.controlType===U.FORM||o.controlType===U.LIST)&&(au(n[i.id].fields,o,!0),lu(t[i.id].fields,o,!0),cu(r[i.id].fields,o,!0))})}),{rules:this.rules,antdRules:this.antdRules,fieldCodeRules:this.fieldCodeRules,defaultAntdRules:t,defaultRule:n,defaultFieldRules:r}}get rules(){let t={};return Dt(this._instance,n=>{let r=we.staticGetRules(n.type,n.props);t[n.id]=r[0],gt(n.children,i=>{(i.controlType===U.FORM||i.controlType===U.LIST)&&au(t[n.id].fields,i)})}),t}get fieldCodeRules(){let t={};return Dt(this._instance,n=>{let r=we.staticGetRules(n.type,n.props);t[n.id]=r[0],gt(n.children,i=>{(i.controlType===U.FORM||i.controlType===U.LIST)&&cu(t[n.id].fields,i)})}),t}get antdRules(){let t={};return Dt(this._instance,n=>{let r=we.staticGetRules(n.type,n.props);t[n.id]=r[0],gt(n.children,i=>{(i.controlType===U.FORM||i.controlType===U.LIST)&&lu(t[n.id].fields,i)})}),t}}function Nr(e,t,n){(Array.isArray(e)?e:[e]).map(i=>{if(n(i,t),vn(i)){const u=i;u.children||(u.children=[]),Nr(u.children,u.id,n)}Sc(i,"headers")&&Nr(i.props.headers,i.id,n)})}function Sc(e,t){return t in e.props&&dt(e.props[t])}function mn(e){return e.props.isHide?!0:e.parent===null||e.parent===void 0?!1:mn(e.parent)}function au(e,t,n=!1){if(mn(t))return;let r=we.staticGetRules(t.type,t.props);if(t.controlType===U.FORM)e[t.id]=r;else if(t.type===re.SUBTABLE){e[t.id]=r;const i={type:"array",fields:{}};(n===!0?[{children:t.props.headers}]:t.children).forEach((u,o)=>{Ze(u.children,a=>{if(i.fields){i.fields[o]||(i.fields[o]={type:"object",required:!0,fields:{}});let c=we.staticGetRules(a.type,a.props);i.fields[o].fields[a.id]=c}})}),e[t.id].push(i)}}function cu(e,t,n=!1){var i,u,o,a,c,l,f;if(mn(t))return;let r=we.staticGetRules(t.type,t.props);if(t.controlType===U.FORM)if(xe(t.props.dataBind))((i=t.props.dataBind)==null?void 0:i.fieldCode)!=""&&(e[(u=t.props.dataBind)==null?void 0:u.fieldCode]=r);else for(const s in t.props.dataBind)((o=t.props.dataBind[s])==null?void 0:o.fieldCode)!=""&&(e[(a=t.props.dataBind[s])==null?void 0:a.fieldCode]=((c=fu(r))==null?void 0:c[s])||[]);else if(t.type===re.SUBTABLE){e[(l=t.props.datasourceBind)==null?void 0:l.dataCode]=r;const s={type:"array",fields:{}};(n===!0?[{children:t.props.headers}]:t.children).forEach((d,h)=>{Ze(d.children,g=>{var D,A,p,v;if(s.fields){s.fields[h]||(s.fields[h]={type:"object",required:!0,fields:{}});let m=we.staticGetRules(g.type,g.props);if(xe(g.props.dataBind))((p=g.props.dataBind)==null?void 0:p.fieldCode)!=""&&(s.fields[h].fields[(v=g.props.dataBind)==null?void 0:v.fieldCode]=m);else for(const C in g.props.dataBind)((D=g.props.dataBind[C])==null?void 0:D.fieldCode)!=""&&(s.fields[h].fields[g.props.dataBind[C].fieldCode]=((A=fu(m))==null?void 0:A[C])||[])}})}),e[(f=t.props.datasourceBind)==null?void 0:f.dataCode].push(s)}}function fu(e){let t={};return e.map(n=>{n.fields&&(t=n)}),t==null?void 0:t.fields}function lu(e,t,n=!1){if(mn(t))return;let r=we.staticGetRules(t.type,t.props);t.controlType===U.FORM?e[t.id]=r:t.type===re.SUBTABLE&&t.children.length&&(e[t.id]=[],(n===!0?[{children:t.props.headers}]:t.children).forEach(i=>{let u={};Ze(i.children,o=>{let a=we.staticGetRules(o.type,o.props);u[o.id]=a}),e[t.id].push(u)}))}class Mc{constructor(t){const{state:n,emptyState:r,databindMapping:i,controlidMapping:u,defaultState:o,subtableHeadersControlIdMapping:a}=Nc(t.instance);this.emptyState=r,this.state=n,this.dataBindMapping=i,this.controlIdMapping=u,this.defaultState=o,this.subtableHeadersControlIdMapping=a}setState(t,n,r){const i=this.controlIdMapping[t],u=Q(n);i!==void 0?(i.children&&n.forEach(o=>{o.uid||Object.assign(o,{uid:"new:"+Zt("uid")})}),this.state[i.dataView][t]=u):r!==void 0?Object.keys(this.controlIdMapping).map(o=>{const a=this.controlIdMapping[o].dataView,c=this.controlIdMapping[o].children;c!==void 0&&Object.keys(c).map(l=>{l===t&&this.state[a][o][r]&&(this.state[a][o][r][t]=u)})}):this.state[t]=u}getState(t,n){var i;if(this.state[t]!==void 0)return this.state[t];{const u=this.controlIdMapping[t];if(u!==void 0){const o=this.state[u.dataView][t];return n!==void 0&&Object.keys((i=u==null?void 0:u.children)!=null?i:{}).length>0?o[n]:o}else if(n!==void 0){let o;return Object.keys(this.controlIdMapping).map(a=>{const c=this.controlIdMapping[a].dataView,l=this.controlIdMapping[a].children;l!==void 0&&Object.keys(l).map(f=>{var s;f===t&&(o=(s=this.state[c][a][n])==null?void 0:s[t])})}),o}else{let o=[];return Object.keys(this.controlIdMapping).map(a=>{const c=this.controlIdMapping[a].dataView,l=this.controlIdMapping[a].children;l!==void 0&&Object.keys(l).map(f=>{f===t&&this.state[c][a].map(s=>{o.push(s[t])})})}),o}}}getEmptyState(t){if(this.emptyState[t]!==void 0)return this.emptyState[t];{const r=this.controlIdMapping[t];if(r!==void 0){const i=this.emptyState[r.dataView][t];return"children"in r&&Object.assign(i,{uid:"new:"+Zt("uid")}),i}else{let i;return Object.keys(this.controlIdMapping).map(u=>{const o=this.controlIdMapping[u].dataView,a=this.controlIdMapping[u].children;a!==void 0&&Object.keys(a).map(c=>{c===t&&(i=this.emptyState[o][u][t])})}),i}}}getDataBind(t){let n=this.controlIdMapping[t];if(n)return n.dataBind;e:for(let r in this.controlIdMapping){const i=this.controlIdMapping[r];if(i.children){for(let u in i.children)if(u===t){n=i.children[u];break e}}}return n==null?void 0:n.dataBind}}function Nc(e){let t={},n={},r={},i={},u={},o={};return Dt(e,a=>{const c=a.id,l={},f={};gt([a],(s,d)=>{Ic(l,f,s),xc(r,c,s),Oc(i,c,s),Rc(u,s)}),t[c]={},o[c]=l,n[c]=f}),{state:t,defaultState:o,subtableHeadersControlIdMapping:u,emptyState:n,databindMapping:r,controlidMapping:i}}function Ic(e,t,n){var r,i;if(n.controlType===U.FORM)e[n.id]=Q(n.props.defaultValue),t[n.id]=Q(n.props.defaultValue);else{const u={};Ze(n.props.headers,o=>{u[o.id]=Q(o.props.defaultValue)}),e[n.id]=(i=new Array((r=n.props.defaultRows)!=null?r:1).fill(0).map(()=>oe({uid:"new:"+Zt("uid")},Q(u))))!=null?i:[],t[n.id]=u}}function xc(e,t,n){var r,i;if(n.controlType===U.FORM)xe(n.props.dataBind)?((i=(r=n.props)==null?void 0:r.dataBind)==null?void 0:i.dataCode)===void 0||(e[n.props.dataBind.dataCode]===void 0&&(e[n.props.dataBind.dataCode]={controlId:t,fields:[],dataViewId:t}),e[n.props.dataBind.dataCode].fields.push({fieldCode:n.props.dataBind.fieldCode,controlId:n.id,dataBind:n.props.dataBind,dataViewId:[t]})):Object.keys(n.props.dataBind).map(u=>{const o=n.props.dataBind,a=o[u].dataCode;a!==void 0&&(e[a]===void 0&&(e[a]={controlId:n.id,fields:[],dataViewId:t}),e[a].fields.push({fieldCode:o[u].fieldCode,controlId:n.id,dataBind:o,dataViewId:[t]}))});else{if(n.props.datasourceBind.dataCode===""){At(`datasourceBind.dataCode is empty! maybe in preview mode, control:${n.id} type:${n.type}`);return}e[n.props.datasourceBind.dataCode]={controlId:n.id,fields:[],dataViewId:t};const u=n.id;Ze(n.props.headers,o=>{xe(o.props.dataBind)?(e[o.props.dataBind.dataCode]===void 0&&(e[o.props.dataBind.dataCode]={controlId:t,fields:[],dataViewId:t}),e[o.props.dataBind.dataCode].fields.push({fieldCode:o.props.dataBind.fieldCode,controlId:o.id,dataBind:o.props.dataBind,dataViewId:[t,u]})):Object.keys(o.props.dataBind).map(a=>{const c=o.props.dataBind,l=c[a].dataCode;e[l].fields.push({fieldCode:c[a].fieldCode,controlId:o.id,dataBind:c,dataViewId:[t,u]})})})}}function Oc(e,t,n){n.controlType===U.FORM?e[n.id]={dataBind:n.props.dataBind,options:[],dataView:t}:n.type===re.SUBTABLE&&(e[n.id]={dataBind:new Qn({dataCode:n.props.datasourceBind.dataCode,fieldCode:""}),dataView:t,children:{},options:[]},Ze(n.props.headers,r=>{var i,u;Object.assign((u=(i=e[n.id])==null?void 0:i.children)!=null?u:{},{[r.id]:{dataBind:r.props.dataBind}})}))}function Rc(e,t){if(t.type===re.SUBTABLE){const n={};t.props.headers.map(r=>{r.children.map(i=>{Object.assign(n,{[i.id]:i})})}),Object.assign(e,{[t.id]:n})}}const du=["splice","push","shift","pop","unshift","reverse"],Ir=Symbol("__engineProxy__"),xr=Symbol("__engineTarget__"),hu=Symbol("__engineArrayBeforeSetCallbackFlag__"),pu=Symbol("__engineProxyThisKey__"),$e={type:"",args:[],callback:gu};function gu(){}Tc();function Pc(e,t,n,r,i){if($e.type){$e.callback=i.bind(null,e,r);return}const u=Number(t);if(u>e.length){We(`Wrong array operations may cause unknown errors. It is recommended to use APIs such as ${du.join(",")} for array operations`);return}if(!(Number.isNaN(u)&&t!=="length"))if(t==="length"){const a=n,c=e.length;if(a>e.length){We("Do not directly modify the length of the array data, please add new rows");return}return a===e.length?void 0:()=>i.call(null,e,r,"splice",[a,c-a])}else return u===e.length?()=>i.call(null,e,r,"push",[n]):()=>i.call(null,e,r,"splice",[u,1,n])}function jc(e,t,n){return{__engineProxy__:!0,get(r,i,u){return i===Ir?!0:i===xr?r:Array.isArray(r)&&i===hu?n:i===pu?e:Reflect.get(r,i,u)},set(r,i,u,o){var d;let a=Q(u);const c=r[i],l=e===""?i:e+"."+i;function f(h){if(typeof h=="object"&&h!==null)return h[Ir]!==!0?wn(h,t,n,l):wn(h[xr],t,n,l)}a=(d=f(a))!=null?d:a;let s;if(Array.isArray(r)){const h=Pc(r,i,a,e,t);s=Reflect.set(r,i,a,o),h&&h()}else{try{let h=a;if(a=n.call(null,r,l,a,c),h!==a){const g=f(a);g!==void 0&&(a=g)}}catch(h){return rn(`${l} set error ${h}`),!0}s=Reflect.set(r,i,a,o),t.call(null,r,l,a,c)}return s||!0}}}function wn(e,t,n,r=""){if(Object.isFrozen(e))return e;for(let i in e){const u=r===""?i:r+"."+i,o=e[i];typeof o=="object"&&o!==null&&(e[i]=wn(o,t,n,u))}return new Proxy(e,jc(r,t,n))}function Du(e){const t=[];return e.forEach(n=>{t.push(n),(n.controlType==="layout"||n.controlType==="wrap")&&t.push(...Du(n.children))}),t}function Or(e,t,n){if(t==="")return;const r=t.split(".");if(r.length===0)return;const i=r[0],u=r.slice(1),o=n[i]?n[i][0]:void 0;return u.length===0?o:u.reduce((a,c)=>{var s,d;const l=Number(c);if(Number.isNaN(l)&&a){const h=a!=null&&a.children?Du(a.children):void 0,g=h==null?void 0:h.find(D=>D.id===c);return g||(a.controlType===U.FORM?a:void 0)}else return(d=(s=a==null?void 0:a.children)==null?void 0:s[l])!=null?d:a},o)}function $c(e,t){return["push","unshift"].includes(e)?t:e==="splice"?t.slice(2):[]}function kc(e,t,n){if(["push","unshift"].includes(e))return n;if(e==="splice")return t.slice(0,2).concat(n)}function Tc(){du.forEach(e=>{const t=Array.prototype[e];Array.prototype[e]=function(...n){var r;if(this[Ir]){let i;const u=$c(e,n);if(u.length){const o=(r=this[hu])==null?void 0:r.call(this,this[xr],this[pu],u),a=kc(e,n,o);$e.type=e,$e.args=a,i=t.apply(this,a)}else $e.type=e,$e.args=n,i=t.apply(this,n);return typeof $e.callback=="function"&&$e.callback(e,n,i),$e.type="",$e.args=[],$e.callback=gu,i}else return t.apply(this,n)}})}class qc{constructor(){this.actionMap=new Map,this.buildinActions={},this.actionUtils={},this.sources={}}execAction(t,n,...r){return ze(this,null,function*(){const i=this.actionMap.get(t);if(!!i)try{return yield i.func.call(null,n,...r)}catch(u){return rn(`${i.id} Exception during calling action: ${u}`),!1}})}addAction(t,n){this.actionMap.has(t)&&We("duplicated action key");const r=new Uc(t,n);this.actionMap.set(t,r)}}class Uc{constructor(t,n){this.id="",this.id=t,this.func=n}}class Lc{constructor(t){this._dataStore=new Map,this.executer=t}add(t,n){this._dataStore.set(t,n)}get(t){let n=this._dataStore.get(t);return Q(n)}remove(t){this._dataStore.delete(t)}getRemoteData(t){return ze(this,null,function*(){return this.executer===void 0?(rn("\u672A\u521D\u59CB\u5316executer"),[]):this.executer(t)})}}class st{}class Xt extends st{validate(t){return be(t)}transform(t){if(t==null)return"";if(!je(t)&&!di(t))return String(t);if(Ko(t))return JSON.stringify(t);throw`${t} is not a string`}}class Rr extends st{validate(t){return un(t)||t===""}transform(t){if(t==null)return"";const n=!je(t)&&!di(t)?Number(t):void 0;if(!Number.isNaN(n)&&n!==void 0)return n;throw`${t} is not a number`}}class Hc extends st{validate(t){return Qo(t)}transform(t){if(t==null)return[];function n(r){return r.map(i=>i?String(i):"")}if(dt(t))return n(t);if(be(t)&&hi(t))try{const r=JSON.parse(t);if(Array.isArray(r))return n(r)}catch(r){}return[String(t)]}}class Vc extends st{validate(t){return Yo(t)}transform(t){if(t==null)return[];function n(i){return i.map(u=>!u&&u!==0?"":Number(u)).filter(u=>u===""||!Number.isNaN(u))}if(dt(t))return n(t);if(be(t)&&hi(t))try{const i=JSON.parse(t);if(dt(i))return n(i)}catch(i){}const r=Number(t);if(Number.isNaN(r))throw`${t} is not a number array`;return[r]}}class zc extends st{validate(t){return je(t)&&"amount"in t&&un(t.amount)&&"currency"in t&&be(t.currency)}transform(t,n){if(t==null||t==="")return new Yn({currency:n==null?void 0:n.currency});let r;if(je(t)&&(r=new Yn(oe(oe({},n),t))),be(t)&&on(t))try{const i=JSON.parse(t);r=new Yn(oe(oe({},n),i))}catch(i){}if(r){const i=new Rr,u=new Xt;return i.validate(r.amount)||(r.amount=i.transform(r.amount)),u.validate(r.currency)||(r.currency=u.transform(r.currency)),r}throw`${t} is not a { amount: number, currency: string } object`}}class Wc extends st{validate(t){return je(t)&&"min"in t&&be(t.min)&&"max"in t&&be(t.max)}transform(t,n){if(t==null||t==="")return new er;let r;if(je(t)&&(r=new er(oe(oe({},n),t))),be(t)&&on(t))try{const i=JSON.parse(t);r=new er(oe(oe({},n),i))}catch(i){}if(r){const i=new Xt;return i.validate(r.min)||(r.min=i.transform(r.min)),i.validate(r.max)||(r.max=i.transform(r.max)),r}throw`${t} is not a { min: string, max: string } object`}}class Zc extends st{validate(t){return je(t)&&"result"in t&&un(t.result)&&"unit"in t&&be(t.unit)}transform(t,n){if(t==null||t==="")return new nr({unit:n==null?void 0:n.unit});let r;if(je(t)&&(r=new nr(oe(oe({},n),t))),be(t)&&on(t))try{const i=JSON.parse(t);r=new nr(oe(oe({},n),i))}catch(i){}if(r){const i=new Rr,u=new Xt;return i.validate(r.result)||(r.result=i.transform(r.result)),u.validate(r.unit)||(r.unit=u.transform(r.unit)),r}throw`${t} is not a { result: string, unit: string } object`}}class Xc extends st{validate(t){return!!je(t)}transform(t,n){if(t==null||t==="")return new tr;let r;if(je(t)&&(r=new tr(oe(oe({},n),zn.exports.camelizeKeys(t)))),be(t)&&on(t))try{const i=JSON.parse(t);r=new tr(oe(oe({},n),zn.exports.camelizeKeys(i)))}catch(i){}if(r){const i=new Xt;return i.validate(r.city)||(r.city=i.transform(r.city)),i.validate(r.district)||(r.district=i.transform(r.district)),i.validate(r.province)||(r.province=i.transform(r.province)),r}throw`${t} is not a { city: string, district: string, province: string } object`}}class Jc{static getValueChecker(t){let n;switch(t){case se.VARCHAR:case se.TIMESTAMP:case se.TEXT:case se.AUTO_NUMBER:n=new Xt;break;case se.DECIMAL:n=new Rr;break;case se.EMPLOYEES:case se.DEPARTMENTS:case se.IMAGE:case se.FILE:case se.ARRAY:n=new Hc;break;case se.MONEY:n=new zc;break;case se.TIMESCOPE:n=new Wc;break;case se.CALC:n=new Zc;break;case se.DECIMAL_RANGE:n=new Vc;break;case se.ADDRESS:n=new Xc;break}return n}}function Gc(e){if(["min","max","currency","unit"].includes(e))return se.VARCHAR;if(["result","amount"].includes(e))return se.DECIMAL}function yu(e,t,n,r){var o;let i=(o=Gc(t))!=null?o:e,u=Jc.getValueChecker(i);if(!u||u.validate(n))return n;try{const a=u.transform(n,r);return a!==void 0?a:n}catch(a){throw`${t} ${a}`}}function Kc(e,t,n){return Object.entries(e).reduce((r,[i,u])=>{const o=t[i];return r[i]=yu(u,i,o,n[i]),r},Object.assign({},t))}typeof window!="undefined"&&(window.engines={});let _t=null,Jt="";class Pr extends yi{constructor(t){super(),this.rawStore={},this.isMounted=!1,this.id=tn(8),this.__pluginsApplied=!1,this.actionManager=new qc,this._jobTasks=[],this.createControlInstance=this.createInstance,this.$options=Object.freeze(t);const{autoMount:n=!0,schema:r,beforeCreateInstance:i,externalParams:u,language:o=kt,debug:a=!1,messagesI18n:c,children:l}=this.$options;this.debug=a,this.runtime=new we({schema:r,beforeCreateInstance:i}),this.externalParams=u,this.children=l,this.store=new Mc({instance:this.runtime.instance}),this.debugLog("engine is Instantiation complete"),n&&this.mount()}debugLog(...t){this.debug&&Ln(...t)}use(t){return this.__pluginsApplied||this.__plugins.push(t),this}registerControl(...t){return this.runtime.register(...t),this}static register(t){return we.register(t,"Runtime")}static judgeControlIsRegistered(t){return we.staticRegisteredTypes.has(t.Runtime.controlType)}mount(){this.debugLog("engine\u7684mount\u65B9\u6CD5\u5F00\u59CB\u8C03\u7528");const{plugins:t=[]}=this.$options;this._handlerProxyState(),this.__plugins=t,this.applyPlugins(),this.setStates(this.getState()),this.debugLog("engine\u7684mount\u65B9\u6CD5\u8C03\u7528\u7ED3\u675F"),this.debug&&typeof window!="undefined"&&(window.engines[this.id]=this)}destroy(){this.debug&&typeof window!="undefined"&&delete window.engines[this.id]}_handlerProxyState(){this.store.state=wn(this.store.state,this._proxyStateCallback.bind(this),this._proxyStateBeforeSetCallback.bind(this))}_proxyStateBeforeSetCallback(t,n,r,i){const u=Or(this.runtime.flatInstances,n,this.runtime.instanceMap);if(!u)return r;if(this.assertInstance(u,re.SUBTABLE)){if(r===null)return[];const c=u.props.headers.reduce((f,s)=>{const d=s.children[0];return d&&d.controlType===U.FORM&&(f[d.id]=d.fieldType),f},{}),l=this.getEmptyState(u.id);return r==null?void 0:r.map(f=>Kc(c,f,l))}const o=n.split("."),a=o[o.length-1];try{return yu(u.fieldType,a,r,i)}catch(c){throw At(`the id=${u.id}'s instance setState error, %o ${c}.`,r),c}}_proxyStateCallback(t,n,r,i,u){Array.isArray(t)?this._handlerArrayUpdate(t,n,r,i,u):this._handlerObjectUpdate(t,n,r,i)}_handlerArrayUpdate(t,n,r,i,u){const o=Or(this.runtime.flatInstances,n,this.runtime.instanceMap);if((o==null?void 0:o.controlType)!==U.LIST)return;const a=h=>{const g=[];for(let D=0;D<h;D++){const A=this.listControlCreateRow(o,"subtable-row");A&&g.push(A)}return g},c=_t;let l=[],f=[],s=[],d=!1;if(r&&i){switch(r){case"push":case"unshift":const g=i.length;l=a(g),f=i,o.children[r](...l);break;case"splice":if(i.length>2){const D=i.length-2,A=i.slice(2);l=a(D),f=A;const p=i[0],v=i[1];o.children[r](p,v,...l)}else{const D=i[0],A=i[1];D+A===o.children.length-1&&(d=!0),o.children[r](...i)}break;default:o.children[r](...i);break}r==="splice"?s=u:["pop","shift"].includes(r)&&(s=[u]);const h=this.getState(o.id);this._handlerSubtableUpdateUid(h),this.runtime.getFlatInstances(),this.emit("list-change",{instance:o,value:h,options:Object.assign({},c,{changed:l,data:f,deleted:s!=null?s:[],jsonValue:JSON.stringify(h),isDeleteLastOne:d,type:r,args:i})}),_t=null}}_handlerSubtableUpdateUid(t){t.forEach(n=>{n.uid||Object.assign(n,{uid:"new:"+Zt("uid")})})}_handlerObjectUpdate(t,n,r,i){const u=Or(this.runtime.flatInstances,n,this.runtime.instanceMap);if(!u)return;const o=this.getInstanceRowIndex(u),a=_t||{};if(u.controlType===U.LIST&&u.type===re.SUBTABLE){u.children.length=0;const c=r;let l=[];for(let s=0;s<c.length;s++){const d=this.listControlCreateRow(u,"subtable-row");d&&l.push(d)}u.children.push(...l);let f=i!=null?i:[];(a==null?void 0:a.setData)===!0?f=[]:this.runtime.getFlatInstances(),this._handlerSubtableUpdateUid(c),this.emit("list-change",{instance:u,value:r,options:Qr(oe({},a),{changed:l,data:c,deleted:f,type:"push",jsonValue:JSON.stringify(c)})})}else this.emit("change",{instance:u,value:this.getState(u.id,o),rowIndex:o,options:Qr(oe({},a),{oldValue:i})})}applyPlugins(){this.__pluginsApplied||(this.__plugins.forEach(t=>{var n;try{Jt=(n=t.pluginName)!=null?n:t.constructor.name,t.apply(this)}catch(r){We(`${Jt} Plugin apply Error
2
+ ${r}`)}finally{Jt=""}}),this.__pluginsApplied=!0)}listControlCreateRow(t,n){let r;if(n==="subtable-row"?r={children:[],controlType:U.LAYOUT,id:tn(),type:"subtable-row",props:{caption:"",isHide:!1,style:{height:"",heightConfig:"fill",width:"",widthConfig:"fill"}},fieldType:void 0,customEvents:[],pageStatus:0,rules:[],parent:void 0}:r=this.runtime.createControlInstance(n),!!r){if(r.controlType===U.LAYOUT){const i=r,u=Q(t.props.headers),o=this.createControl(u);for(let a of o)a.parent||this.runtime.resetInstanceParent(a,i);i.children.push(...o)}return r.parent=t,r}}listControlAddRow(t,n="subtable-row"){const r=this.listControlCreateRow(t,n);!r||t.children.push(r)}emit(t,n){return ze(this,null,function*(){if(t==="engine-mounted"){if(this.isMounted)return At("The engine-mounted life cycle can only be triggered once"),Promise.resolve([]);if(this._jobTasks.length){console.time("engine-mounted need wait");const o=[...this._jobTasks];yield Promise.all(o),console.timeEnd("engine-mounted need wait")}this.isMounted=!0}let r,i;this.isMounted||(i=new Promise(o=>{r=o}),this._jobTasks.push(i));const u=yield Po(Pr.prototype,this,"emit").call(this,t,n);return r&&i&&(r(),this._jobTasks.splice(this._jobTasks.indexOf(i),1)),u})}on(t,n){return Jt&&(n.applyingPluginName=Jt),super.on(t,n)}createControl(...t){return this.runtime.createControl(...t)}createInstance(t,n){return this.runtime.createControlInstance(t,n)}schemaEvent(t,n){this.emit(t,n)}updateInstanceProps(t,n,r,i){return this.setInstance(t,n,r,i)}getRule(t,n){return we.staticGetRules(t,n)}getAllRules(t){var r,i;const n=this.runtime.allRules;return t===void 0?n:{rules:(r=n.rules[t])==null?void 0:r.fields,antdRules:(i=n.antdRules[t])==null?void 0:i.fields}}getRules(t,n=!1){var a,c,l,f,s,d,h;const r=this.runtime.rules,i=this.runtime.fieldCodeRules,u=this.store.controlIdMapping,o=n?i:r;if(t===void 0)return n?i:o;{if(t=n?(a=u[t])!=null&&a.children?(c=u[t].dataBind)==null?void 0:c.dataCode:((l=u[t].dataBind)==null?void 0:l.fieldCode)||t:t,t in o)return(f=o[t])==null?void 0:f.fields;let g;for(const D in o)if(t in(((s=o[D])==null?void 0:s.fields)||{})){g=(h=(d=o[D])==null?void 0:d.fields)==null?void 0:h[t];break}return g}}getAntdRules(t){var n;return t===void 0?this.runtime.antdRules:(n=this.runtime.antdRules[t])==null?void 0:n.fields}getState(t,n){return t===void 0?this.store.state:this.store.getState(t,n)}getEmptyState(t){return Q(t===void 0?this.store.emptyState:this.store.getEmptyState(t))}setPayloadOptions(t){_t=t}setState(t,n,r,i){_t=i,this.debugLog("[%o]: \u89E6\u53D1setState, \u4FEE\u6539\u7684\u503C\u4E3A%o, rowIndex=%o, options=%o",t,n,r,i),this.store.setState(t,n,r),this.debugLog("[%o]: setState\u5B8C\u6210, \u4FEE\u6539\u7684\u503C\u4E3A%o, rowIndex=%o",t,n,r),_t=null}setStates(t,n,r){let i=t!=null?t:{};Object.keys(i).forEach(u=>{Object.entries(this.store.controlIdMapping).forEach(([o,a])=>{if(a.dataView===u){const c=i[u][o];c!==void 0&&this.setState(o,c,n,r)}else(o===u||a.children&&a.children[u])&&i[u]!==void 0&&this.setState(u,i[u],n,r)})})}getField(t,n,r){if(!n){const c=this.getDataBindMapping(t);if(c){const{controlId:l}=c;return this.getState(l)}return}const i=this.getDataBindMapping(t,n);if(!i)return;const{dataBind:u,controlId:o}=i,a=this.getState(o,r);return xe(u)?a:Object.entries(u).reduce((c,[l,f])=>f.fieldCode===n?c[l]:c,a)}getData(t){var i,u,o,a,c,l,f,s,d;if(!t)return;let n=this.getDataBindMapping(t),r=this.getControlIdMapping();if(n){const{controlId:h}=n,g=this.getField(t);if(Array.isArray(g))return g.map(A=>{var v,m,C,E,S,N;let p={};for(let $ in A){const z=(C=(m=(v=r[h])==null?void 0:v.children[$])==null?void 0:m.dataBind)==null?void 0:C.fieldCode;if(z!==""){if(z)p[z]=A[$];else if((E=r[h])!=null&&E.children[$])for(let V in A[$])p[(N=(S=r[h])==null?void 0:S.children[$])==null?void 0:N.dataBind[V].fieldCode]=A[$][V]}}return p});{let D={};for(let A in g)if((u=(i=r[A])==null?void 0:i.dataBind)!=null&&u.fieldCode)D[(o=r[A])==null?void 0:o.dataBind.fieldCode]=g[A];else if((c=(a=r[A])==null?void 0:a.dataBind)!=null&&c.dataCode)Array.isArray(g[A])&&(D[(l=r[A])==null?void 0:l.dataBind.dataCode]=(f=g[A])==null?void 0:f.map(p=>{var m,C;let v={};for(let E in p){const S=(m=r[A].children[E])==null?void 0:m.dataBind.fieldCode;if(S!=="")if(S)v[S]=p[E];else for(let N in p[E])v[(C=r[A].children[E])==null?void 0:C.dataBind[N].fieldCode]=p[E][N]}return v}));else if(r[A])for(let p in g[A])D[(d=(s=r[A])==null?void 0:s.dataBind[p])==null?void 0:d.fieldCode]=g[A][p];return D}}}setField(t,n,r,i,u){var l;const o=this.getDataBindMapping(t,n);if(!o)return;const{dataBind:a,controlId:c}=o;if(xe(a))this.setState(c,r,i,u);else{const f=(l=Q(this.getState(c,i)))!=null?l:this.getEmptyState(c),s=Object.entries(a).reduce((d,[h,g])=>(g.fieldCode===n&&(d[h]=r),d),f);this.setState(c,s,i,u)}}setFields(t,n,r,i){const u=this.getDataBindMapping(t);if(!u)return;let o=[];u.fields.forEach(a=>{var s;const{dataBind:c,controlId:l,fieldCode:f}=a;if(!o.includes(f)&&!!Object.hasOwnProperty.call(n,f))if(xe(c))this.setState(l,n[f],r,i);else{const d=(s=Q(this.getState(l,r)))!=null?s:this.getEmptyState(l),h=Object.entries(c).reduce((g,[D,A])=>{o.push(A.fieldCode);const p=n[A.fieldCode];return p!==void 0&&(g[D]=p),g},d);this.setState(a.controlId,h,r,i)}})}buildFields(t,n){const r=this.getDataBindMapping(t);if(!r||!r.fields)return;let i=[];const u={};return r.fields.forEach(o=>{const{dataBind:a,controlId:c,fieldCode:l}=o;if(!i.includes(l)&&!!Object.hasOwnProperty.call(n,l))if(xe(a))u[c]=n[l];else{const f=this.getEmptyState(c);u[o.controlId]=Object.entries(a).reduce((s,[d,h])=>{i.push(h.fieldCode);const g=n[h.fieldCode];return g!==void 0&&(s[d]=g),s},f)}}),u}setData(t,n){this.debugLog("engine setData\u65B9\u6CD5\u6267\u884C\uFF0C\u53C2\u6570\u4E3A%o\uFF0C%o\u3002",t,n);const r=n==null?void 0:n.onlySetData;let i=this.store.defaultState;r===!0&&(i={}),Object.keys(t).map(u=>{var a,c,l,f;const o=t[u];if(Array.isArray(o)){const s=this.getDataBindMapping(u);if(!s)return;i[s.dataViewId]||(i[s.dataViewId]={}),o.length?i[s.dataViewId][s.controlId]=[]:i[s.dataViewId][s.controlId]=(a=i[s.dataViewId][s.controlId])!=null?a:[];let d={},h={};o.map(g=>{let D=Q(this.store.emptyState[s.dataViewId][s.controlId]),A=[];Object.keys(g).map(p=>{var m,C,E;if(A.includes(p))return;h.hasOwnProperty(p)===!1&&(h[p]=(C=(m=this.store.dataBindMapping[u])==null?void 0:m.fields)==null?void 0:C.find(S=>S.fieldCode===p));const v=h[p];if(v){if(xe(v.dataBind)&&g[p]!==void 0)D[v.controlId]=g[p];else if(!xe(v.dataBind)){d.hasOwnProperty(v.controlId)===!1&&(d[v.controlId]=Q((E=this.getEmptyState(v.controlId))!=null?E:{}));let S=Q(d[v.controlId]);Object.keys(v.dataBind).map(N=>{const $=v.dataBind[N];g[$.fieldCode]!==void 0&&(S[N]=g[$.fieldCode]),A.push($.fieldCode)}),D[v.controlId]=S}}else p==="uid"&&g.uid!==void 0?D.uid=g.uid:p==="virtualStore"&&g.virtualStore!==void 0&&(D.virtualStore=Object.freeze(g.virtualStore))}),i[s.dataViewId][s.controlId].push(D)})}else if(o){let s=[];const d=Q(this.store.emptyState);(c=Object.keys(o))!=null&&c.length&&Object.keys(o).map(g=>{var A;if(s.includes(g))return;const D=this.getDataBindMapping(u,g);if(D){if(i[D.dataViewId[0]]||(i[D.dataViewId[0]]={}),xe(D.dataBind)&&o[g]!==void 0)i[D.dataViewId[0]][D.controlId]=o[g]!==void 0?o[g]:d[D.dataViewId[0]][D.controlId];else if(!xe(D.dataBind)){let p=(A=this.getEmptyState(D.controlId))!=null?A:{};Object.keys(D.dataBind).map(v=>{const m=D.dataBind[v];o[m.fieldCode]!==void 0&&(p[v]=o[m.fieldCode]),s.push(m.fieldCode)}),i[D.dataViewId[0]][D.controlId]=p}}});const h=this.getDataBindMapping(u);if(h){const g=(l=h==null?void 0:h.fields)==null?void 0:l.map(p=>p==null?void 0:p.controlId),D=this.getEmptyState(h==null?void 0:h.controlId),A=Object.keys((f=i==null?void 0:i[h==null?void 0:h.controlId])!=null?f:{});g==null||g.forEach(p=>{!A.includes(p)&&p!=="uid"&&i[h==null?void 0:h.controlId]&&(Object.keys(i).length?Object.assign(i[h==null?void 0:h.controlId],{[p]:D[p]}):Object.assign(i,{[h.controlId]:{[p]:D[p]}}))}),this.debugLog("engine setData\u65B9\u6CD5\u9ED8\u8BA4\u503C\u53CA\u8868\u5355\u6570\u636E\u7EC4\u5408\u5B8C\u6210\uFF0C\u53C2\u6570\u4E3A%o\u3002",i)}}}),this.debugLog("engine setData\u65B9\u6CD5\u6570\u636E\u7EC4\u5408\u5B8C\u6210\uFF0C\u53C2\u6570\u4E3A%o\u3002",i),this.setStates(i,void 0,oe({setData:!0},n)),this.runtime.getFlatInstances(),this.debugLog("engine setData\u65B9\u6CD5\u6267\u884C\u5B8C\u6210\u3002")}getDataBind(t){return this.store.getDataBind(t)}getInstance(t,n){const r=this.getInstances(t,n===-1);if(r.length>0)return n!==void 0?n===-1?r[0]:r[n]:r[0]}getInstances(t,n=!1){if(t===void 0)return this.runtime.flatInstances;const r=Array.from(this.runtime.instanceMap[t]||[]);if(n){const i=this.findSubtableHeadersControl(t);i!==void 0&&r.unshift(i)}return r}setInstance(t,n,r,i){try{if(typeof t=="string"&&i===-1)this.getInstances(t,i===-1).map(o=>{o&&(this.debugLog("[%o]: \u4FEE\u6539instance: %o\u7684%o\u5C5E\u6027\uFF0C\u4FEE\u6539\u7684\u503C\u4E3A%o\u3002",o.id,o,n,r),Vn(o.props,n,r),this.schemaEvent("schema-change",{instance:o,props:n,value:r,rowIndex:i}))});else{let u;if(typeof t=="string"?u=this.getInstance(t,i):u=t,!u)return;this.debugLog("[%o]: \u4FEE\u6539instance: %o\u7684%o\u5C5E\u6027\uFF0C\u4FEE\u6539\u7684\u503C\u4E3A%o\u3002",u.id,u,n,r),Vn(u.props,n,r),this.schemaEvent("schema-change",{instance:u,props:n,value:r,rowIndex:i})}}catch(u){throw u}}getControlIdMapping(){return this.store.controlIdMapping}getDataBindMapping(t,n){if(!t&&!n)return this.store.dataBindMapping;const r=this.store.dataBindMapping[t];if(!r)return;if(!n)return r;const i=r.fields.find(u=>u.fieldCode===n);if(!!i)return i}getAction(){return this.actionManager}initDataManager(t){this.dataManager=new Lc(t)}getDataManager(){return this.dataManager}assertInstance(t,n){return be(n)?t.type===n:n.includes(t.type)}assertInstanceIsCustomControl(t){return!es(be(t)?t:t.type)}getInstanceRowIndex(t){if(!t.parent)return;let n;if(this.assertInstance(t.parent,re.SUBTABLE_COLUMN)&&this.assertInstance(t.parent.parent,re.SUBTABLE))n=-1;else if(this.getInstanceParentControl(t,re.SUBTABLE_COLUMN)){const u=this.runtime.instanceMap[t.id];if(Object.prototype.toString.call(u)==="[object Array]"){const o=u.findIndex(a=>a===t);o>-1&&(n=o)}}return n}getInstanceParentControl(t,n){if(!!t.parent)return this.assertInstance(t.parent,n)?t.parent:this.getInstanceParentControl(t.parent,n)}getInstanceInSubtableHeader(t){const n=this.getInstanceRowIndex(t);if(n===void 0)return;if(n===-1)return t;const r=this.assertInstance(t,re.SUBTABLE_COLUMN)?t:this.getInstanceParentControl(t,re.SUBTABLE_COLUMN);if(!r)return;const u=this.getInstanceParentControl(t,re.SUBTABLE).props.headers.find(o=>o.id===r.id);if(!!u)return u.children.find(o=>o.id===t.id)}setControlConfig(...t){return this.runtime.registerControlConfig(...t)}getControlConfig(t){return this.runtime.getControlConfig(t)}inList(t){const n=this.store.subtableHeadersControlIdMapping;let r;for(const i in n)if(t in n[i]){r=i;break}return r}findSubtableHeadersControl(t){const n=this.store.subtableHeadersControlIdMapping;let r;for(const i in n)if(t in n[i]){r=n[i][t];break}return r}}class Qc{}class Yc{constructor(t,n,r){this.config=t,this.env=n,this.eventJs=r}apply(t){this.engine=t;const n=this.config;if(!n)return;const r=t.getAction();if(this.eventJs){this.eventJs.exportsFun({ctx:t,utils:r.actionUtils});for(let[i,u]of Object.entries(this.eventJs))r.addAction(i,u)}else{const i=vu(n,t,this.env);if(!i)return;for(let[u,o]of Object.entries(i.funcMap))r.addAction(u,o)}}}function vu(e,t,n){if(!e.module||!e.module.compiled)return;const r=e.module.compiled,i={exports:{ctx:t,utils:t.getAction().actionUtils,env:n}};try{new Function("module","exports",r).call(i,i,i.exports)}catch(a){We(a.message+". fail to parse the module"),process.env.NODE_ENV!=="production"&&We("fail to parse the module")}const u={},o={};for(const[a,c]of Object.entries(i.exports))typeof c=="function"?u[a]=c:o[a]=c;return{funcMap:u,variables:o}}const ef={"engine-initialized":"did_init","engine-mounted":"did_mount","engine-submit":"will_submit","engine-submit-params":"do_submit","engine-submitted":"did_submit"};class tf{constructor(t){this.config=t}apply(t){this.engine=t,Object.entries(ef).forEach(([n,r])=>{t.on(n,i=>ze(this,null,function*(){const u=yield this.callLifecycleEvent(r,i);return u.includes(!1)?!1:u}))})}callLifecycleEvent(t,n){return ze(this,null,function*(){const r=this.config;return!r||!Array.isArray(r[t])?[]:yield Promise.all(r[t].map(u=>ze(this,null,function*(){return yield this.engine.getAction().execAction(u,n)})))})}}class nf{constructor(t,n){this.config=t,this.customEvents=n}apply(t){this.engine=t,mi.events.forEach(n=>{n.code&&n.key&&this.engineAddEventListener(n.code,n.key)}),this.customEvents.map(n=>{let r=n.key;n.namespace!==void 0&&n.namespace!==null&&n.namespace!==""&&(r=n.namespace+":"+n.key),this.engineAddEventListener(r,r)})}engineAddEventListener(t,n){this.engine.on(t,r=>ze(this,null,function*(){if(!((t==="change"||t==="list-change")&&!this.engine.isMounted)&&r.instance!==void 0)return yield this.callControlEvent(n,r)}))}callControlEvent(t,n){return ze(this,null,function*(){const r=this.config[n.instance.id];if(!r||!Array.isArray(r[t]))return[];const i=yield Promise.all(r[t].map(u=>ze(this,null,function*(){return yield this.engine.getAction().execAction(u,n)})));return i.includes(!1)?!1:i})}}function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},An.apply(null,arguments)}var mu={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function ve(e){return typeof e=="number"}function Ke(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function wu(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function Au(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Cu(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Cn(e){return typeof e=="string"}var Oe=Array.isArray;function Bt(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function jr(e){return Array.isArray(e)||Bt(e)}function rf(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function uf(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function of(e){return e&&e.constructor.prototype.isRange===!0||!1}function bu(e){return e&&e.constructor.prototype.isIndex===!0||!1}function sf(e){return typeof e=="boolean"}function af(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function cf(e){return e&&e.constructor.prototype.isHelp===!0||!1}function ff(e){return typeof e=="function"}function lf(e){return e instanceof Date}function df(e){return e instanceof RegExp}function Eu(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!wu(e)&&!Au(e))}function hf(e){return e===null}function pf(e){return e===void 0}function gf(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Df(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function yf(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function vf(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function mf(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function wf(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function Af(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Cf(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function bf(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ef(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ff(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function _f(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Bf(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Sf(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function Mf(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Nf(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function If(e){return e&&e.constructor.prototype.isChain===!0||!1}function $r(e){var t=typeof e;return t==="object"?e===null?"null":Ke(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function yt(e){var t=typeof e;if(t==="number"||t==="string"||t==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(n){return yt(n)});if(e instanceof Date)return new Date(e.valueOf());if(Ke(e))return e;if(Eu(e))return xf(e,yt);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function xf(e,t){var n={};for(var r in e)bn(e,r)&&(n[r]=t(e[r]));return n}function Gt(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Gt(e[r],t[r]))return!1;return!0}else{if(typeof e=="function")return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Gt(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}else return e===t}}function bn(e,t){return e&&Object.hasOwnProperty.call(e,t)}function Of(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],u=e[i];u!==void 0&&(n[i]=u)}return n}var Rf=["Matrix","Array"],Pf=["number","BigNumber","Fraction"],Fu=function(t){if(t)throw new Error(`The global config is readonly.
3
3
  Please create a mathjs instance if you want to change the default configuration.
4
4
  Example:
5
5
 
6
6
  import { create, all } from 'mathjs';
7
7
  const mathjs = create(all);
8
8
  mathjs.config({ number: 'BigNumber' });
9
- `);return Object.freeze(bi)};Cn(Ni,bi,{MATRIX_OPTIONS:Uh,NUMBER_OPTIONS:Vh});function Oi(){return!0}function xe(){return!1}function St(){}const xi="Argument is not a typed-function.";function Ri(){function e(v){return typeof v=="object"&&v!==null&&v.constructor===Object}const t=[{name:"number",test:function(v){return typeof v=="number"}},{name:"string",test:function(v){return typeof v=="string"}},{name:"boolean",test:function(v){return typeof v=="boolean"}},{name:"Function",test:function(v){return typeof v=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(v){return v instanceof Date}},{name:"RegExp",test:function(v){return v instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(v){return v===null}},{name:"undefined",test:function(v){return v===void 0}}],n={name:"any",test:Oi,isAny:!0};let r,u,i=0,o={createCount:0};function s(v){const E=r.get(v);if(E)return E;let F='Unknown type "'+v+'"';const b=v.toLowerCase();let M;for(M of u)if(M.toLowerCase()===b){F+='. Did you mean "'+M+'" ?';break}throw new TypeError(F)}function c(v){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const F=E?s(E).index:u.length,b=[];for(let _=0;_<v.length;++_){if(!v[_]||typeof v[_].name!="string"||typeof v[_].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const R=v[_].name;if(r.has(R))throw new TypeError('Duplicate type name "'+R+'"');b.push(R),r.set(R,{name:R,test:v[_].test,isAny:v[_].isAny,index:F+_,conversionsTo:[]})}const M=u.slice(F);u=u.slice(0,F).concat(b).concat(M);for(let _=F+b.length;_<u.length;++_)r.get(u[_]).index=_}function f(){r=new Map,u=[],i=0,c([n],!1)}f(),c(t);function l(){let v;for(v of u)r.get(v).conversionsTo=[];i=0}function a(v){const E=u.filter(F=>{const b=r.get(F);return!b.isAny&&b.test(v)});return E.length?E:["any"]}function d(v){return v&&typeof v=="function"&&"_typedFunctionData"in v}function h(v,E,F){if(!d(v))throw new TypeError(xi);const b=F&&F.exact,M=Array.isArray(E)?E.join(","):E,_=C(M),R=A(_);if(!b||R in v.signatures){const Y=v._typedFunctionData.signatureMap.get(R);if(Y)return Y}const O=_.length;let $;if(b){$=[];let Y;for(Y in v.signatures)$.push(v._typedFunctionData.signatureMap.get(Y))}else $=v._typedFunctionData.signatures;for(let Y=0;Y<O;++Y){const te=_[Y],se=[];let Be;for(Be of $){const Ee=j(Be.params,Y);if(!(!Ee||te.restParam&&!Ee.restParam)){if(!Ee.hasAny){const ke=m(Ee);if(te.types.some(qe=>!ke.has(qe.name)))continue}se.push(Be)}}if($=se,$.length===0)break}let N;for(N of $)if(N.params.length<=O)return N;throw new TypeError("Signature not found (signature: "+(v.name||"unnamed")+"("+A(_,", ")+"))")}function D(v,E,F){return h(v,E,F).implementation}function g(v,E){const F=s(E);if(F.test(v))return v;const b=F.conversionsTo;if(b.length===0)throw new Error("There are no conversions to "+E+" defined.");for(let M=0;M<b.length;M++)if(s(b[M].from).test(v))return b[M].convert(v);throw new Error("Cannot convert "+v+" to "+E)}function A(v){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return v.map(F=>F.name).join(E)}function p(v){const E=v.indexOf("...")===0,b=(E?v.length>3?v.slice(3):"any":v).split("|").map(O=>s(O.trim()));let M=!1,_=E?"...":"";return{types:b.map(function(O){return M=O.isAny||M,_+=O.name+"|",{name:O.name,typeIndex:O.index,test:O.test,isAny:O.isAny,conversion:null,conversionIndex:-1}}),name:_.slice(0,-1),hasAny:M,hasConversion:!1,restParam:E}}function y(v){const E=v.types.map(R=>R.name),F=KD(E);let b=v.hasAny,M=v.name;const _=F.map(function(R){const O=s(R.from);return b=O.isAny||b,M+="|"+R.from,{name:R.from,typeIndex:O.index,test:O.test,isAny:O.isAny,conversion:R,conversionIndex:R.index}});return{types:v.types.concat(_),name:M,hasAny:b,hasConversion:_.length>0,restParam:v.restParam}}function m(v){return v.typeSet||(v.typeSet=new Set,v.types.forEach(E=>v.typeSet.add(E.name))),v.typeSet}function C(v){const E=[];if(typeof v!="string")throw new TypeError("Signatures must be strings");const F=v.trim();if(F==="")return E;const b=F.split(",");for(let M=0;M<b.length;++M){const _=p(b[M].trim());if(_.restParam&&M!==b.length-1)throw new SyntaxError('Unexpected rest parameter "'+b[M]+'": only allowed for the last parameter');if(_.types.length===0)return null;E.push(_)}return E}function w(v){const E=$t(v);return E?E.restParam:!1}function S(v){if(!v||v.types.length===0)return Oi;if(v.types.length===1)return s(v.types[0].name).test;if(v.types.length===2){const E=s(v.types[0].name).test,F=s(v.types[1].name).test;return function(M){return E(M)||F(M)}}else{const E=v.types.map(function(F){return s(F.name).test});return function(b){for(let M=0;M<E.length;M++)if(E[M](b))return!0;return!1}}}function I(v){let E,F,b;if(w(v)){E=Oo(v).map(S);const M=E.length,_=S($t(v)),R=function(O){for(let $=M;$<O.length;$++)if(!_(O[$]))return!1;return!0};return function($){for(let N=0;N<E.length;N++)if(!E[N]($[N]))return!1;return R($)&&$.length>=M+1}}else return v.length===0?function(_){return _.length===0}:v.length===1?(F=S(v[0]),function(_){return F(_[0])&&_.length===1}):v.length===2?(F=S(v[0]),b=S(v[1]),function(_){return F(_[0])&&b(_[1])&&_.length===2}):(E=v.map(S),function(_){for(let R=0;R<E.length;R++)if(!E[R](_[R]))return!1;return _.length===E.length})}function j(v,E){return E<v.length?v[E]:w(v)?$t(v):null}function H(v,E){const F=j(v,E);return F?m(F):new Set}function z(v){return v.conversion===null||v.conversion===void 0}function x(v,E){const F=new Set;return v.forEach(b=>{const M=H(b.params,E);let _;for(_ of M)F.add(_)}),F.has("any")?["any"]:Array.from(F)}function P(v,E,F){let b,M;const _=v||"unnamed";let R=F,O;for(O=0;O<E.length;O++){const te=[];if(R.forEach(se=>{const Be=j(se.params,O),Ee=S(Be);(O<se.params.length||w(se.params))&&Ee(E[O])&&te.push(se)}),te.length===0){if(M=x(R,O),M.length>0){const se=a(E[O]);return b=new TypeError("Unexpected type of argument in function "+_+" (expected: "+M.join(" or ")+", actual: "+se.join(" | ")+", index: "+O+")"),b.data={category:"wrongType",fn:_,index:O,actual:se,expected:M},b}}else R=te}const $=R.map(function(te){return w(te.params)?1/0:te.params.length});if(E.length<Math.min.apply(null,$))return M=x(R,O),b=new TypeError("Too few arguments in function "+_+" (expected: "+M.join(" or ")+", index: "+E.length+")"),b.data={category:"tooFewArgs",fn:_,index:E.length,expected:M},b;const N=Math.max.apply(null,$);if(E.length>N)return b=new TypeError("Too many arguments in function "+_+" (expected: "+N+", actual: "+E.length+")"),b.data={category:"tooManyArgs",fn:_,index:E.length,expectedLength:N},b;const Y=[];for(let te=0;te<E.length;++te)Y.push(a(E[te]).join("|"));return b=new TypeError('Arguments of type "'+Y.join(", ")+'" do not match any of the defined signatures of function '+_+"."),b.data={category:"mismatch",actual:Y},b}function G(v){let E=u.length+1;for(let F=0;F<v.types.length;F++)z(v.types[F])&&(E=Math.min(E,v.types[F].typeIndex));return E}function Z(v){let E=i+1;for(let F=0;F<v.types.length;F++)z(v.types[F])||(E=Math.min(E,v.types[F].conversionIndex));return E}function Q(v,E){if(v.hasAny){if(!E.hasAny)return 1}else if(E.hasAny)return-1;if(v.restParam){if(!E.restParam)return 1}else if(E.restParam)return-1;if(v.hasConversion){if(!E.hasConversion)return 1}else if(E.hasConversion)return-1;const F=G(v)-G(E);if(F<0)return-1;if(F>0)return 1;const b=Z(v)-Z(E);return b<0?-1:b>0?1:0}function q(v,E){const F=v.params,b=E.params,M=$t(F),_=$t(b),R=w(F),O=w(b);if(R&&M.hasAny){if(!O||!_.hasAny)return 1}else if(O&&_.hasAny)return-1;let $=0,N=0,Y;for(Y of F)Y.hasAny&&++$,Y.hasConversion&&++N;let te=0,se=0;for(Y of b)Y.hasAny&&++te,Y.hasConversion&&++se;if($!==te)return $-te;if(R&&M.hasConversion){if(!O||!_.hasConversion)return 1}else if(O&&_.hasConversion)return-1;if(N!==se)return N-se;if(R){if(!O)return 1}else if(O)return-1;const Be=(F.length-b.length)*(R?-1:1);if(Be!==0)return Be;const Ee=[];let ke=0;for(let Pt=0;Pt<F.length;++Pt){const Pn=Q(F[Pt],b[Pt]);Ee.push(Pn),ke+=Pn}if(ke!==0)return ke;let qe;for(qe of Ee)if(qe!==0)return qe;return 0}function KD(v){if(v.length===0)return[];const E=v.map(s);v.length>1&&E.sort((M,_)=>M.index-_.index);let F=E[0].conversionsTo;if(v.length===1)return F;F=F.concat([]);const b=new Set(v);for(let M=1;M<E.length;++M){let _;for(_ of E[M].conversionsTo)b.has(_.from)||(F.push(_),b.add(_.from))}return F}function QD(v,E){let F=E;if(v.some(M=>M.hasConversion)){const M=w(v),_=v.map(YD);F=function(){const O=[],$=M?arguments.length-1:arguments.length;for(let N=0;N<$;N++)O[N]=_[N](arguments[N]);return M&&(O[$]=arguments[$].map(_[$])),E.apply(this,O)}}let b=F;if(w(v)){const M=v.length-1;b=function(){return F.apply(this,eu(arguments,0,M).concat([eu(arguments,M)]))}}return b}function YD(v){let E,F,b,M;const _=[],R=[];switch(v.types.forEach(function(O){O.conversion&&(_.push(s(O.conversion.from).test),R.push(O.conversion.convert))}),R.length){case 0:return function($){return $};case 1:return E=_[0],b=R[0],function($){return E($)?b($):$};case 2:return E=_[0],F=_[1],b=R[0],M=R[1],function($){return E($)?b($):F($)?M($):$};default:return function($){for(let N=0;N<R.length;N++)if(_[N]($))return R[N]($);return $}}}function e1(v){function E(F,b,M){if(b<F.length){const _=F[b];let R=[];if(_.restParam){const O=_.types.filter(z);O.length<_.types.length&&R.push({types:O,name:"..."+O.map($=>$.name).join("|"),hasAny:O.some($=>$.isAny),hasConversion:!1,restParam:!0}),R.push(_)}else R=_.types.map(function(O){return{types:[O],name:O.name,hasAny:O.isAny,hasConversion:O.conversion,restParam:!1}});return s1(R,function(O){return E(F,b+1,M.concat([O]))})}else return[M]}return E(v,0,[])}function t1(v,E){const F=Math.max(v.length,E.length);for(let O=0;O<F;O++){const $=H(v,O),N=H(E,O);let Y=!1,te;for(te of N)if($.has(te)){Y=!0;break}if(!Y)return!1}const b=v.length,M=E.length,_=w(v),R=w(E);return _?R?b===M:M>=b:R?b>=M:b===M}function n1(v){return v.map(E=>Po(E)?Ro(E.referToSelf.callback):$o(E)?xo(E.referTo.references,E.referTo.callback):E)}function r1(v,E,F){const b=[];let M;for(M of v){let _=F[M];if(typeof _!="number")throw new TypeError('No definition for referenced signature "'+M+'"');if(_=E[_],typeof _!="function")return!1;b.push(_)}return b}function u1(v,E,F){const b=n1(v),M=new Array(b.length).fill(!1);let _=!0;for(;_;){_=!1;let R=!0;for(let O=0;O<b.length;++O){if(M[O])continue;const $=b[O];if(Po($))b[O]=$.referToSelf.callback(F),b[O].referToSelf=$.referToSelf,M[O]=!0,R=!1;else if($o($)){const N=r1($.referTo.references,b,E);N?(b[O]=$.referTo.callback.apply(this,N),b[O].referTo=$.referTo,M[O]=!0,R=!1):_=!0}}if(R&&_)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return b}function i1(v){const E=/\bthis(\(|\.signatures\b)/;Object.keys(v).forEach(F=>{const b=v[F];if(E.test(b.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function o1(v,E){if(o.createCount++,Object.keys(E).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&i1(E);const F=[],b=[],M={},_=[];let R;for(R in E){if(!Object.prototype.hasOwnProperty.call(E,R))continue;const X=C(R);if(!X)continue;F.forEach(function(en){if(t1(en,X))throw new TypeError('Conflicting signatures "'+A(en)+'" and "'+A(X)+'".')}),F.push(X);const _e=b.length;b.push(E[R]);const q1=X.map(y);let Tn;for(Tn of e1(q1)){const en=A(Tn);_.push({params:Tn,name:en,fn:_e}),Tn.every(U1=>!U1.hasConversion)&&(M[en]=_e)}}_.sort(q);const O=u1(b,M,Yt);let $;for($ in M)Object.prototype.hasOwnProperty.call(M,$)&&(M[$]=O[M[$]]);const N=[],Y=new Map;for($ of _)Y.has($.name)||($.fn=O[$.fn],N.push($),Y.set($.name,$));const te=N[0]&&N[0].params.length<=2&&!w(N[0].params),se=N[1]&&N[1].params.length<=2&&!w(N[1].params),Be=N[2]&&N[2].params.length<=2&&!w(N[2].params),Ee=N[3]&&N[3].params.length<=2&&!w(N[3].params),ke=N[4]&&N[4].params.length<=2&&!w(N[4].params),qe=N[5]&&N[5].params.length<=2&&!w(N[5].params),Pt=te&&se&&Be&&Ee&&ke&&qe;for(let X=0;X<N.length;++X)N[X].test=I(N[X].params);const Pn=te?S(N[0].params[0]):xe,h1=se?S(N[1].params[0]):xe,p1=Be?S(N[2].params[0]):xe,D1=Ee?S(N[3].params[0]):xe,g1=ke?S(N[4].params[0]):xe,v1=qe?S(N[5].params[0]):xe,y1=te?S(N[0].params[1]):xe,m1=se?S(N[1].params[1]):xe,E1=Be?S(N[2].params[1]):xe,A1=Ee?S(N[3].params[1]):xe,C1=ke?S(N[4].params[1]):xe,F1=qe?S(N[5].params[1]):xe;for(let X=0;X<N.length;++X)N[X].implementation=QD(N[X].params,N[X].fn);const w1=te?N[0].implementation:St,b1=se?N[1].implementation:St,B1=Be?N[2].implementation:St,_1=Ee?N[3].implementation:St,S1=ke?N[4].implementation:St,M1=qe?N[5].implementation:St,I1=te?N[0].params.length:-1,N1=se?N[1].params.length:-1,O1=Be?N[2].params.length:-1,x1=Ee?N[3].params.length:-1,R1=ke?N[4].params.length:-1,$1=qe?N[5].params.length:-1,P1=Pt?6:0,T1=N.length,j1=N.map(X=>X.test),L1=N.map(X=>X.implementation),k1=function(){for(let _e=P1;_e<T1;_e++)if(j1[_e](arguments))return L1[_e].apply(this,arguments);return o.onMismatch(v,arguments,N)};function Yt(X,_e){return arguments.length===I1&&Pn(X)&&y1(_e)?w1.apply(this,arguments):arguments.length===N1&&h1(X)&&m1(_e)?b1.apply(this,arguments):arguments.length===O1&&p1(X)&&E1(_e)?B1.apply(this,arguments):arguments.length===x1&&D1(X)&&A1(_e)?_1.apply(this,arguments):arguments.length===R1&&g1(X)&&C1(_e)?S1.apply(this,arguments):arguments.length===$1&&v1(X)&&F1(_e)?M1.apply(this,arguments):k1.apply(this,arguments)}try{Object.defineProperty(Yt,"name",{value:v})}catch(X){}return Yt.signatures=M,Yt._typedFunctionData={signatures:N,signatureMap:Y},Yt}function No(v,E,F){throw P(v,E,F)}function Oo(v){return eu(v,0,v.length-1)}function $t(v){return v[v.length-1]}function eu(v,E,F){return Array.prototype.slice.call(v,E,F)}function a1(v,E){for(let F=0;F<v.length;F++)if(E(v[F]))return v[F]}function s1(v,E){return Array.prototype.concat.apply([],v.map(E))}function c1(){const v=Oo(arguments).map(F=>A(C(F))),E=$t(arguments);if(typeof E!="function")throw new TypeError("Callback function expected as last argument");return xo(v,E)}function xo(v,E){return{referTo:{references:v,callback:E}}}function Ro(v){if(typeof v!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:v}}}function $o(v){return v&&typeof v.referTo=="object"&&Array.isArray(v.referTo.references)&&typeof v.referTo.callback=="function"}function Po(v){return v&&typeof v.referToSelf=="object"&&typeof v.referToSelf.callback=="function"}function To(v,E){if(!v)return E;if(E&&E!==v){const F=new Error("Function names do not match (expected: "+v+", actual: "+E+")");throw F.data={actual:E,expected:v},F}return v}function l1(v){let E;for(const F in v)Object.prototype.hasOwnProperty.call(v,F)&&(d(v[F])||typeof v[F].signature=="string")&&(E=To(E,v[F].name));return E}function f1(v,E){let F;for(F in E)if(Object.prototype.hasOwnProperty.call(E,F)){if(F in v&&E[F]!==v[F]){const b=new Error('Signature "'+F+'" is defined twice');throw b.data={signature:F,sourceFunction:E[F],destFunction:v[F]},b}v[F]=E[F]}}const d1=o;o=function(v){const E=typeof v=="string",F=E?1:0;let b=E?v:"";const M={};for(let _=F;_<arguments.length;++_){const R=arguments[_];let O={},$;if(typeof R=="function"?($=R.name,typeof R.signature=="string"?O[R.signature]=R:d(R)&&(O=R.signatures)):e(R)&&(O=R,E||($=l1(R))),Object.keys(O).length===0){const N=new TypeError("Argument to 'typed' at index "+_+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw N.data={index:_,argument:R},N}E||(b=To(b,$)),f1(M,O)}return o1(b||"",M)},o.create=Ri,o.createCount=d1.createCount,o.onMismatch=No,o.throwMismatchError=No,o.createError=P,o.clear=f,o.clearConversions=l,o.addTypes=c,o._findType=s,o.referTo=c1,o.referToSelf=Ro,o.convert=g,o.findSignature=h,o.find=D,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(v,E){let F="any";E!==!1&&r.has("Object")&&(F="Object"),o.addTypes([v],F)};function jo(v){if(!v||typeof v.from!="string"||typeof v.to!="string"||typeof v.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(v.to===v.from)throw new SyntaxError('Illegal to define conversion from "'+v.from+'" to itself.')}return o.addConversion=function(v){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};jo(v);const F=s(v.to),b=F.conversionsTo.find(M=>M.from===v.from);if(b)if(E&&E.override)o.removeConversion({from:b.from,to:v.to,convert:b.convert});else throw new Error('There is already a conversion from "'+v.from+'" to "'+F.name+'"');F.conversionsTo.push({from:v.from,convert:v.convert,index:i++})},o.addConversions=function(v,E){v.forEach(F=>o.addConversion(F,E))},o.removeConversion=function(v){jo(v);const E=s(v.to),F=a1(E.conversionsTo,M=>M.from===v.from);if(!F)throw new Error("Attempt to remove nonexistent conversion from "+v.from+" to "+v.to);if(F.convert!==v.convert)throw new Error("Conversion to remove does not match existing conversion");const b=E.conversionsTo.indexOf(F);E.conversionsTo.splice(b,1)},o.resolve=function(v,E){if(!d(v))throw new TypeError(xi);const F=v._typedFunctionData.signatures;for(let b=0;b<F.length;++b)if(F[b].test(E))return F[b];return null},o}var $i=Ri();function Ve(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function qr(e,t,n){var r={2:"0b",8:"0o",16:"0x"},u=r[t],i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!Ve(n))throw new Error("size must be an integer");if(e>jn(2,n-1)-1||e<-jn(2,n-1))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!Ve(e))throw new Error("Value must be an integer");e<0&&(e=e+jn(2,n)),i="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(u).concat(e.toString(t)).concat(i)}function Ur(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n="auto",r,u;if(t&&(t.notation&&(n=t.notation),ve(t)?r=t:ve(t.precision)&&(r=t.precision),t.wordSize&&(u=t.wordSize,typeof u!="number")))throw new Error('Option "wordSize" must be a number');switch(n){case"fixed":return zh(e,r);case"exponential":return Pi(e,r);case"engineering":return Hh(e,r);case"bin":return qr(e,2,u);case"oct":return qr(e,8,u);case"hex":return qr(e,16,u);case"auto":return Wh(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],o=arguments[4];return i!=="."?i+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function bn(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],u=parseFloat(t[4]||"0"),i=r.indexOf(".");u+=i!==-1?i-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(s){return u-=s.length,""}).replace(/0*$/,"").split("").map(function(s){return parseInt(s)});return o.length===0&&(o.push(0),u++),{sign:n,coefficients:o,exponent:u}}function Hh(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=bn(e),r=Bn(n,t),u=r.exponent,i=r.coefficients,o=u%3===0?u:u<0?u-3-u%3:u-u%3;if(ve(t))for(;t>i.length||u-o+1>i.length;)i.push(0);else for(var s=Math.abs(u-o)-(i.length-1),c=0;c<s;c++)i.push(0);for(var f=Math.abs(u-o),l=1;f>0;)l++,f--;var a=i.slice(l).join(""),d=ve(t)&&a.length||a.match(/[1-9]/)?"."+a:"",h=i.slice(0,l).join("")+d+"e"+(u>=0?"+":"")+o.toString();return r.sign+h}function zh(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=bn(e),r=typeof t=="number"?Bn(n,n.exponent+1+t):n,u=r.coefficients,i=r.exponent+1,o=i+(t||0);return u.length<o&&(u=u.concat(Mt(o-u.length))),i<0&&(u=Mt(-i+1).concat(u),i=1),i<u.length&&u.splice(i,0,i===0?"0.":"."),r.sign+u.join("")}function Pi(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=bn(e),r=t?Bn(n,t):n,u=r.coefficients,i=r.exponent;u.length<t&&(u=u.concat(Mt(t-u.length)));var o=u.shift();return r.sign+o+(u.length>0?"."+u.join(""):"")+"e"+(i>=0?"+":"")+i}function Wh(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,u=n&&n.upperExp!==void 0?n.upperExp:5,i=bn(e),o=t?Bn(i,t):i;if(o.exponent<r||o.exponent>=u)return Pi(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(Mt(t-s.length))),s=s.concat(Mt(c-s.length+1+(s.length<t?t-s.length:0))),s=Mt(-c).concat(s);var f=c>0?c:0;return f<s.length-1&&s.splice(f+1,0,"."),o.sign+s.join("")}function Bn(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var u=r.splice(t,r.length-t);if(u[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}}return n}function Mt(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Zh(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var Jh=Number.EPSILON||2220446049250313e-31;function Gh(e,t,n){if(n==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var r=Math.abs(e-t);return r<Jh?!0:r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function Vr(e,t,n){var r=e.constructor,u=new r(2),i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!Ve(n))throw new Error("size must be an integer");if(e.greaterThan(u.pow(n-1).sub(1))||e.lessThan(u.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(u.pow(n))),i="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function Xh(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto",r,u;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t=="number"?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(u=t.wordSize,typeof u!="number")))throw new Error('Option "wordSize" must be a number');switch(n){case"fixed":return Qh(e,r);case"exponential":return Ti(e,r);case"engineering":return Kh(e,r);case"bin":return Vr(e,2,u);case"oct":return Vr(e,8,u);case"hex":return Vr(e,16,u);case"auto":{var i=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return"0";var s,c=e.toSignificantDigits(r),f=c.e;return f>=i&&f<o?s=c.toFixed():s=Ti(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var l=arguments[2],a=arguments[4];return l!=="."?l+a:a})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Kh(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,u=e.mul(Math.pow(10,-r)),i=u.toPrecision(t);if(i.indexOf("e")!==-1){var o=e.constructor;i=new o(i).toFixed()}return i+"e"+(n>=0?"+":"")+r.toString()}function Ti(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Qh(e,t){return e.toFixed(t)}function yt(e,t){var n=Yh(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function Yh(e,t){if(typeof e=="number")return Ur(e,t);if(Qe(e))return Xh(e,t);if(ep(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return ki(e,t);if(Fn(e))return ji(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>ji(r)+": "+yt(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function ji(e){for(var t=String(e),n="",r=0;r<t.length;){var u=t.charAt(r);n+=u in Li?Li[u]:u,r++}return'"'+n+'"'}var Li={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function ki(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,u=0;u<r;u++)u!==0&&(n+=", "),n+=ki(e[u],t);return n+="]",n}else return yt(e,t)}function ep(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function de(e,t,n){if(!(this instanceof de))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}de.prototype=new RangeError,de.prototype.constructor=RangeError,de.prototype.name="DimensionError",de.prototype.isDimensionError=!0;function It(e,t,n){if(!(this instanceof It))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}It.prototype=new RangeError,It.prototype.constructor=RangeError,It.prototype.name="IndexError",It.prototype.isIndexError=!0;function mt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function qi(e,t,n){var r,u=e.length;if(u!==t[n])throw new de(u,t[n]);if(n<t.length-1){var i=n+1;for(r=0;r<u;r++){var o=e[r];if(!Array.isArray(o))throw new de(t.length-1,t.length,"<");qi(e[r],t,i)}}else for(r=0;r<u;r++)if(Array.isArray(e[r]))throw new de(t.length+1,t.length,">")}function Ui(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new de(e.length,0)}else qi(e,t,0)}function Re(e,t){if(e!==void 0){if(!ve(e)||!Ve(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new It(e,t)}}function Vi(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(u){if(!ve(u)||!Ve(u)||u<0)throw new TypeError("Invalid size, must contain positive integers (size: "+yt(t)+")")}),(ve(e)||Qe(e))&&(e=[e]);var r=n!==void 0?n:0;return Hr(e,t,0,r),e}function Hr(e,t,n,r){var u,i,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var f=n+1;for(u=0;u<c;u++)i=e[u],Array.isArray(i)||(i=[i],e[u]=i),Hr(i,t,f,r);for(u=c;u<s;u++)i=[],e[u]=i,Hr(i,t,f,r)}else{for(u=0;u<c;u++)for(;Array.isArray(e[u]);)e[u]=e[u][0];for(u=c;u<s;u++)e[u]=r}}function Hi(e,t){var n=rp(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new de(0,r,"!=");t=zi(t,r);var u=Wi(t);if(r!==u)throw new de(u,r,"!=");try{return tp(n,t)}catch(i){throw i instanceof de?new de(u,r,"!="):i}}function zi(e,t){var n=Wi(e),r=e.slice(),u=-1,i=e.indexOf(u),o=e.indexOf(u,i+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var s=i>=0,c=t%n===0;if(s)if(c)r[i]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function Wi(e){return e.reduce((t,n)=>t*n,1)}function tp(e,t){for(var n=e,r,u=t.length-1;u>0;u--){var i=t[u];r=[];for(var o=n.length/i,s=0;s<o;s++)r.push(n.slice(s*i,(s+1)*i));n=r}return n}function np(e,t,n,r){var u=r||mt(e);if(n)for(var i=0;i<n;i++)e=[e],u.unshift(1);for(e=Zi(e,t,0);u.length<t;)u.push(1);return e}function Zi(e,t,n){var r,u;if(Array.isArray(e)){var i=n+1;for(r=0,u=e.length;r<u;r++)e[r]=Zi(e[r],t,i)}else for(var o=n;o<t;o++)e=[e];return e}function rp(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function n(r){Array.isArray(r)?r.forEach(n):t.push(r)}),t}function zr(e,t){for(var n,r=0,u=0;u<e.length;u++){var i=e[u],o=Array.isArray(i);if(u===0&&o&&(r=i.length),o&&i.length!==r)return;var s=o?zr(i,t):t(i);if(n===void 0)n=s;else if(n!==s)return"mixed"}return n}function Ji(e,t,n,r){if(r<n){if(e.length!==t.length)throw new de(e.length,t.length);for(var u=[],i=0;i<e.length;i++)u[i]=Ji(e[i],t[i],n,r+1);return u}else return e.concat(t)}function up(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return Ji(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function ip(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),u=Math.max(...r),i=new Array(u).fill(null),o=0;o<t.length;o++)for(var s=t[o],c=r[o],f=0;f<c;f++){var l=u-c+f;s[f]>i[l]&&(i[l]=s[f])}for(var a=0;a<t.length;a++)Gi(t[a],i);return i}function Gi(e,t){for(var n=t.length,r=e.length,u=0;u<r;u++){var i=n-r+u;if(e[u]<t[i]&&e[u]>1||e[u]>t[i])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[u]," to size ").concat(t[i]))}}function Xi(e,t){var n=mt(e);if(Xt(n,t))return e;Gi(n,t);var r=ip(n,t),u=r.length,i=[...Array(u-n.length).fill(1),...n],o=ap(e);n.length<u&&(o=Hi(o,i),n=mt(o));for(var s=0;s<u;s++)n[s]<r[s]&&(o=op(o,r[s],s),n=mt(o));return o}function op(e,t,n){return up(...Array(t).fill(e),n)}function ap(e){return Cn([],e)}function we(e,t,n,r){function u(i){var o=qh(i,t.map(lp));return sp(e,t,i),n(o)}return u.isFactory=!0,u.fn=e,u.dependencies=t.slice().sort(),r&&(u.meta=r),u}function sp(e,t,n){var r=t.filter(i=>!cp(i)).every(i=>n[i]!==void 0);if(!r){var u=t.filter(i=>n[i]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(u.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function cp(e){return e&&e[0]==="?"}function lp(e){return e&&e[0]==="?"?e.slice(1):e}function fp(e,t){if(Qi(e)&&Ki(e,t))return e[t];throw typeof e[t]=="function"&&pp(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function dp(e,t,n){if(Qi(e)&&Ki(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function hp(e,t){return t in e}function Ki(e,t){return!e||typeof e!="object"?!1:wn(Dp,t)?!0:!(t in Object.prototype||t in Function.prototype)}function pp(e,t){return e==null||typeof e[t]!="function"||wn(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:wn(gp,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Qi(e){return typeof e=="object"&&e&&e.constructor===Object}var Dp={length:!0,name:!0},gp={toString:!0,valueOf:!0,toLocaleString:!0};class vp{constructor(t){this.wrappedObject=t}keys(){return Object.keys(this.wrappedObject)}get(t){return fp(this.wrappedObject,t)}set(t,n){return dp(this.wrappedObject,t,n),this}has(t){return hp(this.wrappedObject,t)}}function yp(e){return e?e instanceof Map||e instanceof vp||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Yi=function(){return Yi=$i.create,$i},mp=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Ep=we("typed",mp,function(t){var{BigNumber:n,Complex:r,DenseMatrix:u,Fraction:i}=t,o=Yi();return o.clear(),o.addTypes([{name:"number",test:ve},{name:"Complex",test:Bi},{name:"BigNumber",test:Qe},{name:"Fraction",test:_i},{name:"Unit",test:Si},{name:"identifier",test:s=>Fn&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(s)},{name:"string",test:Fn},{name:"Chain",test:Lh},{name:"Array",test:Oe},{name:"Matrix",test:_t},{name:"DenseMatrix",test:dh},{name:"SparseMatrix",test:hh},{name:"Range",test:ph},{name:"Index",test:Mi},{name:"boolean",test:Dh},{name:"ResultSet",test:gh},{name:"Help",test:vh},{name:"function",test:yh},{name:"Date",test:mh},{name:"RegExp",test:Eh},{name:"null",test:Ah},{name:"undefined",test:Ch},{name:"AccessorNode",test:Fh},{name:"ArrayNode",test:wh},{name:"AssignmentNode",test:bh},{name:"BlockNode",test:Bh},{name:"ConditionalNode",test:_h},{name:"ConstantNode",test:Sh},{name:"FunctionNode",test:Ih},{name:"FunctionAssignmentNode",test:Mh},{name:"IndexNode",test:Nh},{name:"Node",test:Oh},{name:"ObjectNode",test:xh},{name:"OperatorNode",test:Rh},{name:"ParenthesisNode",test:$h},{name:"RangeNode",test:Ph},{name:"RelationalNode",test:Th},{name:"SymbolNode",test:jh},{name:"Map",test:yp},{name:"Object",test:Ii}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(c){if(n||Wr(c),Zh(c)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+c+"). Use function bignumber(x) to convert to BigNumber.");return new n(c)}},{from:"number",to:"Complex",convert:function(c){return r||_n(c),new r(c,0)}},{from:"BigNumber",to:"Complex",convert:function(c){return r||_n(c),new r(c.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(c){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(c){return r||_n(c),new r(c.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(c){i||Zr(c);var f=new i(c);if(f.valueOf()!==c)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+c+"). Use function fraction(x) to convert to Fraction.");return f}},{from:"string",to:"number",convert:function(c){var f=Number(c);if(isNaN(f))throw new Error('Cannot convert "'+c+'" to a number');return f}},{from:"string",to:"BigNumber",convert:function(c){n||Wr(c);try{return new n(c)}catch(f){throw new Error('Cannot convert "'+c+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(c){i||Zr(c);try{return new i(c)}catch(f){throw new Error('Cannot convert "'+c+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(c){r||_n(c);try{return new r(c)}catch(f){throw new Error('Cannot convert "'+c+'" to Complex')}}},{from:"boolean",to:"number",convert:function(c){return+c}},{from:"boolean",to:"BigNumber",convert:function(c){return n||Wr(c),new n(+c)}},{from:"boolean",to:"Fraction",convert:function(c){return i||Zr(c),new i(+c)}},{from:"boolean",to:"string",convert:function(c){return String(c)}},{from:"Array",to:"Matrix",convert:function(c){return u||Ap(),new u(c)}},{from:"Matrix",to:"Array",convert:function(c){return c.valueOf()}}]),o.onMismatch=(s,c,f)=>{var l=o.createError(s,c,f);if(["wrongType","mismatch"].includes(l.data.category)&&c.length===1&&Lr(c[0])&&f.some(d=>!d.params.includes(","))){var a=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw a.data=l.data,a}throw l},o.onMismatch=(s,c,f)=>{var l=o.createError(s,c,f);if(["wrongType","mismatch"].includes(l.data.category)&&c.length===1&&Lr(c[0])&&f.some(d=>!d.params.includes(","))){var a=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw a.data=l.data,a}throw l},o});function Wr(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function _n(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Ap(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Zr(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
9
+ `);return Object.freeze(mu)};An(Fu,mu,{MATRIX_OPTIONS:Rf,NUMBER_OPTIONS:Pf});function _u(){return!0}function Re(){return!1}function St(){}const Bu="Argument is not a typed-function.";function Su(){function e(y){return typeof y=="object"&&y!==null&&y.constructor===Object}const t=[{name:"number",test:function(y){return typeof y=="number"}},{name:"string",test:function(y){return typeof y=="string"}},{name:"boolean",test:function(y){return typeof y=="boolean"}},{name:"Function",test:function(y){return typeof y=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(y){return y instanceof Date}},{name:"RegExp",test:function(y){return y instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(y){return y===null}},{name:"undefined",test:function(y){return y===void 0}}],n={name:"any",test:_u,isAny:!0};let r,i,u=0,o={createCount:0};function a(y){const w=r.get(y);if(w)return w;let b='Unknown type "'+y+'"';const F=y.toLowerCase();let M;for(M of i)if(M.toLowerCase()===F){b+='. Did you mean "'+M+'" ?';break}throw new TypeError(b)}function c(y){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const b=w?a(w).index:i.length,F=[];for(let B=0;B<y.length;++B){if(!y[B]||typeof y[B].name!="string"||typeof y[B].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");const R=y[B].name;if(r.has(R))throw new TypeError('Duplicate type name "'+R+'"');F.push(R),r.set(R,{name:R,test:y[B].test,isAny:y[B].isAny,index:b+B,conversionsTo:[]})}const M=i.slice(b);i=i.slice(0,b).concat(F).concat(M);for(let B=b+F.length;B<i.length;++B)r.get(i[B]).index=B}function l(){r=new Map,i=[],u=0,c([n],!1)}l(),c(t);function f(){let y;for(y of i)r.get(y).conversionsTo=[];u=0}function s(y){const w=i.filter(b=>{const F=r.get(b);return!F.isAny&&F.test(y)});return w.length?w:["any"]}function d(y){return y&&typeof y=="function"&&"_typedFunctionData"in y}function h(y,w,b){if(!d(y))throw new TypeError(Bu);const F=b&&b.exact,M=Array.isArray(w)?w.join(","):w,B=C(M),R=A(B);if(!F||R in y.signatures){const ee=y._typedFunctionData.signatureMap.get(R);if(ee)return ee}const x=B.length;let P;if(F){P=[];let ee;for(ee in y.signatures)P.push(y._typedFunctionData.signatureMap.get(ee))}else P=y._typedFunctionData.signatures;for(let ee=0;ee<x;++ee){const ne=B[ee],ce=[];let Se;for(Se of P){const Ae=$(Se.params,ee);if(!(!Ae||ne.restParam&&!Ae.restParam)){if(!Ae.hasAny){const qe=m(Ae);if(ne.types.some(Ue=>!qe.has(Ue.name)))continue}ce.push(Se)}}if(P=ce,P.length===0)break}let I;for(I of P)if(I.params.length<=x)return I;throw new TypeError("Signature not found (signature: "+(y.name||"unnamed")+"("+A(B,", ")+"))")}function g(y,w,b){return h(y,w,b).implementation}function D(y,w){const b=a(w);if(b.test(y))return y;const F=b.conversionsTo;if(F.length===0)throw new Error("There are no conversions to "+w+" defined.");for(let M=0;M<F.length;M++)if(a(F[M].from).test(y))return F[M].convert(y);throw new Error("Cannot convert "+y+" to "+w)}function A(y){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return y.map(b=>b.name).join(w)}function p(y){const w=y.indexOf("...")===0,F=(w?y.length>3?y.slice(3):"any":y).split("|").map(x=>a(x.trim()));let M=!1,B=w?"...":"";return{types:F.map(function(x){return M=x.isAny||M,B+=x.name+"|",{name:x.name,typeIndex:x.index,test:x.test,isAny:x.isAny,conversion:null,conversionIndex:-1}}),name:B.slice(0,-1),hasAny:M,hasConversion:!1,restParam:w}}function v(y){const w=y.types.map(R=>R.name),b=H0(w);let F=y.hasAny,M=y.name;const B=b.map(function(R){const x=a(R.from);return F=x.isAny||F,M+="|"+R.from,{name:R.from,typeIndex:x.index,test:x.test,isAny:x.isAny,conversion:R,conversionIndex:R.index}});return{types:y.types.concat(B),name:M,hasAny:F,hasConversion:B.length>0,restParam:y.restParam}}function m(y){return y.typeSet||(y.typeSet=new Set,y.types.forEach(w=>y.typeSet.add(w.name))),y.typeSet}function C(y){const w=[];if(typeof y!="string")throw new TypeError("Signatures must be strings");const b=y.trim();if(b==="")return w;const F=b.split(",");for(let M=0;M<F.length;++M){const B=p(F[M].trim());if(B.restParam&&M!==F.length-1)throw new SyntaxError('Unexpected rest parameter "'+F[M]+'": only allowed for the last parameter');if(B.types.length===0)return null;w.push(B)}return w}function E(y){const w=Pt(y);return w?w.restParam:!1}function S(y){if(!y||y.types.length===0)return _u;if(y.types.length===1)return a(y.types[0].name).test;if(y.types.length===2){const w=a(y.types[0].name).test,b=a(y.types[1].name).test;return function(M){return w(M)||b(M)}}else{const w=y.types.map(function(b){return a(b.name).test});return function(F){for(let M=0;M<w.length;M++)if(w[M](F))return!0;return!1}}}function N(y){let w,b,F;if(E(y)){w=_o(y).map(S);const M=w.length,B=S(Pt(y)),R=function(x){for(let P=M;P<x.length;P++)if(!B(x[P]))return!1;return!0};return function(P){for(let I=0;I<w.length;I++)if(!w[I](P[I]))return!1;return R(P)&&P.length>=M+1}}else return y.length===0?function(B){return B.length===0}:y.length===1?(b=S(y[0]),function(B){return b(B[0])&&B.length===1}):y.length===2?(b=S(y[0]),F=S(y[1]),function(B){return b(B[0])&&F(B[1])&&B.length===2}):(w=y.map(S),function(B){for(let R=0;R<w.length;R++)if(!w[R](B[R]))return!1;return B.length===w.length})}function $(y,w){return w<y.length?y[w]:E(y)?Pt(y):null}function z(y,w){const b=$(y,w);return b?m(b):new Set}function V(y){return y.conversion===null||y.conversion===void 0}function O(y,w){const b=new Set;return y.forEach(F=>{const M=z(F.params,w);let B;for(B of M)b.add(B)}),b.has("any")?["any"]:Array.from(b)}function j(y,w,b){let F,M;const B=y||"unnamed";let R=b,x;for(x=0;x<w.length;x++){const ne=[];if(R.forEach(ce=>{const Se=$(ce.params,x),Ae=S(Se);(x<ce.params.length||E(ce.params))&&Ae(w[x])&&ne.push(ce)}),ne.length===0){if(M=O(R,x),M.length>0){const ce=s(w[x]);return F=new TypeError("Unexpected type of argument in function "+B+" (expected: "+M.join(" or ")+", actual: "+ce.join(" | ")+", index: "+x+")"),F.data={category:"wrongType",fn:B,index:x,actual:ce,expected:M},F}}else R=ne}const P=R.map(function(ne){return E(ne.params)?1/0:ne.params.length});if(w.length<Math.min.apply(null,P))return M=O(R,x),F=new TypeError("Too few arguments in function "+B+" (expected: "+M.join(" or ")+", index: "+w.length+")"),F.data={category:"tooFewArgs",fn:B,index:w.length,expected:M},F;const I=Math.max.apply(null,P);if(w.length>I)return F=new TypeError("Too many arguments in function "+B+" (expected: "+I+", actual: "+w.length+")"),F.data={category:"tooManyArgs",fn:B,index:w.length,expectedLength:I},F;const ee=[];for(let ne=0;ne<w.length;++ne)ee.push(s(w[ne]).join("|"));return F=new TypeError('Arguments of type "'+ee.join(", ")+'" do not match any of the defined signatures of function '+B+"."),F.data={category:"mismatch",actual:ee},F}function G(y){let w=i.length+1;for(let b=0;b<y.types.length;b++)V(y.types[b])&&(w=Math.min(w,y.types[b].typeIndex));return w}function X(y){let w=u+1;for(let b=0;b<y.types.length;b++)V(y.types[b])||(w=Math.min(w,y.types[b].conversionIndex));return w}function Y(y,w){if(y.hasAny){if(!w.hasAny)return 1}else if(w.hasAny)return-1;if(y.restParam){if(!w.restParam)return 1}else if(w.restParam)return-1;if(y.hasConversion){if(!w.hasConversion)return 1}else if(w.hasConversion)return-1;const b=G(y)-G(w);if(b<0)return-1;if(b>0)return 1;const F=X(y)-X(w);return F<0?-1:F>0?1:0}function L(y,w){const b=y.params,F=w.params,M=Pt(b),B=Pt(F),R=E(b),x=E(F);if(R&&M.hasAny){if(!x||!B.hasAny)return 1}else if(x&&B.hasAny)return-1;let P=0,I=0,ee;for(ee of b)ee.hasAny&&++P,ee.hasConversion&&++I;let ne=0,ce=0;for(ee of F)ee.hasAny&&++ne,ee.hasConversion&&++ce;if(P!==ne)return P-ne;if(R&&M.hasConversion){if(!x||!B.hasConversion)return 1}else if(x&&B.hasConversion)return-1;if(I!==ce)return I-ce;if(R){if(!x)return 1}else if(x)return-1;const Se=(b.length-F.length)*(R?-1:1);if(Se!==0)return Se;const Ae=[];let qe=0;for(let jt=0;jt<b.length;++jt){const Pn=Y(b[jt],F[jt]);Ae.push(Pn),qe+=Pn}if(qe!==0)return qe;let Ue;for(Ue of Ae)if(Ue!==0)return Ue;return 0}function H0(y){if(y.length===0)return[];const w=y.map(a);y.length>1&&w.sort((M,B)=>M.index-B.index);let b=w[0].conversionsTo;if(y.length===1)return b;b=b.concat([]);const F=new Set(y);for(let M=1;M<w.length;++M){let B;for(B of w[M].conversionsTo)F.has(B.from)||(b.push(B),F.add(B.from))}return b}function V0(y,w){let b=w;if(y.some(M=>M.hasConversion)){const M=E(y),B=y.map(z0);b=function(){const x=[],P=M?arguments.length-1:arguments.length;for(let I=0;I<P;I++)x[I]=B[I](arguments[I]);return M&&(x[P]=arguments[P].map(B[P])),w.apply(this,x)}}let F=b;if(E(y)){const M=y.length-1;F=function(){return b.apply(this,Kr(arguments,0,M).concat([Kr(arguments,M)]))}}return F}function z0(y){let w,b,F,M;const B=[],R=[];switch(y.types.forEach(function(x){x.conversion&&(B.push(a(x.conversion.from).test),R.push(x.conversion.convert))}),R.length){case 0:return function(P){return P};case 1:return w=B[0],F=R[0],function(P){return w(P)?F(P):P};case 2:return w=B[0],b=B[1],F=R[0],M=R[1],function(P){return w(P)?F(P):b(P)?M(P):P};default:return function(P){for(let I=0;I<R.length;I++)if(B[I](P))return R[I](P);return P}}}function W0(y){function w(b,F,M){if(F<b.length){const B=b[F];let R=[];if(B.restParam){const x=B.types.filter(V);x.length<B.types.length&&R.push({types:x,name:"..."+x.map(P=>P.name).join("|"),hasAny:x.some(P=>P.isAny),hasConversion:!1,restParam:!0}),R.push(B)}else R=B.types.map(function(x){return{types:[x],name:x.name,hasAny:x.isAny,hasConversion:x.conversion,restParam:!1}});return ed(R,function(x){return w(b,F+1,M.concat([x]))})}else return[M]}return w(y,0,[])}function Z0(y,w){const b=Math.max(y.length,w.length);for(let x=0;x<b;x++){const P=z(y,x),I=z(w,x);let ee=!1,ne;for(ne of I)if(P.has(ne)){ee=!0;break}if(!ee)return!1}const F=y.length,M=w.length,B=E(y),R=E(w);return B?R?F===M:M>=F:R?F>=M:F===M}function X0(y){return y.map(w=>No(w)?So(w.referToSelf.callback):Mo(w)?Bo(w.referTo.references,w.referTo.callback):w)}function J0(y,w,b){const F=[];let M;for(M of y){let B=b[M];if(typeof B!="number")throw new TypeError('No definition for referenced signature "'+M+'"');if(B=w[B],typeof B!="function")return!1;F.push(B)}return F}function G0(y,w,b){const F=X0(y),M=new Array(F.length).fill(!1);let B=!0;for(;B;){B=!1;let R=!0;for(let x=0;x<F.length;++x){if(M[x])continue;const P=F[x];if(No(P))F[x]=P.referToSelf.callback(b),F[x].referToSelf=P.referToSelf,M[x]=!0,R=!1;else if(Mo(P)){const I=J0(P.referTo.references,F,w);I?(F[x]=P.referTo.callback.apply(this,I),F[x].referTo=P.referTo,M[x]=!0,R=!1):B=!0}}if(R&&B)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return F}function K0(y){const w=/\bthis(\(|\.signatures\b)/;Object.keys(y).forEach(b=>{const F=y[b];if(w.test(F.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Q0(y,w){if(o.createCount++,Object.keys(w).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&K0(w);const b=[],F=[],M={},B=[];let R;for(R in w){if(!Object.prototype.hasOwnProperty.call(w,R))continue;const K=C(R);if(!K)continue;b.forEach(function(en){if(Z0(en,K))throw new TypeError('Conflicting signatures "'+A(en)+'" and "'+A(K)+'".')}),b.push(K);const Me=F.length;F.push(w[R]);const Od=K.map(v);let jn;for(jn of W0(Od)){const en=A(jn);B.push({params:jn,name:en,fn:Me}),jn.every(Rd=>!Rd.hasConversion)&&(M[en]=Me)}}B.sort(L);const x=G0(F,M,Yt);let P;for(P in M)Object.prototype.hasOwnProperty.call(M,P)&&(M[P]=x[M[P]]);const I=[],ee=new Map;for(P of B)ee.has(P.name)||(P.fn=x[P.fn],I.push(P),ee.set(P.name,P));const ne=I[0]&&I[0].params.length<=2&&!E(I[0].params),ce=I[1]&&I[1].params.length<=2&&!E(I[1].params),Se=I[2]&&I[2].params.length<=2&&!E(I[2].params),Ae=I[3]&&I[3].params.length<=2&&!E(I[3].params),qe=I[4]&&I[4].params.length<=2&&!E(I[4].params),Ue=I[5]&&I[5].params.length<=2&&!E(I[5].params),jt=ne&&ce&&Se&&Ae&&qe&&Ue;for(let K=0;K<I.length;++K)I[K].test=N(I[K].params);const Pn=ne?S(I[0].params[0]):Re,ud=ce?S(I[1].params[0]):Re,od=Se?S(I[2].params[0]):Re,sd=Ae?S(I[3].params[0]):Re,ad=qe?S(I[4].params[0]):Re,cd=Ue?S(I[5].params[0]):Re,fd=ne?S(I[0].params[1]):Re,ld=ce?S(I[1].params[1]):Re,dd=Se?S(I[2].params[1]):Re,hd=Ae?S(I[3].params[1]):Re,pd=qe?S(I[4].params[1]):Re,gd=Ue?S(I[5].params[1]):Re;for(let K=0;K<I.length;++K)I[K].implementation=V0(I[K].params,I[K].fn);const Dd=ne?I[0].implementation:St,yd=ce?I[1].implementation:St,vd=Se?I[2].implementation:St,md=Ae?I[3].implementation:St,wd=qe?I[4].implementation:St,Ad=Ue?I[5].implementation:St,Cd=ne?I[0].params.length:-1,bd=ce?I[1].params.length:-1,Ed=Se?I[2].params.length:-1,Fd=Ae?I[3].params.length:-1,_d=qe?I[4].params.length:-1,Bd=Ue?I[5].params.length:-1,Sd=jt?6:0,Md=I.length,Nd=I.map(K=>K.test),Id=I.map(K=>K.implementation),xd=function(){for(let Me=Sd;Me<Md;Me++)if(Nd[Me](arguments))return Id[Me].apply(this,arguments);return o.onMismatch(y,arguments,I)};function Yt(K,Me){return arguments.length===Cd&&Pn(K)&&fd(Me)?Dd.apply(this,arguments):arguments.length===bd&&ud(K)&&ld(Me)?yd.apply(this,arguments):arguments.length===Ed&&od(K)&&dd(Me)?vd.apply(this,arguments):arguments.length===Fd&&sd(K)&&hd(Me)?md.apply(this,arguments):arguments.length===_d&&ad(K)&&pd(Me)?wd.apply(this,arguments):arguments.length===Bd&&cd(K)&&gd(Me)?Ad.apply(this,arguments):xd.apply(this,arguments)}try{Object.defineProperty(Yt,"name",{value:y})}catch(K){}return Yt.signatures=M,Yt._typedFunctionData={signatures:I,signatureMap:ee},Yt}function Fo(y,w,b){throw j(y,w,b)}function _o(y){return Kr(y,0,y.length-1)}function Pt(y){return y[y.length-1]}function Kr(y,w,b){return Array.prototype.slice.call(y,w,b)}function Y0(y,w){for(let b=0;b<y.length;b++)if(w(y[b]))return y[b]}function ed(y,w){return Array.prototype.concat.apply([],y.map(w))}function td(){const y=_o(arguments).map(b=>A(C(b))),w=Pt(arguments);if(typeof w!="function")throw new TypeError("Callback function expected as last argument");return Bo(y,w)}function Bo(y,w){return{referTo:{references:y,callback:w}}}function So(y){if(typeof y!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:y}}}function Mo(y){return y&&typeof y.referTo=="object"&&Array.isArray(y.referTo.references)&&typeof y.referTo.callback=="function"}function No(y){return y&&typeof y.referToSelf=="object"&&typeof y.referToSelf.callback=="function"}function Io(y,w){if(!y)return w;if(w&&w!==y){const b=new Error("Function names do not match (expected: "+y+", actual: "+w+")");throw b.data={actual:w,expected:y},b}return y}function nd(y){let w;for(const b in y)Object.prototype.hasOwnProperty.call(y,b)&&(d(y[b])||typeof y[b].signature=="string")&&(w=Io(w,y[b].name));return w}function rd(y,w){let b;for(b in w)if(Object.prototype.hasOwnProperty.call(w,b)){if(b in y&&w[b]!==y[b]){const F=new Error('Signature "'+b+'" is defined twice');throw F.data={signature:b,sourceFunction:w[b],destFunction:y[b]},F}y[b]=w[b]}}const id=o;o=function(y){const w=typeof y=="string",b=w?1:0;let F=w?y:"";const M={};for(let B=b;B<arguments.length;++B){const R=arguments[B];let x={},P;if(typeof R=="function"?(P=R.name,typeof R.signature=="string"?x[R.signature]=R:d(R)&&(x=R.signatures)):e(R)&&(x=R,w||(P=nd(R))),Object.keys(x).length===0){const I=new TypeError("Argument to 'typed' at index "+B+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw I.data={index:B,argument:R},I}w||(F=Io(F,P)),rd(M,x)}return Q0(F||"",M)},o.create=Su,o.createCount=id.createCount,o.onMismatch=Fo,o.throwMismatchError=Fo,o.createError=j,o.clear=l,o.clearConversions=f,o.addTypes=c,o._findType=a,o.referTo=td,o.referToSelf=So,o.convert=D,o.findSignature=h,o.find=g,o.isTypedFunction=d,o.warnAgainstDeprecatedThis=!0,o.addType=function(y,w){let b="any";w!==!1&&r.has("Object")&&(b="Object"),o.addTypes([y],b)};function xo(y){if(!y||typeof y.from!="string"||typeof y.to!="string"||typeof y.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(y.to===y.from)throw new SyntaxError('Illegal to define conversion from "'+y.from+'" to itself.')}return o.addConversion=function(y){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};xo(y);const b=a(y.to),F=b.conversionsTo.find(M=>M.from===y.from);if(F)if(w&&w.override)o.removeConversion({from:F.from,to:y.to,convert:F.convert});else throw new Error('There is already a conversion from "'+y.from+'" to "'+b.name+'"');b.conversionsTo.push({from:y.from,convert:y.convert,index:u++})},o.addConversions=function(y,w){y.forEach(b=>o.addConversion(b,w))},o.removeConversion=function(y){xo(y);const w=a(y.to),b=Y0(w.conversionsTo,M=>M.from===y.from);if(!b)throw new Error("Attempt to remove nonexistent conversion from "+y.from+" to "+y.to);if(b.convert!==y.convert)throw new Error("Conversion to remove does not match existing conversion");const F=w.conversionsTo.indexOf(b);w.conversionsTo.splice(F,1)},o.resolve=function(y,w){if(!d(y))throw new TypeError(Bu);const b=y._typedFunctionData.signatures;for(let F=0;F<b.length;++F)if(b[F].test(w))return b[F];return null},o}var Mu=Su();function He(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function kr(e,t,n){var r={2:"0b",8:"0o",16:"0x"},i=r[t],u="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!He(n))throw new Error("size must be an integer");if(e>$n(2,n-1)-1||e<-$n(2,n-1))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!He(e))throw new Error("Value must be an integer");e<0&&(e=e+$n(2,n)),u="i".concat(n)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(i).concat(e.toString(t)).concat(u)}function Tr(e,t){if(typeof t=="function")return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var n="auto",r,i;if(t&&(t.notation&&(n=t.notation),ve(t)?r=t:ve(t.precision)&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!="number")))throw new Error('Option "wordSize" must be a number');switch(n){case"fixed":return $f(e,r);case"exponential":return Nu(e,r);case"engineering":return jf(e,r);case"bin":return kr(e,2,i);case"oct":return kr(e,8,i);case"hex":return kr(e,16,i);case"auto":return kf(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var u=arguments[2],o=arguments[4];return u!=="."?u+o:o});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function En(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),u=r.indexOf(".");i+=u!==-1?u-1:r.length-1;var o=r.replace(".","").replace(/^0*/,function(a){return i-=a.length,""}).replace(/0*$/,"").split("").map(function(a){return parseInt(a)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function jf(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=En(e),r=Fn(n,t),i=r.exponent,u=r.coefficients,o=i%3===0?i:i<0?i-3-i%3:i-i%3;if(ve(t))for(;t>u.length||i-o+1>u.length;)u.push(0);else for(var a=Math.abs(i-o)-(u.length-1),c=0;c<a;c++)u.push(0);for(var l=Math.abs(i-o),f=1;l>0;)f++,l--;var s=u.slice(f).join(""),d=ve(t)&&s.length||s.match(/[1-9]/)?"."+s:"",h=u.slice(0,f).join("")+d+"e"+(i>=0?"+":"")+o.toString();return r.sign+h}function $f(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=En(e),r=typeof t=="number"?Fn(n,n.exponent+1+t):n,i=r.coefficients,u=r.exponent+1,o=u+(t||0);return i.length<o&&(i=i.concat(Mt(o-i.length))),u<0&&(i=Mt(-u+1).concat(i),u=1),u<i.length&&i.splice(u,0,u===0?"0.":"."),r.sign+i.join("")}function Nu(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=En(e),r=t?Fn(n,t):n,i=r.coefficients,u=r.exponent;i.length<t&&(i=i.concat(Mt(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function kf(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,u=En(e),o=t?Fn(u,t):u;if(o.exponent<r||o.exponent>=i)return Nu(e,t);var a=o.coefficients,c=o.exponent;a.length<t&&(a=a.concat(Mt(t-a.length))),a=a.concat(Mt(c-a.length+1+(a.length<t?t-a.length:0))),a=Mt(-c).concat(a);var l=c>0?c:0;return l<a.length-1&&a.splice(l+1,0,"."),o.sign+a.join("")}function Fn(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t){var i=r.splice(t,r.length-t);if(i[0]>=5){var u=t-1;for(r[u]++;r[u]===10;)r.pop(),u===0&&(r.unshift(0),n.exponent++,u++),u--,r[u]++}}return n}function Mt(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Tf(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var qf=Number.EPSILON||2220446049250313e-31;function Uf(e,t,n){if(n==null)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var r=Math.abs(e-t);return r<qf?!0:r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}function qr(e,t,n){var r=e.constructor,i=new r(2),u="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!He(n))throw new Error("size must be an integer");if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(n))),u="i".concat(n)}switch(t){case 2:return"".concat(e.toBinary()).concat(u);case 8:return"".concat(e.toOctal()).concat(u);case 16:return"".concat(e.toHexadecimal()).concat(u);default:throw new Error("Base ".concat(t," not supported "))}}function Lf(e,t){if(typeof t=="function")return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n="auto",r,i;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t=="number"?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!="number")))throw new Error('Option "wordSize" must be a number');switch(n){case"fixed":return Vf(e,r);case"exponential":return Iu(e,r);case"engineering":return Hf(e,r);case"bin":return qr(e,2,i);case"oct":return qr(e,8,i);case"hex":return qr(e,16,i);case"auto":{var u=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return"0";var a,c=e.toSignificantDigits(r),l=c.e;return l>=u&&l<o?a=c.toFixed():a=Iu(e,r),a.replace(/((\.\d*?)(0+))($|e)/,function(){var f=arguments[2],s=arguments[4];return f!=="."?f+s:s})}default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Hf(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=e.mul(Math.pow(10,-r)),u=i.toPrecision(t);if(u.indexOf("e")!==-1){var o=e.constructor;u=new o(u).toFixed()}return u+"e"+(n>=0?"+":"")+r.toString()}function Iu(e,t){return t!==void 0?e.toExponential(t-1):e.toExponential()}function Vf(e,t){return e.toFixed(t)}function vt(e,t){var n=zf(e,t);return t&&typeof t=="object"&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function zf(e,t){if(typeof e=="number")return Tr(e,t);if(Ke(e))return Lf(e,t);if(Wf(e))return!t||t.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return Ru(e,t);if(Cn(e))return xu(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(t);if(e&&e.toString(t)!=={}.toString())return e.toString(t);var n=Object.keys(e).map(r=>xu(r)+": "+vt(e[r],t));return"{"+n.join(", ")+"}"}return String(e)}function xu(e){for(var t=String(e),n="",r=0;r<t.length;){var i=t.charAt(r);n+=i in Ou?Ou[i]:i,r++}return'"'+n+'"'}var Ou={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function Ru(e,t){if(Array.isArray(e)){for(var n="[",r=e.length,i=0;i<r;i++)i!==0&&(n+=", "),n+=Ru(e[i],t);return n+="]",n}else return vt(e,t)}function Wf(e){return e&&typeof e=="object"&&typeof e.s=="number"&&typeof e.n=="number"&&typeof e.d=="number"||!1}function he(e,t,n){if(!(this instanceof he))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=new Error().stack}he.prototype=new RangeError,he.prototype.constructor=RangeError,he.prototype.name="DimensionError",he.prototype.isDimensionError=!0;function Nt(e,t,n){if(!(this instanceof Nt))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Nt.prototype=new RangeError,Nt.prototype.constructor=RangeError,Nt.prototype.name="IndexError",Nt.prototype.isIndexError=!0;function mt(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Pu(e,t,n){var r,i=e.length;if(i!==t[n])throw new he(i,t[n]);if(n<t.length-1){var u=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new he(t.length-1,t.length,"<");Pu(e[r],t,u)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new he(t.length+1,t.length,">")}function ju(e,t){var n=t.length===0;if(n){if(Array.isArray(e))throw new he(e.length,0)}else Pu(e,t,0)}function Pe(e,t){if(e!==void 0){if(!ve(e)||!He(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof t=="number"&&e>=t)throw new Nt(e,t)}}function $u(e,t,n){if(!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new Error("Resizing to scalar is not supported");t.forEach(function(i){if(!ve(i)||!He(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+vt(t)+")")}),(ve(e)||Ke(e))&&(e=[e]);var r=n!==void 0?n:0;return Ur(e,t,0,r),e}function Ur(e,t,n,r){var i,u,o=e.length,a=t[n],c=Math.min(o,a);if(e.length=a,n<t.length-1){var l=n+1;for(i=0;i<c;i++)u=e[i],Array.isArray(u)||(u=[u],e[i]=u),Ur(u,t,l,r);for(i=c;i<a;i++)u=[],e[i]=u,Ur(u,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<a;i++)e[i]=r}}function ku(e,t){var n=Jf(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(t.length===0)throw new he(0,r,"!=");t=Tu(t,r);var i=qu(t);if(r!==i)throw new he(i,r,"!=");try{return Zf(n,t)}catch(u){throw u instanceof he?new he(i,r,"!="):u}}function Tu(e,t){var n=qu(e),r=e.slice(),i=-1,u=e.indexOf(i),o=e.indexOf(i,u+1)>=0;if(o)throw new Error("More than one wildcard in sizes");var a=u>=0,c=t%n===0;if(a)if(c)r[u]=-t/n;else throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);return r}function qu(e){return e.reduce((t,n)=>t*n,1)}function Zf(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var u=t[i];r=[];for(var o=n.length/u,a=0;a<o;a++)r.push(n.slice(a*u,(a+1)*u));n=r}return n}function Xf(e,t,n,r){var i=r||mt(e);if(n)for(var u=0;u<n;u++)e=[e],i.unshift(1);for(e=Uu(e,t,0);i.length<t;)i.push(1);return e}function Uu(e,t,n){var r,i;if(Array.isArray(e)){var u=n+1;for(r=0,i=e.length;r<i;r++)e[r]=Uu(e[r],t,u)}else for(var o=n;o<t;o++)e=[e];return e}function Jf(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function n(r){Array.isArray(r)?r.forEach(n):t.push(r)}),t}function Lr(e,t){for(var n,r=0,i=0;i<e.length;i++){var u=e[i],o=Array.isArray(u);if(i===0&&o&&(r=u.length),o&&u.length!==r)return;var a=o?Lr(u,t):t(u);if(n===void 0)n=a;else if(n!==a)return"mixed"}return n}function Lu(e,t,n,r){if(r<n){if(e.length!==t.length)throw new he(e.length,t.length);for(var i=[],u=0;u<e.length;u++)i[u]=Lu(e[u],t[u],n,r+1);return i}else return e.concat(t)}function Gf(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(n,r){return Lu(n,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Kf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(d=>d.length),i=Math.max(...r),u=new Array(i).fill(null),o=0;o<t.length;o++)for(var a=t[o],c=r[o],l=0;l<c;l++){var f=i-c+l;a[l]>u[f]&&(u[f]=a[l])}for(var s=0;s<t.length;s++)Hu(t[s],u);return u}function Hu(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var u=n-r+i;if(e[i]<t[u]&&e[i]>1||e[i]>t[u])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(r," with size ").concat(e[i]," to size ").concat(t[u]))}}function Vu(e,t){var n=mt(e);if(Gt(n,t))return e;Hu(n,t);var r=Kf(n,t),i=r.length,u=[...Array(i-n.length).fill(1),...n],o=Yf(e);n.length<i&&(o=ku(o,u),n=mt(o));for(var a=0;a<i;a++)n[a]<r[a]&&(o=Qf(o,r[a],a),n=mt(o));return o}function Qf(e,t,n){return Gf(...Array(t).fill(e),n)}function Yf(e){return An([],e)}function _e(e,t,n,r){function i(u){var o=Of(u,t.map(nl));return el(e,t,u),n(o)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function el(e,t,n){var r=t.filter(u=>!tl(u)).every(u=>n[u]!==void 0);if(!r){var i=t.filter(u=>n[u]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(u=>'"'.concat(u,'"')).join(", "),"."))}}function tl(e){return e&&e[0]==="?"}function nl(e){return e&&e[0]==="?"?e.slice(1):e}function rl(e,t){if(Wu(e)&&zu(e,t))return e[t];throw typeof e[t]=="function"&&ol(e,t)?new Error('Cannot access method "'+t+'" as a property'):new Error('No access to property "'+t+'"')}function il(e,t,n){if(Wu(e)&&zu(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function ul(e,t){return t in e}function zu(e,t){return!e||typeof e!="object"?!1:bn(sl,t)?!0:!(t in Object.prototype||t in Function.prototype)}function ol(e,t){return e==null||typeof e[t]!="function"||bn(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:bn(al,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Wu(e){return typeof e=="object"&&e&&e.constructor===Object}var sl={length:!0,name:!0},al={toString:!0,valueOf:!0,toLocaleString:!0};class cl{constructor(t){this.wrappedObject=t}keys(){return Object.keys(this.wrappedObject)}get(t){return rl(this.wrappedObject,t)}set(t,n){return il(this.wrappedObject,t,n),this}has(t){return ul(this.wrappedObject,t)}}function fl(e){return e?e instanceof Map||e instanceof cl||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var Zu=function(){return Zu=Mu.create,Mu},ll=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],dl=_e("typed",ll,function(t){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:u}=t,o=Zu();return o.clear(),o.addTypes([{name:"number",test:ve},{name:"Complex",test:wu},{name:"BigNumber",test:Ke},{name:"Fraction",test:Au},{name:"Unit",test:Cu},{name:"identifier",test:a=>Cn&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(a)},{name:"string",test:Cn},{name:"Chain",test:If},{name:"Array",test:Oe},{name:"Matrix",test:Bt},{name:"DenseMatrix",test:rf},{name:"SparseMatrix",test:uf},{name:"Range",test:of},{name:"Index",test:bu},{name:"boolean",test:sf},{name:"ResultSet",test:af},{name:"Help",test:cf},{name:"function",test:ff},{name:"Date",test:lf},{name:"RegExp",test:df},{name:"null",test:hf},{name:"undefined",test:pf},{name:"AccessorNode",test:gf},{name:"ArrayNode",test:Df},{name:"AssignmentNode",test:yf},{name:"BlockNode",test:vf},{name:"ConditionalNode",test:mf},{name:"ConstantNode",test:wf},{name:"FunctionNode",test:Cf},{name:"FunctionAssignmentNode",test:Af},{name:"IndexNode",test:bf},{name:"Node",test:Ef},{name:"ObjectNode",test:Ff},{name:"OperatorNode",test:_f},{name:"ParenthesisNode",test:Bf},{name:"RangeNode",test:Sf},{name:"RelationalNode",test:Mf},{name:"SymbolNode",test:Nf},{name:"Map",test:fl},{name:"Object",test:Eu}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(c){if(n||Hr(c),Tf(c)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+c+"). Use function bignumber(x) to convert to BigNumber.");return new n(c)}},{from:"number",to:"Complex",convert:function(c){return r||_n(c),new r(c,0)}},{from:"BigNumber",to:"Complex",convert:function(c){return r||_n(c),new r(c.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(c){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(c){return r||_n(c),new r(c.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(c){u||Vr(c);var l=new u(c);if(l.valueOf()!==c)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+c+"). Use function fraction(x) to convert to Fraction.");return l}},{from:"string",to:"number",convert:function(c){var l=Number(c);if(isNaN(l))throw new Error('Cannot convert "'+c+'" to a number');return l}},{from:"string",to:"BigNumber",convert:function(c){n||Hr(c);try{return new n(c)}catch(l){throw new Error('Cannot convert "'+c+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(c){u||Vr(c);try{return new u(c)}catch(l){throw new Error('Cannot convert "'+c+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(c){r||_n(c);try{return new r(c)}catch(l){throw new Error('Cannot convert "'+c+'" to Complex')}}},{from:"boolean",to:"number",convert:function(c){return+c}},{from:"boolean",to:"BigNumber",convert:function(c){return n||Hr(c),new n(+c)}},{from:"boolean",to:"Fraction",convert:function(c){return u||Vr(c),new u(+c)}},{from:"boolean",to:"string",convert:function(c){return String(c)}},{from:"Array",to:"Matrix",convert:function(c){return i||hl(),new i(c)}},{from:"Matrix",to:"Array",convert:function(c){return c.valueOf()}}]),o.onMismatch=(a,c,l)=>{var f=o.createError(a,c,l);if(["wrongType","mismatch"].includes(f.data.category)&&c.length===1&&jr(c[0])&&l.some(d=>!d.params.includes(","))){var s=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw s.data=f.data,s}throw f},o.onMismatch=(a,c,l)=>{var f=o.createError(a,c,l);if(["wrongType","mismatch"].includes(f.data.category)&&c.length===1&&jr(c[0])&&l.some(d=>!d.params.includes(","))){var s=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw s.data=f.data,s}throw f},o});function Hr(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function _n(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function hl(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Vr(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}/*!
10
10
  * decimal.js v10.4.3
11
11
  * An arbitrary-precision Decimal type for JavaScript.
12
12
  * https://github.com/MikeMcl/decimal.js
13
13
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
14
14
  * MIT Licence
15
- */var Nt=9e15,st=1e9,Jr="0123456789abcdef",Sn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Mn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Gr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Nt,maxE:Nt,crypto:!1},eo,Ye,k=!0,In="[DecimalError] ",ct=In+"Invalid argument: ",to=In+"Precision limit exceeded",no=In+"crypto unavailable",ro="[object Decimal]",ye=Math.floor,he=Math.pow,Cp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Fp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,uo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,je=1e7,L=7,bp=9007199254740991,Bp=Sn.length-1,Xr=Mn.length-1,B={toStringTag:ro};B.absoluteValue=B.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)},B.ceil=function(){return T(new this.constructor(this),this.e+1,2)},B.clampedTo=B.clamp=function(e,t){var n,r=this,u=r.constructor;if(e=new u(e),t=new u(t),!e.s||!t.s)return new u(NaN);if(e.gt(t))throw Error(ct+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new u(r)},B.comparedTo=B.cmp=function(e){var t,n,r,u,i=this,o=i.d,s=(e=new i.constructor(e)).d,c=i.s,f=e.s;if(!o||!s)return!c||!f?NaN:c!==f?c:o===s?0:!o^c<0?1:-1;if(!o[0]||!s[0])return o[0]?c:s[0]?-f:0;if(c!==f)return c;if(i.e!==e.e)return i.e>e.e^c<0?1:-1;for(r=o.length,u=s.length,t=0,n=r<u?r:u;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===u?0:r>u^c<0?1:-1},B.cosine=B.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+L,r.rounding=1,n=_p(r,lo(r,n)),r.precision=e,r.rounding=t,T(Ye==2||Ye==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},B.cubeRoot=B.cbrt=function(){var e,t,n,r,u,i,o,s,c,f,l=this,a=l.constructor;if(!l.isFinite()||l.isZero())return new a(l);for(k=!1,i=l.s*he(l.s*l,1/3),!i||Math.abs(i)==1/0?(n=pe(l.d),e=l.e,(i=(e-n.length+1)%3)&&(n+=i==1||i==-2?"0":"00"),i=he(n,1/3),e=ye((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?n="5e"+e:(n=i.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new a(n),r.s=l.s):r=new a(i.toString()),o=(e=a.precision)+3;;)if(s=r,c=s.times(s).times(s),f=c.plus(l),r=ee(f.plus(l).times(s),f.plus(c),o+2,1),pe(s.d).slice(0,o)===(n=pe(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!u&&n=="4999"){if(!u&&(T(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}o+=4,u=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(T(r,e+1,1),t=!r.times(r).times(r).eq(l));break}return k=!0,T(r,e,a.rounding,t)},B.decimalPlaces=B.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-ye(this.e/L))*L,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},B.dividedBy=B.div=function(e){return ee(this,new this.constructor(e))},B.dividedToIntegerBy=B.divToInt=function(e){var t=this,n=t.constructor;return T(ee(t,new n(e),0,1,1),n.precision,n.rounding)},B.equals=B.eq=function(e){return this.cmp(e)===0},B.floor=function(){return T(new this.constructor(this),this.e+1,3)},B.greaterThan=B.gt=function(e){return this.cmp(e)>0},B.greaterThanOrEqualTo=B.gte=function(e){var t=this.cmp(e);return t==1||t===0},B.hyperbolicCosine=B.cosh=function(){var e,t,n,r,u,i=this,o=i.constructor,s=new o(1);if(!i.isFinite())return new o(i.s?1/0:NaN);if(i.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(i.e,i.sd())+4,o.rounding=1,u=i.d.length,u<32?(e=Math.ceil(u/3),t=(1/Rn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),i=Ot(o,1,i.times(t),new o(1),!0);for(var c,f=e,l=new o(8);f--;)c=i.times(i),i=s.minus(c.times(l.minus(c.times(l))));return T(i,o.precision=n,o.rounding=r,!0)},B.hyperbolicSine=B.sinh=function(){var e,t,n,r,u=this,i=u.constructor;if(!u.isFinite()||u.isZero())return new i(u);if(t=i.precision,n=i.rounding,i.precision=t+Math.max(u.e,u.sd())+4,i.rounding=1,r=u.d.length,r<3)u=Ot(i,2,u,u,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,u=u.times(1/Rn(5,e)),u=Ot(i,2,u,u,!0);for(var o,s=new i(5),c=new i(16),f=new i(20);e--;)o=u.times(u),u=u.times(s.plus(o.times(c.times(o).plus(f))))}return i.precision=t,i.rounding=n,T(u,t,n,!0)},B.hyperbolicTangent=B.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,ee(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},B.inverseCosine=B.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),u=n.precision,i=n.rounding;return r!==-1?r===0?t.isNeg()?Le(n,u,i):new n(0):new n(NaN):t.isZero()?Le(n,u+4,i).times(.5):(n.precision=u+6,n.rounding=1,t=t.asin(),e=Le(n,u+4,i).times(.5),n.precision=u,n.rounding=i,e.minus(t))},B.inverseHyperbolicCosine=B.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,k=!1,n=n.times(n).minus(1).sqrt().plus(n),k=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},B.inverseHyperbolicSine=B.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,k=!1,n=n.times(n).plus(1).sqrt().plus(n),k=!0,r.precision=e,r.rounding=t,n.ln())},B.inverseHyperbolicTangent=B.atanh=function(){var e,t,n,r,u=this,i=u.constructor;return u.isFinite()?u.e>=0?new i(u.abs().eq(1)?u.s/0:u.isZero()?u:NaN):(e=i.precision,t=i.rounding,r=u.sd(),Math.max(r,e)<2*-u.e-1?T(new i(u),e,t,!0):(i.precision=n=r-u.e,u=ee(u.plus(1),new i(1).minus(u),n+e,1),i.precision=e+4,i.rounding=1,u=u.ln(),i.precision=e,i.rounding=t,u.times(.5))):new i(NaN)},B.inverseSine=B.asin=function(){var e,t,n,r,u=this,i=u.constructor;return u.isZero()?new i(u):(t=u.abs().cmp(1),n=i.precision,r=i.rounding,t!==-1?t===0?(e=Le(i,n+4,r).times(.5),e.s=u.s,e):new i(NaN):(i.precision=n+6,i.rounding=1,u=u.div(new i(1).minus(u.times(u)).sqrt().plus(1)).atan(),i.precision=n,i.rounding=r,u.times(2)))},B.inverseTangent=B.atan=function(){var e,t,n,r,u,i,o,s,c,f=this,l=f.constructor,a=l.precision,d=l.rounding;if(f.isFinite()){if(f.isZero())return new l(f);if(f.abs().eq(1)&&a+4<=Xr)return o=Le(l,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new l(NaN);if(a+4<=Xr)return o=Le(l,a+4,d).times(.5),o.s=f.s,o}for(l.precision=s=a+10,l.rounding=1,n=Math.min(28,s/L+2|0),e=n;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(k=!1,t=Math.ceil(s/L),r=1,c=f.times(f),o=new l(f),u=f;e!==-1;)if(u=u.times(c),i=o.minus(u.div(r+=2)),u=u.times(c),o=i.plus(u.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===i.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),k=!0,T(o,l.precision=a,l.rounding=d,!0)},B.isFinite=function(){return!!this.d},B.isInteger=B.isInt=function(){return!!this.d&&ye(this.e/L)>this.d.length-2},B.isNaN=function(){return!this.s},B.isNegative=B.isNeg=function(){return this.s<0},B.isPositive=B.isPos=function(){return this.s>0},B.isZero=function(){return!!this.d&&this.d[0]===0},B.lessThan=B.lt=function(e){return this.cmp(e)<0},B.lessThanOrEqualTo=B.lte=function(e){return this.cmp(e)<1},B.logarithm=B.log=function(e){var t,n,r,u,i,o,s,c,f=this,l=f.constructor,a=l.precision,d=l.rounding,h=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=f.d,f.s<0||!n||!n[0]||f.eq(1))return new l(n&&!n[0]?-1/0:f.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)i=!0;else{for(u=n[0];u%10===0;)u/=10;i=u!==1}if(k=!1,s=a+h,o=ft(f,s),r=t?xn(l,s+10):ft(e,s),c=ee(o,r,s,1),Kt(c.d,u=a,d))do if(s+=10,o=ft(f,s),r=t?xn(l,s+10):ft(e,s),c=ee(o,r,s,1),!i){+pe(c.d).slice(u+1,u+15)+1==1e14&&(c=T(c,a+1,0));break}while(Kt(c.d,u+=10,d));return k=!0,T(c,a,d)},B.minus=B.sub=function(e){var t,n,r,u,i,o,s,c,f,l,a,d,h=this,D=h.constructor;if(e=new D(e),!h.d||!e.d)return!h.s||!e.s?e=new D(NaN):h.d?e.s=-e.s:e=new D(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(f=h.d,d=e.d,s=D.precision,c=D.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new D(h);else return new D(c===3?-0:0);return k?T(e,s,c):e}if(n=ye(e.e/L),l=ye(h.e/L),f=f.slice(),i=l-n,i){for(a=i<0,a?(t=f,i=-i,o=d.length):(t=d,n=l,o=f.length),r=Math.max(Math.ceil(s/L),o)+2,i>r&&(i=r,t.length=1),t.reverse(),r=i;r--;)t.push(0);t.reverse()}else{for(r=f.length,o=d.length,a=r<o,a&&(o=r),r=0;r<o;r++)if(f[r]!=d[r]){a=f[r]<d[r];break}i=0}for(a&&(t=f,f=d,d=t,e.s=-e.s),o=f.length,r=d.length-o;r>0;--r)f[o++]=0;for(r=d.length;r>i;){if(f[--r]<d[r]){for(u=r;u&&f[--u]===0;)f[u]=je-1;--f[u],f[r]+=je}f[r]-=d[r]}for(;f[--o]===0;)f.pop();for(;f[0]===0;f.shift())--n;return f[0]?(e.d=f,e.e=On(f,n),k?T(e,s,c):e):new D(c===3?-0:0)},B.modulo=B.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?T(new r(n),r.precision,r.rounding):(k=!1,r.modulo==9?(t=ee(n,e.abs(),0,3,1),t.s*=e.s):t=ee(n,e,0,r.modulo,1),t=t.times(e),k=!0,n.minus(t))},B.naturalExponential=B.exp=function(){return Kr(this)},B.naturalLogarithm=B.ln=function(){return ft(this)},B.negated=B.neg=function(){var e=new this.constructor(this);return e.s=-e.s,T(e)},B.plus=B.add=function(e){var t,n,r,u,i,o,s,c,f,l,a=this,d=a.constructor;if(e=new d(e),!a.d||!e.d)return!a.s||!e.s?e=new d(NaN):a.d||(e=new d(e.d||a.s===e.s?a:NaN)),e;if(a.s!=e.s)return e.s=-e.s,a.minus(e);if(f=a.d,l=e.d,s=d.precision,c=d.rounding,!f[0]||!l[0])return l[0]||(e=new d(a)),k?T(e,s,c):e;if(i=ye(a.e/L),r=ye(e.e/L),f=f.slice(),u=i-r,u){for(u<0?(n=f,u=-u,o=l.length):(n=l,r=i,o=f.length),i=Math.ceil(s/L),o=i>o?i+1:o+1,u>o&&(u=o,n.length=1),n.reverse();u--;)n.push(0);n.reverse()}for(o=f.length,u=l.length,o-u<0&&(u=o,n=l,l=f,f=n),t=0;u;)t=(f[--u]=f[u]+l[u]+t)/je|0,f[u]%=je;for(t&&(f.unshift(t),++r),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=On(f,r),k?T(e,s,c):e},B.precision=B.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ct+e);return n.d?(t=io(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},B.round=function(){var e=this,t=e.constructor;return T(new t(e),e.e+1,t.rounding)},B.sine=B.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+L,r.rounding=1,n=Mp(r,lo(r,n)),r.precision=e,r.rounding=t,T(Ye>2?n.neg():n,e,t,!0)):new r(NaN)},B.squareRoot=B.sqrt=function(){var e,t,n,r,u,i,o=this,s=o.d,c=o.e,f=o.s,l=o.constructor;if(f!==1||!s||!s[0])return new l(!f||f<0&&(!s||s[0])?NaN:s?o:1/0);for(k=!1,f=Math.sqrt(+o),f==0||f==1/0?(t=pe(s),(t.length+c)%2==0&&(t+="0"),f=Math.sqrt(t),c=ye((c+1)/2)-(c<0||c%2),f==1/0?t="5e"+c:(t=f.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),r=new l(t)):r=new l(f.toString()),n=(c=l.precision)+3;;)if(i=r,r=i.plus(ee(o,i,n+2,1)).times(.5),pe(i.d).slice(0,n)===(t=pe(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!u&&t=="4999"){if(!u&&(T(i,c+1,0),i.times(i).eq(o))){r=i;break}n+=4,u=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(T(r,c+1,1),e=!r.times(r).eq(o));break}return k=!0,T(r,c,l.rounding,e)},B.tangent=B.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=ee(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,T(Ye==2||Ye==4?n.neg():n,e,t,!0)):new r(NaN)},B.times=B.mul=function(e){var t,n,r,u,i,o,s,c,f,l=this,a=l.constructor,d=l.d,h=(e=new a(e)).d;if(e.s*=l.s,!d||!d[0]||!h||!h[0])return new a(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=ye(l.e/L)+ye(e.e/L),c=d.length,f=h.length,c<f&&(i=d,d=h,h=i,o=c,c=f,f=o),i=[],o=c+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,u=c+r;u>r;)s=i[u]+h[r]*d[u-r-1]+t,i[u--]=s%je|0,t=s/je|0;i[u]=(i[u]+t)%je|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=On(i,n),k?T(e,a.precision,a.rounding):e},B.toBinary=function(e,t){return Yr(this,2,e,t)},B.toDecimalPlaces=B.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(be(e,0,st),t===void 0?t=r.rounding:be(t,0,8),T(n,e+n.e+1,t))},B.toExponential=function(e,t){var n,r=this,u=r.constructor;return e===void 0?n=He(r,!0):(be(e,0,st),t===void 0?t=u.rounding:be(t,0,8),r=T(new u(r),e+1,t),n=He(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},B.toFixed=function(e,t){var n,r,u=this,i=u.constructor;return e===void 0?n=He(u):(be(e,0,st),t===void 0?t=i.rounding:be(t,0,8),r=T(new i(u),e+u.e+1,t),n=He(r,!1,e+r.e+1)),u.isNeg()&&!u.isZero()?"-"+n:n},B.toFraction=function(e){var t,n,r,u,i,o,s,c,f,l,a,d,h=this,D=h.d,g=h.constructor;if(!D)return new g(h);if(f=n=new g(1),r=c=new g(0),t=new g(r),i=t.e=io(D)-h.e-1,o=i%L,t.d[0]=he(10,o<0?L+o:o),e==null)e=i>0?t:f;else{if(s=new g(e),!s.isInt()||s.lt(f))throw Error(ct+s);e=s.gt(t)?i>0?t:f:s}for(k=!1,s=new g(pe(D)),l=g.precision,g.precision=i=D.length*L*2;a=ee(s,t,0,1,1),u=n.plus(a.times(r)),u.cmp(e)!=1;)n=r,r=u,u=f,f=c.plus(a.times(u)),c=u,u=t,t=s.minus(a.times(u)),s=u;return u=ee(e.minus(n),r,0,1,1),c=c.plus(u.times(f)),n=n.plus(u.times(r)),c.s=f.s=h.s,d=ee(f,r,i,1).minus(h).abs().cmp(ee(c,n,i,1).minus(h).abs())<1?[f,r]:[c,n],g.precision=l,k=!0,d},B.toHexadecimal=B.toHex=function(e,t){return Yr(this,16,e,t)},B.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:be(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(k=!1,n=ee(n,e,0,t,1).times(e),k=!0,T(n)):(e.s=n.s,n=e),n},B.toNumber=function(){return+this},B.toOctal=function(e,t){return Yr(this,8,e,t)},B.toPower=B.pow=function(e){var t,n,r,u,i,o,s=this,c=s.constructor,f=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(he(+s,f));if(s=new c(s),s.eq(1))return s;if(r=c.precision,i=c.rounding,e.eq(1))return T(s,r,i);if(t=ye(e.e/L),t>=e.d.length-1&&(n=f<0?-f:f)<=bp)return u=oo(c,s,n,r),e.s<0?new c(1).div(u):T(u,r,i);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=he(+s,f),t=n==0||!isFinite(n)?ye(f*(Math.log("0."+pe(s.d))/Math.LN10+s.e+1)):new c(n+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(k=!1,c.rounding=s.s=1,n=Math.min(12,(t+"").length),u=Kr(e.times(ft(s,r+n)),r),u.d&&(u=T(u,r+5,1),Kt(u.d,r,i)&&(t=r+10,u=T(Kr(e.times(ft(s,t+n)),t),t+5,1),+pe(u.d).slice(r+1,r+15)+1==1e14&&(u=T(u,r+1,0)))),u.s=o,k=!0,c.rounding=i,T(u,r,i))},B.toPrecision=function(e,t){var n,r=this,u=r.constructor;return e===void 0?n=He(r,r.e<=u.toExpNeg||r.e>=u.toExpPos):(be(e,1,st),t===void 0?t=u.rounding:be(t,0,8),r=T(new u(r),e,t),n=He(r,e<=r.e||r.e<=u.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},B.toSignificantDigits=B.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(be(e,1,st),t===void 0?t=r.rounding:be(t,0,8)),T(new r(n),e,t)},B.toString=function(){var e=this,t=e.constructor,n=He(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},B.truncated=B.trunc=function(){return T(new this.constructor(this),this.e+1,1)},B.valueOf=B.toJSON=function(){var e=this,t=e.constructor,n=He(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function pe(e){var t,n,r,u=e.length-1,i="",o=e[0];if(u>0){for(i+=o,t=1;t<u;t++)r=e[t]+"",n=L-r.length,n&&(i+=lt(n)),i+=r;o=e[t],r=o+"",n=L-r.length,n&&(i+=lt(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}function be(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ct+e)}function Kt(e,t,n,r){var u,i,o,s;for(i=e[0];i>=10;i/=10)--t;return--t<0?(t+=L,u=0):(u=Math.ceil((t+1)/L),t%=L),i=he(10,L-t),s=e[u]%i|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==i||n>3&&s+1==i/2)&&(e[u+1]/i/100|0)==he(10,t-2)-1||(s==i/2||s==0)&&(e[u+1]/i/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==i||!r&&n>3&&s+1==i/2)&&(e[u+1]/i/1e3|0)==he(10,t-3)-1,o}function Nn(e,t,n){for(var r,u=[0],i,o=0,s=e.length;o<s;){for(i=u.length;i--;)u[i]*=t;for(u[0]+=Jr.indexOf(e.charAt(o++)),r=0;r<u.length;r++)u[r]>n-1&&(u[r+1]===void 0&&(u[r+1]=0),u[r+1]+=u[r]/n|0,u[r]%=n)}return u.reverse()}function _p(e,t){var n,r,u;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),u=(1/Rn(4,n)).toString()):(n=16,u="2.3283064365386962890625e-10"),e.precision+=n,t=Ot(e,1,t.times(u),new e(1));for(var i=n;i--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var ee=function(){function e(r,u,i){var o,s=0,c=r.length;for(r=r.slice();c--;)o=r[c]*u+s,r[c]=o%i|0,s=o/i|0;return s&&r.unshift(s),r}function t(r,u,i,o){var s,c;if(i!=o)c=i>o?1:-1;else for(s=c=0;s<i;s++)if(r[s]!=u[s]){c=r[s]>u[s]?1:-1;break}return c}function n(r,u,i,o){for(var s=0;i--;)r[i]-=s,s=r[i]<u[i]?1:0,r[i]=s*o+r[i]-u[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,u,i,o,s,c){var f,l,a,d,h,D,g,A,p,y,m,C,w,S,I,j,H,z,x,P,G=r.constructor,Z=r.s==u.s?1:-1,Q=r.d,q=u.d;if(!Q||!Q[0]||!q||!q[0])return new G(!r.s||!u.s||(Q?q&&Q[0]==q[0]:!q)?NaN:Q&&Q[0]==0||!q?Z*0:Z/0);for(c?(h=1,l=r.e-u.e):(c=je,h=L,l=ye(r.e/h)-ye(u.e/h)),x=q.length,H=Q.length,p=new G(Z),y=p.d=[],a=0;q[a]==(Q[a]||0);a++);if(q[a]>(Q[a]||0)&&l--,i==null?(S=i=G.precision,o=G.rounding):s?S=i+(r.e-u.e)+1:S=i,S<0)y.push(1),D=!0;else{if(S=S/h+2|0,a=0,x==1){for(d=0,q=q[0],S++;(a<H||d)&&S--;a++)I=d*c+(Q[a]||0),y[a]=I/q|0,d=I%q|0;D=d||a<H}else{for(d=c/(q[0]+1)|0,d>1&&(q=e(q,d,c),Q=e(Q,d,c),x=q.length,H=Q.length),j=x,m=Q.slice(0,x),C=m.length;C<x;)m[C++]=0;P=q.slice(),P.unshift(0),z=q[0],q[1]>=c/2&&++z;do d=0,f=t(q,m,x,C),f<0?(w=m[0],x!=C&&(w=w*c+(m[1]||0)),d=w/z|0,d>1?(d>=c&&(d=c-1),g=e(q,d,c),A=g.length,C=m.length,f=t(g,m,A,C),f==1&&(d--,n(g,x<A?P:q,A,c))):(d==0&&(f=d=1),g=q.slice()),A=g.length,A<C&&g.unshift(0),n(m,g,C,c),f==-1&&(C=m.length,f=t(q,m,x,C),f<1&&(d++,n(m,x<C?P:q,C,c))),C=m.length):f===0&&(d++,m=[0]),y[a++]=d,f&&m[0]?m[C++]=Q[j]||0:(m=[Q[j]],C=1);while((j++<H||m[0]!==void 0)&&S--);D=m[0]!==void 0}y[0]||y.shift()}if(h==1)p.e=l,eo=D;else{for(a=1,d=y[0];d>=10;d/=10)a++;p.e=a+l*h-1,T(p,s?i+p.e+1:i,o,D)}return p}}();function T(e,t,n,r){var u,i,o,s,c,f,l,a,d,h=e.constructor;e:if(t!=null){if(a=e.d,!a)return e;for(u=1,s=a[0];s>=10;s/=10)u++;if(i=t-u,i<0)i+=L,o=t,l=a[d=0],c=l/he(10,u-o-1)%10|0;else if(d=Math.ceil((i+1)/L),s=a.length,d>=s)if(r){for(;s++<=d;)a.push(0);l=c=0,u=1,i%=L,o=i-L+1}else break e;else{for(l=s=a[d],u=1;s>=10;s/=10)u++;i%=L,o=i-L+u,c=o<0?0:l/he(10,u-o-1)%10|0}if(r=r||t<0||a[d+1]!==void 0||(o<0?l:l%he(10,u-o-1)),f=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(i>0?o>0?l/he(10,u-o):0:a[d-1])%10&1||n==(e.s<0?8:7)),t<1||!a[0])return a.length=0,f?(t-=e.e+1,a[0]=he(10,(L-t%L)%L),e.e=-t||0):a[0]=e.e=0,e;if(i==0?(a.length=d,s=1,d--):(a.length=d+1,s=he(10,L-i),a[d]=o>0?(l/he(10,u-o)%he(10,o)|0)*s:0),f)for(;;)if(d==0){for(i=1,o=a[0];o>=10;o/=10)i++;for(o=a[0]+=s,s=1;o>=10;o/=10)s++;i!=s&&(e.e++,a[0]==je&&(a[0]=1));break}else{if(a[d]+=s,a[d]!=je)break;a[d--]=0,s=1}for(i=a.length;a[--i]===0;)a.pop()}return k&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function He(e,t,n){if(!e.isFinite())return co(e);var r,u=e.e,i=pe(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+lt(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):u<0?(i="0."+lt(-u-1)+i,n&&(r=n-o)>0&&(i+=lt(r))):u>=o?(i+=lt(u+1-o),n&&(r=n-u-1)>0&&(i=i+"."+lt(r))):((r=u+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(u+1===o&&(i+="."),i+=lt(r))),i}function On(e,t){var n=e[0];for(t*=L;n>=10;n/=10)t++;return t}function xn(e,t,n){if(t>Bp)throw k=!0,n&&(e.precision=n),Error(to);return T(new e(Sn),t,1,!0)}function Le(e,t,n){if(t>Xr)throw Error(to);return T(new e(Mn),t,n,!0)}function io(e){var t=e.length-1,n=t*L+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function lt(e){for(var t="";e--;)t+="0";return t}function oo(e,t,n,r){var u,i=new e(1),o=Math.ceil(r/L+4);for(k=!1;;){if(n%2&&(i=i.times(t),fo(i.d,o)&&(u=!0)),n=ye(n/2),n===0){n=i.d.length-1,u&&i.d[n]===0&&++i.d[n];break}t=t.times(t),fo(t.d,o)}return k=!0,i}function ao(e){return e.d[e.d.length-1]&1}function so(e,t,n){for(var r,u=new e(t[0]),i=0;++i<t.length;)if(r=new e(t[i]),r.s)u[n](r)&&(u=r);else{u=r;break}return u}function Kr(e,t){var n,r,u,i,o,s,c,f=0,l=0,a=0,d=e.constructor,h=d.rounding,D=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(k=!1,c=D):c=t,s=new d(.03125);e.e>-2;)e=e.times(s),a+=5;for(r=Math.log(he(2,a))/Math.LN10*2+5|0,c+=r,n=i=o=new d(1),d.precision=c;;){if(i=T(i.times(e),c,1),n=n.times(++l),s=o.plus(ee(i,n,c,1)),pe(s.d).slice(0,c)===pe(o.d).slice(0,c)){for(u=a;u--;)o=T(o.times(o),c,1);if(t==null)if(f<3&&Kt(o.d,c-r,h,f))d.precision=c+=10,n=i=s=new d(1),l=0,f++;else return T(o,d.precision=D,h,k=!0);else return d.precision=D,o}o=s}}function ft(e,t){var n,r,u,i,o,s,c,f,l,a,d,h=1,D=10,g=e,A=g.d,p=g.constructor,y=p.rounding,m=p.precision;if(g.s<0||!A||!A[0]||!g.e&&A[0]==1&&A.length==1)return new p(A&&!A[0]?-1/0:g.s!=1?NaN:A?0:g);if(t==null?(k=!1,l=m):l=t,p.precision=l+=D,n=pe(A),r=n.charAt(0),Math.abs(i=g.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=pe(g.d),r=n.charAt(0),h++;i=g.e,r>1?(g=new p("0."+n),i++):g=new p(r+"."+n.slice(1))}else return f=xn(p,l+2,m).times(i+""),g=ft(new p(r+"."+n.slice(1)),l-D).plus(f),p.precision=m,t==null?T(g,m,y,k=!0):g;for(a=g,c=o=g=ee(g.minus(1),g.plus(1),l,1),d=T(g.times(g),l,1),u=3;;){if(o=T(o.times(d),l,1),f=c.plus(ee(o,new p(u),l,1)),pe(f.d).slice(0,l)===pe(c.d).slice(0,l))if(c=c.times(2),i!==0&&(c=c.plus(xn(p,l+2,m).times(i+""))),c=ee(c,new p(h),l,1),t==null)if(Kt(c.d,l-D,y,s))p.precision=l+=D,f=o=g=ee(a.minus(1),a.plus(1),l,1),d=T(g.times(g),l,1),u=s=1;else return T(c,p.precision=m,y,k=!0);else return p.precision=m,c;c=f,u+=2}}function co(e){return String(e.s*e.s/0)}function Qr(e,t){var n,r,u;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(u=t.length;t.charCodeAt(u-1)===48;--u);if(t=t.slice(r,u),t){if(u-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%L,n<0&&(r+=L),r<u){for(r&&e.d.push(+t.slice(0,r)),u-=L;r<u;)e.d.push(+t.slice(r,r+=L));t=t.slice(r),r=L-t.length}else r-=u;for(;r--;)t+="0";e.d.push(+t),k&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Sp(e,t){var n,r,u,i,o,s,c,f,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),uo.test(t))return Qr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Fp.test(t))n=16,t=t.toLowerCase();else if(Cp.test(t))n=2;else if(wp.test(t))n=8;else throw Error(ct+t);for(i=t.search(/p/i),i>0?(c=+t.slice(i+1),t=t.substring(2,i)):t=t.slice(2),i=t.indexOf("."),o=i>=0,r=e.constructor,o&&(t=t.replace(".",""),s=t.length,i=s-i,u=oo(r,new r(n),i,i*2)),f=Nn(t,n,je),l=f.length-1,i=l;f[i]===0;--i)f.pop();return i<0?new r(e.s*0):(e.e=On(f,l),e.d=f,k=!1,o&&(e=ee(e,u,s*4)),c&&(e=e.times(Math.abs(c)<54?he(2,c):xt.pow(2,c))),k=!0,e)}function Mp(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Ot(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/Rn(5,n)),t=Ot(e,2,t,t);for(var u,i=new e(5),o=new e(16),s=new e(20);n--;)u=t.times(t),t=t.times(i.plus(u.times(o.times(u).minus(s))));return t}function Ot(e,t,n,r,u){var i,o,s,c,f=e.precision,l=Math.ceil(f/L);for(k=!1,c=n.times(n),s=new e(r);;){if(o=ee(s.times(c),new e(t++*t++),f,1),s=u?r.plus(o):r.minus(o),r=ee(o.times(c),new e(t++*t++),f,1),o=s.plus(r),o.d[l]!==void 0){for(i=l;o.d[i]===s.d[i]&&i--;);if(i==-1)break}i=s,s=r,r=o,o=i}return k=!0,o.d.length=l+1,o}function Rn(e,t){for(var n=e;--t;)n*=e;return n}function lo(e,t){var n,r=t.s<0,u=Le(e,e.precision,1),i=u.times(.5);if(t=t.abs(),t.lte(i))return Ye=r?4:1,t;if(n=t.divToInt(u),n.isZero())Ye=r?3:2;else{if(t=t.minus(n.times(u)),t.lte(i))return Ye=ao(n)?r?2:3:r?4:1,t;Ye=ao(n)?r?1:4:r?3:2}return t.minus(u).abs()}function Yr(e,t,n,r){var u,i,o,s,c,f,l,a,d,h=e.constructor,D=n!==void 0;if(D?(be(n,1,st),r===void 0?r=h.rounding:be(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())l=co(e);else{for(l=He(e),o=l.indexOf("."),D?(u=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):u=t,o>=0&&(l=l.replace(".",""),d=new h(1),d.e=l.length-o,d.d=Nn(He(d),10,u),d.e=d.d.length),a=Nn(l,10,u),i=c=a.length;a[--c]==0;)a.pop();if(!a[0])l=D?"0p+0":"0";else{if(o<0?i--:(e=new h(e),e.d=a,e.e=i,e=ee(e,d,n,r,0,u),a=e.d,i=e.e,f=eo),o=a[n],s=u/2,f=f||a[n+1]!==void 0,f=r<4?(o!==void 0||f)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||f||r===6&&a[n-1]&1||r===(e.s<0?8:7)),a.length=n,f)for(;++a[--n]>u-1;)a[n]=0,n||(++i,a.unshift(1));for(c=a.length;!a[c-1];--c);for(o=0,l="";o<c;o++)l+=Jr.charAt(a[o]);if(D){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)l+="0";for(a=Nn(l,u,t),c=a.length;!a[c-1];--c);for(o=1,l="1.";o<c;o++)l+=Jr.charAt(a[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)l="0"+l;l="0."+l}else if(++i>c)for(i-=c;i--;)l+="0";else i<c&&(l=l.slice(0,i)+"."+l.slice(i))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function fo(e,t){if(e.length>t)return e.length=t,!0}function Ip(e){return new this(e).abs()}function Np(e){return new this(e).acos()}function Op(e){return new this(e).acosh()}function xp(e,t){return new this(e).plus(t)}function Rp(e){return new this(e).asin()}function $p(e){return new this(e).asinh()}function Pp(e){return new this(e).atan()}function Tp(e){return new this(e).atanh()}function jp(e,t){e=new this(e),t=new this(t);var n,r=this.precision,u=this.rounding,i=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Le(this,i,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Le(this,r,u):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Le(this,i,1).times(.5),n.s=e.s):t.s<0?(this.precision=i,this.rounding=1,n=this.atan(ee(e,t,i,1)),t=Le(this,i,1),this.precision=r,this.rounding=u,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(ee(e,t,i,1)),n}function Lp(e){return new this(e).cbrt()}function kp(e){return T(e=new this(e),e.e+1,2)}function qp(e,t,n){return new this(e).clamp(t,n)}function Up(e){if(!e||typeof e!="object")throw Error(In+"Object expected");var t,n,r,u=e.defaults===!0,i=["precision",1,st,"rounding",0,8,"toExpNeg",-Nt,0,"toExpPos",0,Nt,"maxE",0,Nt,"minE",-Nt,0,"modulo",0,9];for(t=0;t<i.length;t+=3)if(n=i[t],u&&(this[n]=Gr[n]),(r=e[n])!==void 0)if(ye(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ct+n+": "+r);if(n="crypto",u&&(this[n]=Gr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(no);else this[n]=!1;else throw Error(ct+n+": "+r);return this}function Vp(e){return new this(e).cos()}function Hp(e){return new this(e).cosh()}function ho(e){var t,n,r;function u(i){var o,s,c,f=this;if(!(f instanceof u))return new u(i);if(f.constructor=u,po(i)){f.s=i.s,k?!i.d||i.e>u.maxE?(f.e=NaN,f.d=null):i.e<u.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(c=typeof i,c==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(o=0,s=i;s>=10;s/=10)o++;k?o>u.maxE?(f.e=NaN,f.d=null):o<u.minE?(f.e=0,f.d=[0]):(f.e=o,f.d=[i]):(f.e=o,f.d=[i]);return}else if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return Qr(f,i.toString())}else if(c!=="string")throw Error(ct+i);return(s=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(s===43&&(i=i.slice(1)),f.s=1),uo.test(i)?Qr(f,i):Sp(f,i)}if(u.prototype=B,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=Up,u.clone=ho,u.isDecimal=po,u.abs=Ip,u.acos=Np,u.acosh=Op,u.add=xp,u.asin=Rp,u.asinh=$p,u.atan=Pp,u.atanh=Tp,u.atan2=jp,u.cbrt=Lp,u.ceil=kp,u.clamp=qp,u.cos=Vp,u.cosh=Hp,u.div=zp,u.exp=Wp,u.floor=Zp,u.hypot=Jp,u.ln=Gp,u.log=Xp,u.log10=Qp,u.log2=Kp,u.max=Yp,u.min=eD,u.mod=tD,u.mul=nD,u.pow=rD,u.random=uD,u.round=iD,u.sign=oD,u.sin=aD,u.sinh=sD,u.sqrt=cD,u.sub=lD,u.sum=fD,u.tan=dD,u.tanh=hD,u.trunc=pD,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return u.config(e),u}function zp(e,t){return new this(e).div(t)}function Wp(e){return new this(e).exp()}function Zp(e){return T(e=new this(e),e.e+1,3)}function Jp(){var e,t,n=new this(0);for(k=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return k=!0,new this(1/0);n=t}return k=!0,n.sqrt()}function po(e){return e instanceof xt||e&&e.toStringTag===ro||!1}function Gp(e){return new this(e).ln()}function Xp(e,t){return new this(e).log(t)}function Kp(e){return new this(e).log(2)}function Qp(e){return new this(e).log(10)}function Yp(){return so(this,arguments,"lt")}function eD(){return so(this,arguments,"gt")}function tD(e,t){return new this(e).mod(t)}function nD(e,t){return new this(e).mul(t)}function rD(e,t){return new this(e).pow(t)}function uD(e){var t,n,r,u,i=0,o=new this(1),s=[];if(e===void 0?e=this.precision:be(e,1,st),r=Math.ceil(e/L),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));i<r;)u=t[i],u>=429e7?t[i]=crypto.getRandomValues(new Uint32Array(1))[0]:s[i++]=u%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);i<r;)u=t[i]+(t[i+1]<<8)+(t[i+2]<<16)+((t[i+3]&127)<<24),u>=214e7?crypto.randomBytes(4).copy(t,i):(s.push(u%1e7),i+=4);i=r/4}else throw Error(no);else for(;i<r;)s[i++]=Math.random()*1e7|0;for(r=s[--i],e%=L,r&&e&&(u=he(10,L-e),s[i]=(r/u|0)*u);s[i]===0;i--)s.pop();if(i<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=L)s.shift();for(r=1,u=s[0];u>=10;u/=10)r++;r<L&&(n-=L-r)}return o.e=n,o.d=s,o}function iD(e){return T(e=new this(e),e.e+1,this.rounding)}function oD(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function aD(e){return new this(e).sin()}function sD(e){return new this(e).sinh()}function cD(e){return new this(e).sqrt()}function lD(e,t){return new this(e).sub(t)}function fD(){var e=0,t=arguments,n=new this(t[e]);for(k=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return k=!0,T(n,this.precision,this.rounding)}function dD(e){return new this(e).tan()}function hD(e){return new this(e).tanh()}function pD(e){return T(e=new this(e),e.e+1,1)}B[Symbol.for("nodejs.util.inspect.custom")]=B.toString,B[Symbol.toStringTag]="Decimal";var xt=B.constructor=ho(Gr);Sn=new xt(Sn),Mn=new xt(Mn);var DD="BigNumber",gD=["?on","config"],vD=we(DD,gD,e=>{var{on:t,config:n}=e,r=xt.clone({precision:n.precision,modulo:xt.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(u){return new r(u.value)},t&&t("config",function(u,i){u.precision!==i.precision&&r.config({precision:u.precision})}),r},{isClass:!0}),Do={exports:{}};/**
15
+ */var It=9e15,at=1e9,zr="0123456789abcdef",Bn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Sn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Wr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-It,maxE:It,crypto:!1},Xu,Qe,q=!0,Mn="[DecimalError] ",ct=Mn+"Invalid argument: ",Ju=Mn+"Precision limit exceeded",Gu=Mn+"crypto unavailable",Ku="[object Decimal]",me=Math.floor,pe=Math.pow,pl=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,gl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Dl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Qu=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ke=1e7,T=7,yl=9007199254740991,vl=Bn.length-1,Zr=Sn.length-1,_={toStringTag:Ku};_.absoluteValue=_.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)},_.ceil=function(){return k(new this.constructor(this),this.e+1,2)},_.clampedTo=_.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(ct+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},_.comparedTo=_.cmp=function(e){var t,n,r,i,u=this,o=u.d,a=(e=new u.constructor(e)).d,c=u.s,l=e.s;if(!o||!a)return!c||!l?NaN:c!==l?c:o===a?0:!o^c<0?1:-1;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(u.e!==e.e)return u.e>e.e^c<0?1:-1;for(r=o.length,i=a.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},_.cosine=_.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+T,r.rounding=1,n=ml(r,io(r,n)),r.precision=e,r.rounding=t,k(Qe==2||Qe==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},_.cubeRoot=_.cbrt=function(){var e,t,n,r,i,u,o,a,c,l,f=this,s=f.constructor;if(!f.isFinite()||f.isZero())return new s(f);for(q=!1,u=f.s*pe(f.s*f,1/3),!u||Math.abs(u)==1/0?(n=ge(f.d),e=f.e,(u=(e-n.length+1)%3)&&(n+=u==1||u==-2?"0":"00"),u=pe(n,1/3),e=me((e+1)/3)-(e%3==(e<0?-1:2)),u==1/0?n="5e"+e:(n=u.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),r=new s(n),r.s=f.s):r=new s(u.toString()),o=(e=s.precision)+3;;)if(a=r,c=a.times(a).times(a),l=c.plus(f),r=te(l.plus(f).times(a),l.plus(c),o+2,1),ge(a.d).slice(0,o)===(n=ge(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!i&&n=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(f))){r=a;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(k(r,e+1,1),t=!r.times(r).times(r).eq(f));break}return q=!0,k(r,e,s.rounding,t)},_.decimalPlaces=_.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-me(this.e/T))*T,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},_.dividedBy=_.div=function(e){return te(this,new this.constructor(e))},_.dividedToIntegerBy=_.divToInt=function(e){var t=this,n=t.constructor;return k(te(t,new n(e),0,1,1),n.precision,n.rounding)},_.equals=_.eq=function(e){return this.cmp(e)===0},_.floor=function(){return k(new this.constructor(this),this.e+1,3)},_.greaterThan=_.gt=function(e){return this.cmp(e)>0},_.greaterThanOrEqualTo=_.gte=function(e){var t=this.cmp(e);return t==1||t===0},_.hyperbolicCosine=_.cosh=function(){var e,t,n,r,i,u=this,o=u.constructor,a=new o(1);if(!u.isFinite())return new o(u.s?1/0:NaN);if(u.isZero())return a;n=o.precision,r=o.rounding,o.precision=n+Math.max(u.e,u.sd())+4,o.rounding=1,i=u.d.length,i<32?(e=Math.ceil(i/3),t=(1/On(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),u=xt(o,1,u.times(t),new o(1),!0);for(var c,l=e,f=new o(8);l--;)c=u.times(u),u=a.minus(c.times(f.minus(c.times(f))));return k(u,o.precision=n,o.rounding=r,!0)},_.hyperbolicSine=_.sinh=function(){var e,t,n,r,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(t=u.precision,n=u.rounding,u.precision=t+Math.max(i.e,i.sd())+4,u.rounding=1,r=i.d.length,r<3)i=xt(u,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/On(5,e)),i=xt(u,2,i,i,!0);for(var o,a=new u(5),c=new u(16),l=new u(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return u.precision=t,u.rounding=n,k(i,t,n,!0)},_.hyperbolicTangent=_.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,te(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},_.inverseCosine=_.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,u=n.rounding;return r!==-1?r===0?t.isNeg()?Te(n,i,u):new n(0):new n(NaN):t.isZero()?Te(n,i+4,u).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=Te(n,i+4,u).times(.5),n.precision=i,n.rounding=u,e.minus(t))},_.inverseHyperbolicCosine=_.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,q=!1,n=n.times(n).minus(1).sqrt().plus(n),q=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},_.inverseHyperbolicSine=_.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,q=!1,n=n.times(n).plus(1).sqrt().plus(n),q=!0,r.precision=e,r.rounding=t,n.ln())},_.inverseHyperbolicTangent=_.atanh=function(){var e,t,n,r,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=u.precision,t=u.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?k(new u(i),e,t,!0):(u.precision=n=r-i.e,i=te(i.plus(1),new u(1).minus(i),n+e,1),u.precision=e+4,u.rounding=1,i=i.ln(),u.precision=e,u.rounding=t,i.times(.5))):new u(NaN)},_.inverseSine=_.asin=function(){var e,t,n,r,i=this,u=i.constructor;return i.isZero()?new u(i):(t=i.abs().cmp(1),n=u.precision,r=u.rounding,t!==-1?t===0?(e=Te(u,n+4,r).times(.5),e.s=i.s,e):new u(NaN):(u.precision=n+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=n,u.rounding=r,i.times(2)))},_.inverseTangent=_.atan=function(){var e,t,n,r,i,u,o,a,c,l=this,f=l.constructor,s=f.precision,d=f.rounding;if(l.isFinite()){if(l.isZero())return new f(l);if(l.abs().eq(1)&&s+4<=Zr)return o=Te(f,s+4,d).times(.25),o.s=l.s,o}else{if(!l.s)return new f(NaN);if(s+4<=Zr)return o=Te(f,s+4,d).times(.5),o.s=l.s,o}for(f.precision=a=s+10,f.rounding=1,n=Math.min(28,a/T+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(q=!1,t=Math.ceil(a/T),r=1,c=l.times(l),o=new f(l),i=l;e!==-1;)if(i=i.times(c),u=o.minus(i.div(r+=2)),i=i.times(c),o=u.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===u.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),q=!0,k(o,f.precision=s,f.rounding=d,!0)},_.isFinite=function(){return!!this.d},_.isInteger=_.isInt=function(){return!!this.d&&me(this.e/T)>this.d.length-2},_.isNaN=function(){return!this.s},_.isNegative=_.isNeg=function(){return this.s<0},_.isPositive=_.isPos=function(){return this.s>0},_.isZero=function(){return!!this.d&&this.d[0]===0},_.lessThan=_.lt=function(e){return this.cmp(e)<0},_.lessThanOrEqualTo=_.lte=function(e){return this.cmp(e)<1},_.logarithm=_.log=function(e){var t,n,r,i,u,o,a,c,l=this,f=l.constructor,s=f.precision,d=f.rounding,h=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new f(n&&!n[0]?-1/0:l.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)u=!0;else{for(i=n[0];i%10===0;)i/=10;u=i!==1}if(q=!1,a=s+h,o=lt(l,a),r=t?xn(f,a+10):lt(e,a),c=te(o,r,a,1),Kt(c.d,i=s,d))do if(a+=10,o=lt(l,a),r=t?xn(f,a+10):lt(e,a),c=te(o,r,a,1),!u){+ge(c.d).slice(i+1,i+15)+1==1e14&&(c=k(c,s+1,0));break}while(Kt(c.d,i+=10,d));return q=!0,k(c,s,d)},_.minus=_.sub=function(e){var t,n,r,i,u,o,a,c,l,f,s,d,h=this,g=h.constructor;if(e=new g(e),!h.d||!e.d)return!h.s||!e.s?e=new g(NaN):h.d?e.s=-e.s:e=new g(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(l=h.d,d=e.d,a=g.precision,c=g.rounding,!l[0]||!d[0]){if(d[0])e.s=-e.s;else if(l[0])e=new g(h);else return new g(c===3?-0:0);return q?k(e,a,c):e}if(n=me(e.e/T),f=me(h.e/T),l=l.slice(),u=f-n,u){for(s=u<0,s?(t=l,u=-u,o=d.length):(t=d,n=f,o=l.length),r=Math.max(Math.ceil(a/T),o)+2,u>r&&(u=r,t.length=1),t.reverse(),r=u;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=d.length,s=r<o,s&&(o=r),r=0;r<o;r++)if(l[r]!=d[r]){s=l[r]<d[r];break}u=0}for(s&&(t=l,l=d,d=t,e.s=-e.s),o=l.length,r=d.length-o;r>0;--r)l[o++]=0;for(r=d.length;r>u;){if(l[--r]<d[r]){for(i=r;i&&l[--i]===0;)l[i]=ke-1;--l[i],l[r]+=ke}l[r]-=d[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=In(l,n),q?k(e,a,c):e):new g(c===3?-0:0)},_.modulo=_.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?k(new r(n),r.precision,r.rounding):(q=!1,r.modulo==9?(t=te(n,e.abs(),0,3,1),t.s*=e.s):t=te(n,e,0,r.modulo,1),t=t.times(e),q=!0,n.minus(t))},_.naturalExponential=_.exp=function(){return Xr(this)},_.naturalLogarithm=_.ln=function(){return lt(this)},_.negated=_.neg=function(){var e=new this.constructor(this);return e.s=-e.s,k(e)},_.plus=_.add=function(e){var t,n,r,i,u,o,a,c,l,f,s=this,d=s.constructor;if(e=new d(e),!s.d||!e.d)return!s.s||!e.s?e=new d(NaN):s.d||(e=new d(e.d||s.s===e.s?s:NaN)),e;if(s.s!=e.s)return e.s=-e.s,s.minus(e);if(l=s.d,f=e.d,a=d.precision,c=d.rounding,!l[0]||!f[0])return f[0]||(e=new d(s)),q?k(e,a,c):e;if(u=me(s.e/T),r=me(e.e/T),l=l.slice(),i=u-r,i){for(i<0?(n=l,i=-i,o=f.length):(n=f,r=u,o=l.length),u=Math.ceil(a/T),o=u>o?u+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=f.length,o-i<0&&(i=o,n=f,f=l,l=n),t=0;i;)t=(l[--i]=l[i]+f[i]+t)/ke|0,l[i]%=ke;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=In(l,r),q?k(e,a,c):e},_.precision=_.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ct+e);return n.d?(t=Yu(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},_.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)},_.sine=_.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+T,r.rounding=1,n=Al(r,io(r,n)),r.precision=e,r.rounding=t,k(Qe>2?n.neg():n,e,t,!0)):new r(NaN)},_.squareRoot=_.sqrt=function(){var e,t,n,r,i,u,o=this,a=o.d,c=o.e,l=o.s,f=o.constructor;if(l!==1||!a||!a[0])return new f(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(q=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=ge(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=me((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),r=new f(t)):r=new f(l.toString()),n=(c=f.precision)+3;;)if(u=r,r=u.plus(te(o,u,n+2,1)).times(.5),ge(u.d).slice(0,n)===(t=ge(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(u,c+1,0),u.times(u).eq(o))){r=u;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(r,c+1,1),e=!r.times(r).eq(o));break}return q=!0,k(r,c,f.rounding,e)},_.tangent=_.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=te(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,k(Qe==2||Qe==4?n.neg():n,e,t,!0)):new r(NaN)},_.times=_.mul=function(e){var t,n,r,i,u,o,a,c,l,f=this,s=f.constructor,d=f.d,h=(e=new s(e)).d;if(e.s*=f.s,!d||!d[0]||!h||!h[0])return new s(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(n=me(f.e/T)+me(e.e/T),c=d.length,l=h.length,c<l&&(u=d,d=h,h=u,o=c,c=l,l=o),u=[],o=c+l,r=o;r--;)u.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)a=u[i]+h[r]*d[i-r-1]+t,u[i--]=a%ke|0,t=a/ke|0;u[i]=(u[i]+t)%ke|0}for(;!u[--o];)u.pop();return t?++n:u.shift(),e.d=u,e.e=In(u,n),q?k(e,s.precision,s.rounding):e},_.toBinary=function(e,t){return Gr(this,2,e,t)},_.toDecimalPlaces=_.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Be(e,0,at),t===void 0?t=r.rounding:Be(t,0,8),k(n,e+n.e+1,t))},_.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ve(r,!0):(Be(e,0,at),t===void 0?t=i.rounding:Be(t,0,8),r=k(new i(r),e+1,t),n=Ve(r,!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},_.toFixed=function(e,t){var n,r,i=this,u=i.constructor;return e===void 0?n=Ve(i):(Be(e,0,at),t===void 0?t=u.rounding:Be(t,0,8),r=k(new u(i),e+i.e+1,t),n=Ve(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},_.toFraction=function(e){var t,n,r,i,u,o,a,c,l,f,s,d,h=this,g=h.d,D=h.constructor;if(!g)return new D(h);if(l=n=new D(1),r=c=new D(0),t=new D(r),u=t.e=Yu(g)-h.e-1,o=u%T,t.d[0]=pe(10,o<0?T+o:o),e==null)e=u>0?t:l;else{if(a=new D(e),!a.isInt()||a.lt(l))throw Error(ct+a);e=a.gt(t)?u>0?t:l:a}for(q=!1,a=new D(ge(g)),f=D.precision,D.precision=u=g.length*T*2;s=te(a,t,0,1,1),i=n.plus(s.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(s.times(i)),c=i,i=t,t=a.minus(s.times(i)),a=i;return i=te(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=h.s,d=te(l,r,u,1).minus(h).abs().cmp(te(c,n,u,1).minus(h).abs())<1?[l,r]:[c,n],D.precision=f,q=!0,d},_.toHexadecimal=_.toHex=function(e,t){return Gr(this,16,e,t)},_.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:Be(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(q=!1,n=te(n,e,0,t,1).times(e),q=!0,k(n)):(e.s=n.s,n=e),n},_.toNumber=function(){return+this},_.toOctal=function(e,t){return Gr(this,8,e,t)},_.toPower=_.pow=function(e){var t,n,r,i,u,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(pe(+a,l));if(a=new c(a),a.eq(1))return a;if(r=c.precision,u=c.rounding,e.eq(1))return k(a,r,u);if(t=me(e.e/T),t>=e.d.length-1&&(n=l<0?-l:l)<=yl)return i=eo(c,a,n,r),e.s<0?new c(1).div(i):k(i,r,u);if(o=a.s,o<0){if(t<e.d.length-1)return new c(NaN);if((e.d[t]&1)==0&&(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return n=pe(+a,l),t=n==0||!isFinite(n)?me(l*(Math.log("0."+ge(a.d))/Math.LN10+a.e+1)):new c(n+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(q=!1,c.rounding=a.s=1,n=Math.min(12,(t+"").length),i=Xr(e.times(lt(a,r+n)),r),i.d&&(i=k(i,r+5,1),Kt(i.d,r,u)&&(t=r+10,i=k(Xr(e.times(lt(a,t+n)),t),t+5,1),+ge(i.d).slice(r+1,r+15)+1==1e14&&(i=k(i,r+1,0)))),i.s=o,q=!0,c.rounding=u,k(i,r,u))},_.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Ve(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Be(e,1,at),t===void 0?t=i.rounding:Be(t,0,8),r=k(new i(r),e,t),n=Ve(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},_.toSignificantDigits=_.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Be(e,1,at),t===void 0?t=r.rounding:Be(t,0,8)),k(new r(n),e,t)},_.toString=function(){var e=this,t=e.constructor,n=Ve(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},_.truncated=_.trunc=function(){return k(new this.constructor(this),this.e+1,1)},_.valueOf=_.toJSON=function(){var e=this,t=e.constructor,n=Ve(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function ge(e){var t,n,r,i=e.length-1,u="",o=e[0];if(i>0){for(u+=o,t=1;t<i;t++)r=e[t]+"",n=T-r.length,n&&(u+=ft(n)),u+=r;o=e[t],r=o+"",n=T-r.length,n&&(u+=ft(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return u+o}function Be(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ct+e)}function Kt(e,t,n,r){var i,u,o,a;for(u=e[0];u>=10;u/=10)--t;return--t<0?(t+=T,i=0):(i=Math.ceil((t+1)/T),t%=T),u=pe(10,T-t),a=e[i]%u|0,r==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):o=(n<4&&a+1==u||n>3&&a+1==u/2)&&(e[i+1]/u/100|0)==pe(10,t-2)-1||(a==u/2||a==0)&&(e[i+1]/u/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(r||n<4)&&a==9999||!r&&n>3&&a==4999):o=((r||n<4)&&a+1==u||!r&&n>3&&a+1==u/2)&&(e[i+1]/u/1e3|0)==pe(10,t-3)-1,o}function Nn(e,t,n){for(var r,i=[0],u,o=0,a=e.length;o<a;){for(u=i.length;u--;)i[u]*=t;for(i[0]+=zr.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function ml(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/On(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=xt(e,1,t.times(i),new e(1));for(var u=n;u--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var te=function(){function e(r,i,u){var o,a=0,c=r.length;for(r=r.slice();c--;)o=r[c]*i+a,r[c]=o%u|0,a=o/u|0;return a&&r.unshift(a),r}function t(r,i,u,o){var a,c;if(u!=o)c=u>o?1:-1;else for(a=c=0;a<u;a++)if(r[a]!=i[a]){c=r[a]>i[a]?1:-1;break}return c}function n(r,i,u,o){for(var a=0;u--;)r[u]-=a,a=r[u]<i[u]?1:0,r[u]=a*o+r[u]-i[u];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,u,o,a,c){var l,f,s,d,h,g,D,A,p,v,m,C,E,S,N,$,z,V,O,j,G=r.constructor,X=r.s==i.s?1:-1,Y=r.d,L=i.d;if(!Y||!Y[0]||!L||!L[0])return new G(!r.s||!i.s||(Y?L&&Y[0]==L[0]:!L)?NaN:Y&&Y[0]==0||!L?X*0:X/0);for(c?(h=1,f=r.e-i.e):(c=ke,h=T,f=me(r.e/h)-me(i.e/h)),O=L.length,z=Y.length,p=new G(X),v=p.d=[],s=0;L[s]==(Y[s]||0);s++);if(L[s]>(Y[s]||0)&&f--,u==null?(S=u=G.precision,o=G.rounding):a?S=u+(r.e-i.e)+1:S=u,S<0)v.push(1),g=!0;else{if(S=S/h+2|0,s=0,O==1){for(d=0,L=L[0],S++;(s<z||d)&&S--;s++)N=d*c+(Y[s]||0),v[s]=N/L|0,d=N%L|0;g=d||s<z}else{for(d=c/(L[0]+1)|0,d>1&&(L=e(L,d,c),Y=e(Y,d,c),O=L.length,z=Y.length),$=O,m=Y.slice(0,O),C=m.length;C<O;)m[C++]=0;j=L.slice(),j.unshift(0),V=L[0],L[1]>=c/2&&++V;do d=0,l=t(L,m,O,C),l<0?(E=m[0],O!=C&&(E=E*c+(m[1]||0)),d=E/V|0,d>1?(d>=c&&(d=c-1),D=e(L,d,c),A=D.length,C=m.length,l=t(D,m,A,C),l==1&&(d--,n(D,O<A?j:L,A,c))):(d==0&&(l=d=1),D=L.slice()),A=D.length,A<C&&D.unshift(0),n(m,D,C,c),l==-1&&(C=m.length,l=t(L,m,O,C),l<1&&(d++,n(m,O<C?j:L,C,c))),C=m.length):l===0&&(d++,m=[0]),v[s++]=d,l&&m[0]?m[C++]=Y[$]||0:(m=[Y[$]],C=1);while(($++<z||m[0]!==void 0)&&S--);g=m[0]!==void 0}v[0]||v.shift()}if(h==1)p.e=f,Xu=g;else{for(s=1,d=v[0];d>=10;d/=10)s++;p.e=s+f*h-1,k(p,a?u+p.e+1:u,o,g)}return p}}();function k(e,t,n,r){var i,u,o,a,c,l,f,s,d,h=e.constructor;e:if(t!=null){if(s=e.d,!s)return e;for(i=1,a=s[0];a>=10;a/=10)i++;if(u=t-i,u<0)u+=T,o=t,f=s[d=0],c=f/pe(10,i-o-1)%10|0;else if(d=Math.ceil((u+1)/T),a=s.length,d>=a)if(r){for(;a++<=d;)s.push(0);f=c=0,i=1,u%=T,o=u-T+1}else break e;else{for(f=a=s[d],i=1;a>=10;a/=10)i++;u%=T,o=u-T+i,c=o<0?0:f/pe(10,i-o-1)%10|0}if(r=r||t<0||s[d+1]!==void 0||(o<0?f:f%pe(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(u>0?o>0?f/pe(10,i-o):0:s[d-1])%10&1||n==(e.s<0?8:7)),t<1||!s[0])return s.length=0,l?(t-=e.e+1,s[0]=pe(10,(T-t%T)%T),e.e=-t||0):s[0]=e.e=0,e;if(u==0?(s.length=d,a=1,d--):(s.length=d+1,a=pe(10,T-u),s[d]=o>0?(f/pe(10,i-o)%pe(10,o)|0)*a:0),l)for(;;)if(d==0){for(u=1,o=s[0];o>=10;o/=10)u++;for(o=s[0]+=a,a=1;o>=10;o/=10)a++;u!=a&&(e.e++,s[0]==ke&&(s[0]=1));break}else{if(s[d]+=a,s[d]!=ke)break;s[d--]=0,a=1}for(u=s.length;s[--u]===0;)s.pop()}return q&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function Ve(e,t,n){if(!e.isFinite())return ro(e);var r,i=e.e,u=ge(e.d),o=u.length;return t?(n&&(r=n-o)>0?u=u.charAt(0)+"."+u.slice(1)+ft(r):o>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(e.e<0?"e":"e+")+e.e):i<0?(u="0."+ft(-i-1)+u,n&&(r=n-o)>0&&(u+=ft(r))):i>=o?(u+=ft(i+1-o),n&&(r=n-i-1)>0&&(u=u+"."+ft(r))):((r=i+1)<o&&(u=u.slice(0,r)+"."+u.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(u+="."),u+=ft(r))),u}function In(e,t){var n=e[0];for(t*=T;n>=10;n/=10)t++;return t}function xn(e,t,n){if(t>vl)throw q=!0,n&&(e.precision=n),Error(Ju);return k(new e(Bn),t,1,!0)}function Te(e,t,n){if(t>Zr)throw Error(Ju);return k(new e(Sn),t,n,!0)}function Yu(e){var t=e.length-1,n=t*T+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ft(e){for(var t="";e--;)t+="0";return t}function eo(e,t,n,r){var i,u=new e(1),o=Math.ceil(r/T+4);for(q=!1;;){if(n%2&&(u=u.times(t),uo(u.d,o)&&(i=!0)),n=me(n/2),n===0){n=u.d.length-1,i&&u.d[n]===0&&++u.d[n];break}t=t.times(t),uo(t.d,o)}return q=!0,u}function to(e){return e.d[e.d.length-1]&1}function no(e,t,n){for(var r,i=new e(t[0]),u=0;++u<t.length;)if(r=new e(t[u]),r.s)i[n](r)&&(i=r);else{i=r;break}return i}function Xr(e,t){var n,r,i,u,o,a,c,l=0,f=0,s=0,d=e.constructor,h=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(q=!1,c=g):c=t,a=new d(.03125);e.e>-2;)e=e.times(a),s+=5;for(r=Math.log(pe(2,s))/Math.LN10*2+5|0,c+=r,n=u=o=new d(1),d.precision=c;;){if(u=k(u.times(e),c,1),n=n.times(++f),a=o.plus(te(u,n,c,1)),ge(a.d).slice(0,c)===ge(o.d).slice(0,c)){for(i=s;i--;)o=k(o.times(o),c,1);if(t==null)if(l<3&&Kt(o.d,c-r,h,l))d.precision=c+=10,n=u=a=new d(1),f=0,l++;else return k(o,d.precision=g,h,q=!0);else return d.precision=g,o}o=a}}function lt(e,t){var n,r,i,u,o,a,c,l,f,s,d,h=1,g=10,D=e,A=D.d,p=D.constructor,v=p.rounding,m=p.precision;if(D.s<0||!A||!A[0]||!D.e&&A[0]==1&&A.length==1)return new p(A&&!A[0]?-1/0:D.s!=1?NaN:A?0:D);if(t==null?(q=!1,f=m):f=t,p.precision=f+=g,n=ge(A),r=n.charAt(0),Math.abs(u=D.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)D=D.times(e),n=ge(D.d),r=n.charAt(0),h++;u=D.e,r>1?(D=new p("0."+n),u++):D=new p(r+"."+n.slice(1))}else return l=xn(p,f+2,m).times(u+""),D=lt(new p(r+"."+n.slice(1)),f-g).plus(l),p.precision=m,t==null?k(D,m,v,q=!0):D;for(s=D,c=o=D=te(D.minus(1),D.plus(1),f,1),d=k(D.times(D),f,1),i=3;;){if(o=k(o.times(d),f,1),l=c.plus(te(o,new p(i),f,1)),ge(l.d).slice(0,f)===ge(c.d).slice(0,f))if(c=c.times(2),u!==0&&(c=c.plus(xn(p,f+2,m).times(u+""))),c=te(c,new p(h),f,1),t==null)if(Kt(c.d,f-g,v,a))p.precision=f+=g,l=o=D=te(s.minus(1),s.plus(1),f,1),d=k(D.times(D),f,1),i=a=1;else return k(c,p.precision=m,v,q=!0);else return p.precision=m,c;c=l,i+=2}}function ro(e){return String(e.s*e.s/0)}function Jr(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%T,n<0&&(r+=T),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=T;r<i;)e.d.push(+t.slice(r,r+=T));t=t.slice(r),r=T-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),q&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function wl(e,t){var n,r,i,u,o,a,c,l,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Qu.test(t))return Jr(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(gl.test(t))n=16,t=t.toLowerCase();else if(pl.test(t))n=2;else if(Dl.test(t))n=8;else throw Error(ct+t);for(u=t.search(/p/i),u>0?(c=+t.slice(u+1),t=t.substring(2,u)):t=t.slice(2),u=t.indexOf("."),o=u>=0,r=e.constructor,o&&(t=t.replace(".",""),a=t.length,u=a-u,i=eo(r,new r(n),u,u*2)),l=Nn(t,n,ke),f=l.length-1,u=f;l[u]===0;--u)l.pop();return u<0?new r(e.s*0):(e.e=In(l,f),e.d=l,q=!1,o&&(e=te(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?pe(2,c):Ot.pow(2,c))),q=!0,e)}function Al(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:xt(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/On(5,n)),t=xt(e,2,t,t);for(var i,u=new e(5),o=new e(16),a=new e(20);n--;)i=t.times(t),t=t.times(u.plus(i.times(o.times(i).minus(a))));return t}function xt(e,t,n,r,i){var u,o,a,c,l=e.precision,f=Math.ceil(l/T);for(q=!1,c=n.times(n),a=new e(r);;){if(o=te(a.times(c),new e(t++*t++),l,1),a=i?r.plus(o):r.minus(o),r=te(o.times(c),new e(t++*t++),l,1),o=a.plus(r),o.d[f]!==void 0){for(u=f;o.d[u]===a.d[u]&&u--;);if(u==-1)break}u=a,a=r,r=o,o=u}return q=!0,o.d.length=f+1,o}function On(e,t){for(var n=e;--t;)n*=e;return n}function io(e,t){var n,r=t.s<0,i=Te(e,e.precision,1),u=i.times(.5);if(t=t.abs(),t.lte(u))return Qe=r?4:1,t;if(n=t.divToInt(i),n.isZero())Qe=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(u))return Qe=to(n)?r?2:3:r?4:1,t;Qe=to(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Gr(e,t,n,r){var i,u,o,a,c,l,f,s,d,h=e.constructor,g=n!==void 0;if(g?(Be(n,1,at),r===void 0?r=h.rounding:Be(r,0,8)):(n=h.precision,r=h.rounding),!e.isFinite())f=ro(e);else{for(f=Ve(e),o=f.indexOf("."),g?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(f=f.replace(".",""),d=new h(1),d.e=f.length-o,d.d=Nn(Ve(d),10,i),d.e=d.d.length),s=Nn(f,10,i),u=c=s.length;s[--c]==0;)s.pop();if(!s[0])f=g?"0p+0":"0";else{if(o<0?u--:(e=new h(e),e.d=s,e.e=u,e=te(e,d,n,r,0,i),s=e.d,u=e.e,l=Xu),o=s[n],a=i/2,l=l||s[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>a||o===a&&(r===4||l||r===6&&s[n-1]&1||r===(e.s<0?8:7)),s.length=n,l)for(;++s[--n]>i-1;)s[n]=0,n||(++u,s.unshift(1));for(c=s.length;!s[c-1];--c);for(o=0,f="";o<c;o++)f+=zr.charAt(s[o]);if(g){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)f+="0";for(s=Nn(f,i,t),c=s.length;!s[c-1];--c);for(o=1,f="1.";o<c;o++)f+=zr.charAt(s[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)f="0"+f;f="0."+f}else if(++u>c)for(u-=c;u--;)f+="0";else u<c&&(f=f.slice(0,u)+"."+f.slice(u))}f=(t==16?"0x":t==2?"0b":t==8?"0o":"")+f}return e.s<0?"-"+f:f}function uo(e,t){if(e.length>t)return e.length=t,!0}function Cl(e){return new this(e).abs()}function bl(e){return new this(e).acos()}function El(e){return new this(e).acosh()}function Fl(e,t){return new this(e).plus(t)}function _l(e){return new this(e).asin()}function Bl(e){return new this(e).asinh()}function Sl(e){return new this(e).atan()}function Ml(e){return new this(e).atanh()}function Nl(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,u=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Te(this,u,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Te(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Te(this,u,1).times(.5),n.s=e.s):t.s<0?(this.precision=u,this.rounding=1,n=this.atan(te(e,t,u,1)),t=Te(this,u,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(te(e,t,u,1)),n}function Il(e){return new this(e).cbrt()}function xl(e){return k(e=new this(e),e.e+1,2)}function Ol(e,t,n){return new this(e).clamp(t,n)}function Rl(e){if(!e||typeof e!="object")throw Error(Mn+"Object expected");var t,n,r,i=e.defaults===!0,u=["precision",1,at,"rounding",0,8,"toExpNeg",-It,0,"toExpPos",0,It,"maxE",0,It,"minE",-It,0,"modulo",0,9];for(t=0;t<u.length;t+=3)if(n=u[t],i&&(this[n]=Wr[n]),(r=e[n])!==void 0)if(me(r)===r&&r>=u[t+1]&&r<=u[t+2])this[n]=r;else throw Error(ct+n+": "+r);if(n="crypto",i&&(this[n]=Wr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Gu);else this[n]=!1;else throw Error(ct+n+": "+r);return this}function Pl(e){return new this(e).cos()}function jl(e){return new this(e).cosh()}function oo(e){var t,n,r;function i(u){var o,a,c,l=this;if(!(l instanceof i))return new i(u);if(l.constructor=i,so(u)){l.s=u.s,q?!u.d||u.e>i.maxE?(l.e=NaN,l.d=null):u.e<i.minE?(l.e=0,l.d=[0]):(l.e=u.e,l.d=u.d.slice()):(l.e=u.e,l.d=u.d?u.d.slice():u.d);return}if(c=typeof u,c==="number"){if(u===0){l.s=1/u<0?-1:1,l.e=0,l.d=[0];return}if(u<0?(u=-u,l.s=-1):l.s=1,u===~~u&&u<1e7){for(o=0,a=u;a>=10;a/=10)o++;q?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[u]):(l.e=o,l.d=[u]);return}else if(u*0!==0){u||(l.s=NaN),l.e=NaN,l.d=null;return}return Jr(l,u.toString())}else if(c!=="string")throw Error(ct+u);return(a=u.charCodeAt(0))===45?(u=u.slice(1),l.s=-1):(a===43&&(u=u.slice(1)),l.s=1),Qu.test(u)?Jr(l,u):wl(l,u)}if(i.prototype=_,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Rl,i.clone=oo,i.isDecimal=so,i.abs=Cl,i.acos=bl,i.acosh=El,i.add=Fl,i.asin=_l,i.asinh=Bl,i.atan=Sl,i.atanh=Ml,i.atan2=Nl,i.cbrt=Il,i.ceil=xl,i.clamp=Ol,i.cos=Pl,i.cosh=jl,i.div=$l,i.exp=kl,i.floor=Tl,i.hypot=ql,i.ln=Ul,i.log=Ll,i.log10=Vl,i.log2=Hl,i.max=zl,i.min=Wl,i.mod=Zl,i.mul=Xl,i.pow=Jl,i.random=Gl,i.round=Kl,i.sign=Ql,i.sin=Yl,i.sinh=e0,i.sqrt=t0,i.sub=n0,i.sum=r0,i.tan=i0,i.tanh=u0,i.trunc=o0,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function $l(e,t){return new this(e).div(t)}function kl(e){return new this(e).exp()}function Tl(e){return k(e=new this(e),e.e+1,3)}function ql(){var e,t,n=new this(0);for(q=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return q=!0,new this(1/0);n=t}return q=!0,n.sqrt()}function so(e){return e instanceof Ot||e&&e.toStringTag===Ku||!1}function Ul(e){return new this(e).ln()}function Ll(e,t){return new this(e).log(t)}function Hl(e){return new this(e).log(2)}function Vl(e){return new this(e).log(10)}function zl(){return no(this,arguments,"lt")}function Wl(){return no(this,arguments,"gt")}function Zl(e,t){return new this(e).mod(t)}function Xl(e,t){return new this(e).mul(t)}function Jl(e,t){return new this(e).pow(t)}function Gl(e){var t,n,r,i,u=0,o=new this(1),a=[];if(e===void 0?e=this.precision:Be(e,1,at),r=Math.ceil(e/T),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));u<r;)i=t[u],i>=429e7?t[u]=crypto.getRandomValues(new Uint32Array(1))[0]:a[u++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);u<r;)i=t[u]+(t[u+1]<<8)+(t[u+2]<<16)+((t[u+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,u):(a.push(i%1e7),u+=4);u=r/4}else throw Error(Gu);else for(;u<r;)a[u++]=Math.random()*1e7|0;for(r=a[--u],e%=T,r&&e&&(i=pe(10,T-e),a[u]=(r/i|0)*i);a[u]===0;u--)a.pop();if(u<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=T)a.shift();for(r=1,i=a[0];i>=10;i/=10)r++;r<T&&(n-=T-r)}return o.e=n,o.d=a,o}function Kl(e){return k(e=new this(e),e.e+1,this.rounding)}function Ql(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Yl(e){return new this(e).sin()}function e0(e){return new this(e).sinh()}function t0(e){return new this(e).sqrt()}function n0(e,t){return new this(e).sub(t)}function r0(){var e=0,t=arguments,n=new this(t[e]);for(q=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return q=!0,k(n,this.precision,this.rounding)}function i0(e){return new this(e).tan()}function u0(e){return new this(e).tanh()}function o0(e){return k(e=new this(e),e.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString,_[Symbol.toStringTag]="Decimal";var Ot=_.constructor=oo(Wr);Bn=new Ot(Bn),Sn=new Ot(Sn);var s0="BigNumber",a0=["?on","config"],c0=_e(s0,a0,e=>{var{on:t,config:n}=e,r=Ot.clone({precision:n.precision,modulo:Ot.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},t&&t("config",function(i,u){i.precision!==u.precision&&r.config({precision:i.precision})}),r},{isClass:!0}),ao={exports:{}};/**
16
16
  * @license Complex.js v2.1.1 12/05/2020
17
17
  *
18
18
  * Copyright (c) 2020, Robert Eisele (robert@xarg.org)
19
19
  * Dual licensed under the MIT or GPL Version 2 licenses.
20
- **/(function(e,t){(function(n){var r=Math.cosh||function(a){return Math.abs(a)<1e-9?1-a:(Math.exp(a)+Math.exp(-a))*.5},u=Math.sinh||function(a){return Math.abs(a)<1e-9?a:(Math.exp(a)-Math.exp(-a))*.5},i=function(a){var d=Math.PI/4;if(-d>a||a>d)return Math.cos(a)-1;var h=a*a;return h*(h*(h*(h*(h*(h*(h*(h/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},o=function(a,d){var h=Math.abs(a),D=Math.abs(d);return h<3e3&&D<3e3?Math.sqrt(h*h+D*D):(h<D?(h=D,D=a/d):D=d/a,h*Math.sqrt(1+D*D))},s=function(){throw SyntaxError("Invalid Param")};function c(a,d){var h=Math.abs(a),D=Math.abs(d);return a===0?Math.log(D):d===0?Math.log(h):h<3e3&&D<3e3?Math.log(a*a+d*d)*.5:(a=a/2,d=d/2,.5*Math.log(a*a+d*d)+Math.LN2)}var f=function(a,d){var h={re:0,im:0};if(a==null)h.re=h.im=0;else if(d!==void 0)h.re=a,h.im=d;else switch(typeof a){case"object":if("im"in a&&"re"in a)h.re=a.re,h.im=a.im;else if("abs"in a&&"arg"in a){if(!Number.isFinite(a.abs)&&Number.isFinite(a.arg))return l.INFINITY;h.re=a.abs*Math.cos(a.arg),h.im=a.abs*Math.sin(a.arg)}else if("r"in a&&"phi"in a){if(!Number.isFinite(a.r)&&Number.isFinite(a.phi))return l.INFINITY;h.re=a.r*Math.cos(a.phi),h.im=a.r*Math.sin(a.phi)}else a.length===2?(h.re=a[0],h.im=a[1]):s();break;case"string":h.im=h.re=0;var D=a.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),g=1,A=0;D===null&&s();for(var p=0;p<D.length;p++){var y=D[p];y===" "||y===" "||y===`
21
- `||(y==="+"?g++:y==="-"?A++:y==="i"||y==="I"?(g+A===0&&s(),D[p+1]!==" "&&!isNaN(D[p+1])?(h.im+=parseFloat((A%2?"-":"")+D[p+1]),p++):h.im+=parseFloat((A%2?"-":"")+"1"),g=A=0):((g+A===0||isNaN(y))&&s(),D[p+1]==="i"||D[p+1]==="I"?(h.im+=parseFloat((A%2?"-":"")+y),p++):h.re+=parseFloat((A%2?"-":"")+y),g=A=0))}g+A>0&&s();break;case"number":h.im=0,h.re=a;break;default:s()}return isNaN(h.re)||isNaN(h.im),h};function l(a,d){if(!(this instanceof l))return new l(a,d);var h=f(a,d);this.re=h.re,this.im=h.im}l.prototype={re:0,im:0,sign:function(){var a=this.abs();return new l(this.re/a,this.im/a)},add:function(a,d){var h=new l(a,d);return this.isInfinite()&&h.isInfinite()?l.NAN:this.isInfinite()||h.isInfinite()?l.INFINITY:new l(this.re+h.re,this.im+h.im)},sub:function(a,d){var h=new l(a,d);return this.isInfinite()&&h.isInfinite()?l.NAN:this.isInfinite()||h.isInfinite()?l.INFINITY:new l(this.re-h.re,this.im-h.im)},mul:function(a,d){var h=new l(a,d);return this.isInfinite()&&h.isZero()||this.isZero()&&h.isInfinite()?l.NAN:this.isInfinite()||h.isInfinite()?l.INFINITY:h.im===0&&this.im===0?new l(this.re*h.re,0):new l(this.re*h.re-this.im*h.im,this.re*h.im+this.im*h.re)},div:function(a,d){var h=new l(a,d);if(this.isZero()&&h.isZero()||this.isInfinite()&&h.isInfinite())return l.NAN;if(this.isInfinite()||h.isZero())return l.INFINITY;if(this.isZero()||h.isInfinite())return l.ZERO;a=this.re,d=this.im;var D=h.re,g=h.im,A,p;return g===0?new l(a/D,d/D):Math.abs(D)<Math.abs(g)?(p=D/g,A=D*p+g,new l((a*p+d)/A,(d*p-a)/A)):(p=g/D,A=g*p+D,new l((a+d*p)/A,(d-a*p)/A))},pow:function(a,d){var h=new l(a,d);if(a=this.re,d=this.im,h.isZero())return l.ONE;if(h.im===0){if(d===0&&a>0)return new l(Math.pow(a,h.re),0);if(a===0)switch((h.re%4+4)%4){case 0:return new l(Math.pow(d,h.re),0);case 1:return new l(0,Math.pow(d,h.re));case 2:return new l(-Math.pow(d,h.re),0);case 3:return new l(0,-Math.pow(d,h.re))}}if(a===0&&d===0&&h.re>0&&h.im>=0)return l.ZERO;var D=Math.atan2(d,a),g=c(a,d);return a=Math.exp(h.re*g-h.im*D),d=h.im*g+h.re*D,new l(a*Math.cos(d),a*Math.sin(d))},sqrt:function(){var a=this.re,d=this.im,h=this.abs(),D,g;if(a>=0){if(d===0)return new l(Math.sqrt(a),0);D=.5*Math.sqrt(2*(h+a))}else D=Math.abs(d)/Math.sqrt(2*(h-a));return a<=0?g=.5*Math.sqrt(2*(h-a)):g=Math.abs(d)/Math.sqrt(2*(h+a)),new l(D,d<0?-g:g)},exp:function(){var a=Math.exp(this.re);return this.im,new l(a*Math.cos(this.im),a*Math.sin(this.im))},expm1:function(){var a=this.re,d=this.im;return new l(Math.expm1(a)*Math.cos(d)+i(d),Math.exp(a)*Math.sin(d))},log:function(){var a=this.re,d=this.im;return new l(c(a,d),Math.atan2(d,a))},abs:function(){return o(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var a=this.re,d=this.im;return new l(Math.sin(a)*r(d),Math.cos(a)*u(d))},cos:function(){var a=this.re,d=this.im;return new l(Math.cos(a)*r(d),-Math.sin(a)*u(d))},tan:function(){var a=2*this.re,d=2*this.im,h=Math.cos(a)+r(d);return new l(Math.sin(a)/h,u(d)/h)},cot:function(){var a=2*this.re,d=2*this.im,h=Math.cos(a)-r(d);return new l(-Math.sin(a)/h,u(d)/h)},sec:function(){var a=this.re,d=this.im,h=.5*r(2*d)+.5*Math.cos(2*a);return new l(Math.cos(a)*r(d)/h,Math.sin(a)*u(d)/h)},csc:function(){var a=this.re,d=this.im,h=.5*r(2*d)-.5*Math.cos(2*a);return new l(Math.sin(a)*r(d)/h,-Math.cos(a)*u(d)/h)},asin:function(){var a=this.re,d=this.im,h=new l(d*d-a*a+1,-2*a*d).sqrt(),D=new l(h.re-d,h.im+a).log();return new l(D.im,-D.re)},acos:function(){var a=this.re,d=this.im,h=new l(d*d-a*a+1,-2*a*d).sqrt(),D=new l(h.re-d,h.im+a).log();return new l(Math.PI/2-D.im,D.re)},atan:function(){var a=this.re,d=this.im;if(a===0){if(d===1)return new l(0,1/0);if(d===-1)return new l(0,-1/0)}var h=a*a+(1-d)*(1-d),D=new l((1-d*d-a*a)/h,-2*a/h).log();return new l(-.5*D.im,.5*D.re)},acot:function(){var a=this.re,d=this.im;if(d===0)return new l(Math.atan2(1,a),0);var h=a*a+d*d;return h!==0?new l(a/h,-d/h).atan():new l(a!==0?a/0:0,d!==0?-d/0:0).atan()},asec:function(){var a=this.re,d=this.im;if(a===0&&d===0)return new l(0,1/0);var h=a*a+d*d;return h!==0?new l(a/h,-d/h).acos():new l(a!==0?a/0:0,d!==0?-d/0:0).acos()},acsc:function(){var a=this.re,d=this.im;if(a===0&&d===0)return new l(Math.PI/2,1/0);var h=a*a+d*d;return h!==0?new l(a/h,-d/h).asin():new l(a!==0?a/0:0,d!==0?-d/0:0).asin()},sinh:function(){var a=this.re,d=this.im;return new l(u(a)*Math.cos(d),r(a)*Math.sin(d))},cosh:function(){var a=this.re,d=this.im;return new l(r(a)*Math.cos(d),u(a)*Math.sin(d))},tanh:function(){var a=2*this.re,d=2*this.im,h=r(a)+Math.cos(d);return new l(u(a)/h,Math.sin(d)/h)},coth:function(){var a=2*this.re,d=2*this.im,h=r(a)-Math.cos(d);return new l(u(a)/h,-Math.sin(d)/h)},csch:function(){var a=this.re,d=this.im,h=Math.cos(2*d)-r(2*a);return new l(-2*u(a)*Math.cos(d)/h,2*r(a)*Math.sin(d)/h)},sech:function(){var a=this.re,d=this.im,h=Math.cos(2*d)+r(2*a);return new l(2*r(a)*Math.cos(d)/h,-2*u(a)*Math.sin(d)/h)},asinh:function(){var a=this.im;this.im=-this.re,this.re=a;var d=this.asin();return this.re=-this.im,this.im=a,a=d.re,d.re=-d.im,d.im=a,d},acosh:function(){var a=this.acos();if(a.im<=0){var d=a.re;a.re=-a.im,a.im=d}else{var d=a.im;a.im=-a.re,a.re=d}return a},atanh:function(){var a=this.re,d=this.im,h=a>1&&d===0,D=1-a,g=1+a,A=D*D+d*d,p=A!==0?new l((g*D-d*d)/A,(d*D+g*d)/A):new l(a!==-1?a/0:0,d!==0?d/0:0),y=p.re;return p.re=c(p.re,p.im)/2,p.im=Math.atan2(p.im,y)/2,h&&(p.im=-p.im),p},acoth:function(){var a=this.re,d=this.im;if(a===0&&d===0)return new l(0,Math.PI/2);var h=a*a+d*d;return h!==0?new l(a/h,-d/h).atanh():new l(a!==0?a/0:0,d!==0?-d/0:0).atanh()},acsch:function(){var a=this.re,d=this.im;if(d===0)return new l(a!==0?Math.log(a+Math.sqrt(a*a+1)):1/0,0);var h=a*a+d*d;return h!==0?new l(a/h,-d/h).asinh():new l(a!==0?a/0:0,d!==0?-d/0:0).asinh()},asech:function(){var a=this.re,d=this.im;if(this.isZero())return l.INFINITY;var h=a*a+d*d;return h!==0?new l(a/h,-d/h).acosh():new l(a!==0?a/0:0,d!==0?-d/0:0).acosh()},inverse:function(){if(this.isZero())return l.INFINITY;if(this.isInfinite())return l.ZERO;var a=this.re,d=this.im,h=a*a+d*d;return new l(a/h,-d/h)},conjugate:function(){return new l(this.re,-this.im)},neg:function(){return new l(-this.re,-this.im)},ceil:function(a){return a=Math.pow(10,a||0),new l(Math.ceil(this.re*a)/a,Math.ceil(this.im*a)/a)},floor:function(a){return a=Math.pow(10,a||0),new l(Math.floor(this.re*a)/a,Math.floor(this.im*a)/a)},round:function(a){return a=Math.pow(10,a||0),new l(Math.round(this.re*a)/a,Math.round(this.im*a)/a)},equals:function(a,d){var h=new l(a,d);return Math.abs(h.re-this.re)<=l.EPSILON&&Math.abs(h.im-this.im)<=l.EPSILON},clone:function(){return new l(this.re,this.im)},toString:function(){var a=this.re,d=this.im,h="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(a)<l.EPSILON&&(a=0),Math.abs(d)<l.EPSILON&&(d=0),d===0?h+a:(a!==0?(h+=a,h+=" ",d<0?(d=-d,h+="-"):h+="+",h+=" "):d<0&&(d=-d,h+="-"),d!==1&&(h+=d),h+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},l.ZERO=new l(0,0),l.ONE=new l(1,0),l.I=new l(0,1),l.PI=new l(Math.PI,0),l.E=new l(Math.E,0),l.INFINITY=new l(1/0,1/0),l.NAN=new l(NaN,NaN),l.EPSILON=1e-15,Object.defineProperty(l,"__esModule",{value:!0}),l.default=l,l.Complex=l,e.exports=l})()})(Do);var De=Du(Do.exports),yD="Complex",mD=[],ED=we(yD,mD,()=>(Object.defineProperty(De,"name",{value:"Complex"}),De.prototype.constructor=De,De.prototype.type="Complex",De.prototype.isComplex=!0,De.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},De.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},De.prototype.format=function(e){var t="",n=this.im,r=this.re,u=Ur(this.re,e),i=Ur(this.im,e),o=ve(e)?e:e?e.precision:null;if(o!==null){var s=Math.pow(10,-o);Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return n===0?t=u:r===0?n===1?t="i":n===-1?t="-i":t=i+"i":n<0?n===-1?t=u+" - i":t=u+" - "+i.substring(1)+"i":n===1?t=u+" + i":t=u+" + "+i+"i",t},De.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return De(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(ve(n)){if(Si(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),ve(r))return new De({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},De.prototype.valueOf=De.prototype.toString,De.fromJSON=function(e){return new De(e)},De.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},De),{isClass:!0}),go={exports:{}};/**
20
+ **/(function(e,t){(function(n){var r=Math.cosh||function(s){return Math.abs(s)<1e-9?1-s:(Math.exp(s)+Math.exp(-s))*.5},i=Math.sinh||function(s){return Math.abs(s)<1e-9?s:(Math.exp(s)-Math.exp(-s))*.5},u=function(s){var d=Math.PI/4;if(-d>s||s>d)return Math.cos(s)-1;var h=s*s;return h*(h*(h*(h*(h*(h*(h*(h/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},o=function(s,d){var h=Math.abs(s),g=Math.abs(d);return h<3e3&&g<3e3?Math.sqrt(h*h+g*g):(h<g?(h=g,g=s/d):g=d/s,h*Math.sqrt(1+g*g))},a=function(){throw SyntaxError("Invalid Param")};function c(s,d){var h=Math.abs(s),g=Math.abs(d);return s===0?Math.log(g):d===0?Math.log(h):h<3e3&&g<3e3?Math.log(s*s+d*d)*.5:(s=s/2,d=d/2,.5*Math.log(s*s+d*d)+Math.LN2)}var l=function(s,d){var h={re:0,im:0};if(s==null)h.re=h.im=0;else if(d!==void 0)h.re=s,h.im=d;else switch(typeof s){case"object":if("im"in s&&"re"in s)h.re=s.re,h.im=s.im;else if("abs"in s&&"arg"in s){if(!Number.isFinite(s.abs)&&Number.isFinite(s.arg))return f.INFINITY;h.re=s.abs*Math.cos(s.arg),h.im=s.abs*Math.sin(s.arg)}else if("r"in s&&"phi"in s){if(!Number.isFinite(s.r)&&Number.isFinite(s.phi))return f.INFINITY;h.re=s.r*Math.cos(s.phi),h.im=s.r*Math.sin(s.phi)}else s.length===2?(h.re=s[0],h.im=s[1]):a();break;case"string":h.im=h.re=0;var g=s.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),D=1,A=0;g===null&&a();for(var p=0;p<g.length;p++){var v=g[p];v===" "||v===" "||v===`
21
+ `||(v==="+"?D++:v==="-"?A++:v==="i"||v==="I"?(D+A===0&&a(),g[p+1]!==" "&&!isNaN(g[p+1])?(h.im+=parseFloat((A%2?"-":"")+g[p+1]),p++):h.im+=parseFloat((A%2?"-":"")+"1"),D=A=0):((D+A===0||isNaN(v))&&a(),g[p+1]==="i"||g[p+1]==="I"?(h.im+=parseFloat((A%2?"-":"")+v),p++):h.re+=parseFloat((A%2?"-":"")+v),D=A=0))}D+A>0&&a();break;case"number":h.im=0,h.re=s;break;default:a()}return isNaN(h.re)||isNaN(h.im),h};function f(s,d){if(!(this instanceof f))return new f(s,d);var h=l(s,d);this.re=h.re,this.im=h.im}f.prototype={re:0,im:0,sign:function(){var s=this.abs();return new f(this.re/s,this.im/s)},add:function(s,d){var h=new f(s,d);return this.isInfinite()&&h.isInfinite()?f.NAN:this.isInfinite()||h.isInfinite()?f.INFINITY:new f(this.re+h.re,this.im+h.im)},sub:function(s,d){var h=new f(s,d);return this.isInfinite()&&h.isInfinite()?f.NAN:this.isInfinite()||h.isInfinite()?f.INFINITY:new f(this.re-h.re,this.im-h.im)},mul:function(s,d){var h=new f(s,d);return this.isInfinite()&&h.isZero()||this.isZero()&&h.isInfinite()?f.NAN:this.isInfinite()||h.isInfinite()?f.INFINITY:h.im===0&&this.im===0?new f(this.re*h.re,0):new f(this.re*h.re-this.im*h.im,this.re*h.im+this.im*h.re)},div:function(s,d){var h=new f(s,d);if(this.isZero()&&h.isZero()||this.isInfinite()&&h.isInfinite())return f.NAN;if(this.isInfinite()||h.isZero())return f.INFINITY;if(this.isZero()||h.isInfinite())return f.ZERO;s=this.re,d=this.im;var g=h.re,D=h.im,A,p;return D===0?new f(s/g,d/g):Math.abs(g)<Math.abs(D)?(p=g/D,A=g*p+D,new f((s*p+d)/A,(d*p-s)/A)):(p=D/g,A=D*p+g,new f((s+d*p)/A,(d-s*p)/A))},pow:function(s,d){var h=new f(s,d);if(s=this.re,d=this.im,h.isZero())return f.ONE;if(h.im===0){if(d===0&&s>0)return new f(Math.pow(s,h.re),0);if(s===0)switch((h.re%4+4)%4){case 0:return new f(Math.pow(d,h.re),0);case 1:return new f(0,Math.pow(d,h.re));case 2:return new f(-Math.pow(d,h.re),0);case 3:return new f(0,-Math.pow(d,h.re))}}if(s===0&&d===0&&h.re>0&&h.im>=0)return f.ZERO;var g=Math.atan2(d,s),D=c(s,d);return s=Math.exp(h.re*D-h.im*g),d=h.im*D+h.re*g,new f(s*Math.cos(d),s*Math.sin(d))},sqrt:function(){var s=this.re,d=this.im,h=this.abs(),g,D;if(s>=0){if(d===0)return new f(Math.sqrt(s),0);g=.5*Math.sqrt(2*(h+s))}else g=Math.abs(d)/Math.sqrt(2*(h-s));return s<=0?D=.5*Math.sqrt(2*(h-s)):D=Math.abs(d)/Math.sqrt(2*(h+s)),new f(g,d<0?-D:D)},exp:function(){var s=Math.exp(this.re);return this.im,new f(s*Math.cos(this.im),s*Math.sin(this.im))},expm1:function(){var s=this.re,d=this.im;return new f(Math.expm1(s)*Math.cos(d)+u(d),Math.exp(s)*Math.sin(d))},log:function(){var s=this.re,d=this.im;return new f(c(s,d),Math.atan2(d,s))},abs:function(){return o(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var s=this.re,d=this.im;return new f(Math.sin(s)*r(d),Math.cos(s)*i(d))},cos:function(){var s=this.re,d=this.im;return new f(Math.cos(s)*r(d),-Math.sin(s)*i(d))},tan:function(){var s=2*this.re,d=2*this.im,h=Math.cos(s)+r(d);return new f(Math.sin(s)/h,i(d)/h)},cot:function(){var s=2*this.re,d=2*this.im,h=Math.cos(s)-r(d);return new f(-Math.sin(s)/h,i(d)/h)},sec:function(){var s=this.re,d=this.im,h=.5*r(2*d)+.5*Math.cos(2*s);return new f(Math.cos(s)*r(d)/h,Math.sin(s)*i(d)/h)},csc:function(){var s=this.re,d=this.im,h=.5*r(2*d)-.5*Math.cos(2*s);return new f(Math.sin(s)*r(d)/h,-Math.cos(s)*i(d)/h)},asin:function(){var s=this.re,d=this.im,h=new f(d*d-s*s+1,-2*s*d).sqrt(),g=new f(h.re-d,h.im+s).log();return new f(g.im,-g.re)},acos:function(){var s=this.re,d=this.im,h=new f(d*d-s*s+1,-2*s*d).sqrt(),g=new f(h.re-d,h.im+s).log();return new f(Math.PI/2-g.im,g.re)},atan:function(){var s=this.re,d=this.im;if(s===0){if(d===1)return new f(0,1/0);if(d===-1)return new f(0,-1/0)}var h=s*s+(1-d)*(1-d),g=new f((1-d*d-s*s)/h,-2*s/h).log();return new f(-.5*g.im,.5*g.re)},acot:function(){var s=this.re,d=this.im;if(d===0)return new f(Math.atan2(1,s),0);var h=s*s+d*d;return h!==0?new f(s/h,-d/h).atan():new f(s!==0?s/0:0,d!==0?-d/0:0).atan()},asec:function(){var s=this.re,d=this.im;if(s===0&&d===0)return new f(0,1/0);var h=s*s+d*d;return h!==0?new f(s/h,-d/h).acos():new f(s!==0?s/0:0,d!==0?-d/0:0).acos()},acsc:function(){var s=this.re,d=this.im;if(s===0&&d===0)return new f(Math.PI/2,1/0);var h=s*s+d*d;return h!==0?new f(s/h,-d/h).asin():new f(s!==0?s/0:0,d!==0?-d/0:0).asin()},sinh:function(){var s=this.re,d=this.im;return new f(i(s)*Math.cos(d),r(s)*Math.sin(d))},cosh:function(){var s=this.re,d=this.im;return new f(r(s)*Math.cos(d),i(s)*Math.sin(d))},tanh:function(){var s=2*this.re,d=2*this.im,h=r(s)+Math.cos(d);return new f(i(s)/h,Math.sin(d)/h)},coth:function(){var s=2*this.re,d=2*this.im,h=r(s)-Math.cos(d);return new f(i(s)/h,-Math.sin(d)/h)},csch:function(){var s=this.re,d=this.im,h=Math.cos(2*d)-r(2*s);return new f(-2*i(s)*Math.cos(d)/h,2*r(s)*Math.sin(d)/h)},sech:function(){var s=this.re,d=this.im,h=Math.cos(2*d)+r(2*s);return new f(2*r(s)*Math.cos(d)/h,-2*i(s)*Math.sin(d)/h)},asinh:function(){var s=this.im;this.im=-this.re,this.re=s;var d=this.asin();return this.re=-this.im,this.im=s,s=d.re,d.re=-d.im,d.im=s,d},acosh:function(){var s=this.acos();if(s.im<=0){var d=s.re;s.re=-s.im,s.im=d}else{var d=s.im;s.im=-s.re,s.re=d}return s},atanh:function(){var s=this.re,d=this.im,h=s>1&&d===0,g=1-s,D=1+s,A=g*g+d*d,p=A!==0?new f((D*g-d*d)/A,(d*g+D*d)/A):new f(s!==-1?s/0:0,d!==0?d/0:0),v=p.re;return p.re=c(p.re,p.im)/2,p.im=Math.atan2(p.im,v)/2,h&&(p.im=-p.im),p},acoth:function(){var s=this.re,d=this.im;if(s===0&&d===0)return new f(0,Math.PI/2);var h=s*s+d*d;return h!==0?new f(s/h,-d/h).atanh():new f(s!==0?s/0:0,d!==0?-d/0:0).atanh()},acsch:function(){var s=this.re,d=this.im;if(d===0)return new f(s!==0?Math.log(s+Math.sqrt(s*s+1)):1/0,0);var h=s*s+d*d;return h!==0?new f(s/h,-d/h).asinh():new f(s!==0?s/0:0,d!==0?-d/0:0).asinh()},asech:function(){var s=this.re,d=this.im;if(this.isZero())return f.INFINITY;var h=s*s+d*d;return h!==0?new f(s/h,-d/h).acosh():new f(s!==0?s/0:0,d!==0?-d/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var s=this.re,d=this.im,h=s*s+d*d;return new f(s/h,-d/h)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(s){return s=Math.pow(10,s||0),new f(Math.ceil(this.re*s)/s,Math.ceil(this.im*s)/s)},floor:function(s){return s=Math.pow(10,s||0),new f(Math.floor(this.re*s)/s,Math.floor(this.im*s)/s)},round:function(s){return s=Math.pow(10,s||0),new f(Math.round(this.re*s)/s,Math.round(this.im*s)/s)},equals:function(s,d){var h=new f(s,d);return Math.abs(h.re-this.re)<=f.EPSILON&&Math.abs(h.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var s=this.re,d=this.im,h="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(s)<f.EPSILON&&(s=0),Math.abs(d)<f.EPSILON&&(d=0),d===0?h+s:(s!==0?(h+=s,h+=" ",d<0?(d=-d,h+="-"):h+="+",h+=" "):d<0&&(d=-d,h+="-"),d!==1&&(h+=d),h+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},f.ZERO=new f(0,0),f.ONE=new f(1,0),f.I=new f(0,1),f.PI=new f(Math.PI,0),f.E=new f(Math.E,0),f.INFINITY=new f(1/0,1/0),f.NAN=new f(NaN,NaN),f.EPSILON=1e-15,Object.defineProperty(f,"__esModule",{value:!0}),f.default=f,f.Complex=f,e.exports=f})()})(ao);var De=ci(ao.exports),f0="Complex",l0=[],d0=_e(f0,l0,()=>(Object.defineProperty(De,"name",{value:"Complex"}),De.prototype.constructor=De,De.prototype.type="Complex",De.prototype.isComplex=!0,De.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},De.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},De.prototype.format=function(e){var t="",n=this.im,r=this.re,i=Tr(this.re,e),u=Tr(this.im,e),o=ve(e)?e:e?e.precision:null;if(o!==null){var a=Math.pow(10,-o);Math.abs(r/n)<a&&(r=0),Math.abs(n/r)<a&&(n=0)}return n===0?t=i:r===0?n===1?t="i":n===-1?t="-i":t=u+"i":n<0?n===-1?t=i+" - i":t=i+" - "+u.substring(1)+"i":n===1?t=i+" + i":t=i+" + "+u+"i",t},De.fromPolar=function(e){switch(arguments.length){case 1:{var t=arguments[0];if(typeof t=="object")return De(t);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var n=arguments[0],r=arguments[1];if(ve(n)){if(Cu(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),ve(r))return new De({r:n,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},De.prototype.valueOf=De.prototype.toString,De.fromJSON=function(e){return new De(e)},De.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},De),{isClass:!0}),co={exports:{}};/**
22
22
  * @license Fraction.js v4.3.0 20/08/2023
23
23
  * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
24
24
  *
25
25
  * Copyright (c) 2023, Robert Eisele (robert@raw.org)
26
26
  * Dual licensed under the MIT or GPL Version 2 licenses.
27
- **/(function(e,t){(function(n){var r=2e3,u={s:1,n:0,d:1};function i(p,y){if(isNaN(p=parseInt(p,10)))throw g();return p*y}function o(p,y){if(y===0)throw D();var m=Object.create(h.prototype);m.s=p<0?-1:1,p=p<0?-p:p;var C=d(p,y);return m.n=p/C,m.d=y/C,m}function s(p){for(var y={},m=p,C=2,w=4;w<=m;){for(;m%C===0;)m/=C,y[C]=(y[C]||0)+1;w+=1+2*C++}return m!==p?m>1&&(y[m]=(y[m]||0)+1):y[p]=(y[p]||0)+1,y}var c=function(p,y){var m=0,C=1,w=1,S=0,I=0,j=0,H=1,z=1,x=0,P=1,G=1,Z=1,Q=1e7,q;if(p!=null)if(y!==void 0){if(m=p,C=y,w=m*C,m%1!==0||C%1!==0)throw A()}else switch(typeof p){case"object":{if("d"in p&&"n"in p)m=p.n,C=p.d,"s"in p&&(m*=p.s);else if(0 in p)m=p[0],1 in p&&(C=p[1]);else throw g();w=m*C;break}case"number":{if(p<0&&(w=p,p=-p),p%1===0)m=p;else if(p>0){for(p>=1&&(z=Math.pow(10,Math.floor(1+Math.log(p)/Math.LN10)),p/=z);P<=Q&&Z<=Q;)if(q=(x+G)/(P+Z),p===q){P+Z<=Q?(m=x+G,C=P+Z):Z>P?(m=G,C=Z):(m=x,C=P);break}else p>q?(x+=G,P+=Z):(G+=x,Z+=P),P>Q?(m=G,C=Z):(m=x,C=P);m*=z}else(isNaN(p)||isNaN(y))&&(C=m=NaN);break}case"string":{if(P=p.match(/\d+|./g),P===null)throw g();if(P[x]==="-"?(w=-1,x++):P[x]==="+"&&x++,P.length===x+1?I=i(P[x++],w):P[x+1]==="."||P[x]==="."?(P[x]!=="."&&(S=i(P[x++],w)),x++,(x+1===P.length||P[x+1]==="("&&P[x+3]===")"||P[x+1]==="'"&&P[x+3]==="'")&&(I=i(P[x],w),H=Math.pow(10,P[x].length),x++),(P[x]==="("&&P[x+2]===")"||P[x]==="'"&&P[x+2]==="'")&&(j=i(P[x+1],w),z=Math.pow(10,P[x+1].length)-1,x+=3)):P[x+1]==="/"||P[x+1]===":"?(I=i(P[x],w),H=i(P[x+2],1),x+=3):P[x+3]==="/"&&P[x+1]===" "&&(S=i(P[x],w),I=i(P[x+2],w),H=i(P[x+4],1),x+=5),P.length<=x){C=H*z,w=m=j+C*S+z*I;break}}default:throw g()}if(C===0)throw D();u.s=w<0?-1:1,u.n=Math.abs(m),u.d=Math.abs(C)};function f(p,y,m){for(var C=1;y>0;p=p*p%m,y>>=1)y&1&&(C=C*p%m);return C}function l(p,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var m=10%y,C=1;m!==1;C++)if(m=m*10%y,C>r)return 0;return C}function a(p,y,m){for(var C=1,w=f(10,m,y),S=0;S<300;S++){if(C===w)return S;C=C*10%y,w=w*10%y}return 0}function d(p,y){if(!p)return y;if(!y)return p;for(;;){if(p%=y,!p)return y;if(y%=p,!y)return p}}function h(p,y){if(c(p,y),this instanceof h)p=d(u.d,u.n),this.s=u.s,this.n=u.n/p,this.d=u.d/p;else return o(u.s*u.n,u.d)}var D=function(){return new Error("Division by Zero")},g=function(){return new Error("Invalid argument")},A=function(){return new Error("Parameters must be integer")};h.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(p,y){return c(p,y),o(this.s*this.n*u.d+u.s*this.d*u.n,this.d*u.d)},sub:function(p,y){return c(p,y),o(this.s*this.n*u.d-u.s*this.d*u.n,this.d*u.d)},mul:function(p,y){return c(p,y),o(this.s*u.s*this.n*u.n,this.d*u.d)},div:function(p,y){return c(p,y),o(this.s*u.s*this.n*u.d,this.d*u.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(p,y){if(isNaN(this.n)||isNaN(this.d))return new h(NaN);if(p===void 0)return o(this.s*this.n%this.d,1);if(c(p,y),u.n===0&&this.d===0)throw D();return o(this.s*(u.d*this.n)%(u.n*this.d),u.d*this.d)},gcd:function(p,y){return c(p,y),o(d(u.n,this.n)*d(u.d,this.d),u.d*this.d)},lcm:function(p,y){return c(p,y),u.n===0&&this.n===0?o(0,1):o(u.n*this.n,d(u.n,this.n)*d(u.d,this.d))},ceil:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.ceil(p*this.s*this.n/this.d),p)},floor:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.floor(p*this.s*this.n/this.d),p)},round:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.round(p*this.s*this.n/this.d),p)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(p,y){if(c(p,y),u.d===1)return u.s<0?o(Math.pow(this.s*this.d,u.n),Math.pow(this.n,u.n)):o(Math.pow(this.s*this.n,u.n),Math.pow(this.d,u.n));if(this.s<0)return null;var m=s(this.n),C=s(this.d),w=1,S=1;for(var I in m)if(I!=="1"){if(I==="0"){w=0;break}if(m[I]*=u.n,m[I]%u.d===0)m[I]/=u.d;else return null;w*=Math.pow(I,m[I])}for(var I in C)if(I!=="1"){if(C[I]*=u.n,C[I]%u.d===0)C[I]/=u.d;else return null;S*=Math.pow(I,C[I])}return u.s<0?o(S,w):o(w,S)},equals:function(p,y){return c(p,y),this.s*this.n*u.d===u.s*u.n*this.d},compare:function(p,y){c(p,y);var m=this.s*this.n*u.d-u.s*u.n*this.d;return(0<m)-(m<0)},simplify:function(p){if(isNaN(this.n)||isNaN(this.d))return this;p=p||.001;for(var y=this.abs(),m=y.toContinued(),C=1;C<m.length;C++){for(var w=o(m[C-1],1),S=C-2;S>=0;S--)w=w.inverse().add(m[S]);if(Math.abs(w.sub(y).valueOf())<p)return w.mul(this.s)}return this},divisible:function(p,y){return c(p,y),!(!(u.n*this.d)||this.n*u.d%(u.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(p){var y,m="",C=this.n,w=this.d;return this.s<0&&(m+="-"),w===1?m+=C:(p&&(y=Math.floor(C/w))>0&&(m+=y,m+=" ",C%=w),m+=C,m+="/",m+=w),m},toLatex:function(p){var y,m="",C=this.n,w=this.d;return this.s<0&&(m+="-"),w===1?m+=C:(p&&(y=Math.floor(C/w))>0&&(m+=y,C%=w),m+="\\frac{",m+=C,m+="}{",m+=w,m+="}"),m},toContinued:function(){var p,y=this.n,m=this.d,C=[];if(isNaN(y)||isNaN(m))return C;do C.push(Math.floor(y/m)),p=y%m,y=m,m=p;while(y!==1);return C},toString:function(p){var y=this.n,m=this.d;if(isNaN(y)||isNaN(m))return"NaN";p=p||15;var C=l(y,m),w=a(y,m,C),S=this.s<0?"-":"";if(S+=y/m|0,y%=m,y*=10,y&&(S+="."),C){for(var I=w;I--;)S+=y/m|0,y%=m,y*=10;S+="(";for(var I=C;I--;)S+=y/m|0,y%=m,y*=10;S+=")"}else for(var I=p;y&&I--;)S+=y/m|0,y%=m,y*=10;return S}},Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Fraction=h,e.exports=h})()})(go);var et=Du(go.exports),AD="Fraction",CD=[],FD=we(AD,CD,()=>(Object.defineProperty(et,"name",{value:"Fraction"}),et.prototype.constructor=et,et.prototype.type="Fraction",et.prototype.isFraction=!0,et.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},et.fromJSON=function(e){return new et(e)},et),{isClass:!0}),wD="Matrix",bD=[],BD=we(wD,bD,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function _D(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var SD="DenseMatrix",MD=["Matrix"],ID=we(SD,MD,e=>{var{Matrix:t}=e;function n(l,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Fn(a))throw new Error("Invalid datatype: "+a);if(_t(l))l.type==="DenseMatrix"?(this._data=vt(l._data),this._size=vt(l._size),this._datatype=a||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=a||l._datatype);else if(l&&Oe(l.data)&&Oe(l.size))this._data=l.data,this._size=l.size,Ui(this._data,this._size),this._datatype=a||l.datatype;else if(Oe(l))this._data=f(l),this._size=mt(this._data),Ui(this._data,this._size),this._datatype=a;else{if(l)throw new TypeError("Unsupported type of data ("+kr(l)+")");this._data=[],this._size=[0],this._datatype=a}}n.prototype=new t,n.prototype.createDenseMatrix=function(l,a){return new n(l,a)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return zr(this._data,kr)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(l,a){return new n(l,a)},n.prototype.subset=function(l,a,d){switch(arguments.length){case 1:return r(this,l);case 2:case 3:return i(this,l,a,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(l){if(!Oe(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new de(l.length,this._size.length);for(var a=0;a<l.length;a++)Re(l[a],this._size[a]);for(var d=this._data,h=0,D=l.length;h<D;h++){var g=l[h];Re(g,d.length),d=d[g]}return d},n.prototype.set=function(l,a,d){if(!Oe(l))throw new TypeError("Array expected");if(l.length<this._size.length)throw new de(l.length,this._size.length,"<");var h,D,g,A=l.map(function(y){return y+1});c(this,A,d);var p=this._data;for(h=0,D=l.length-1;h<D;h++)g=l[h],Re(g,p.length),p=p[g];return g=l[l.length-1],Re(g,p.length),p[g]=a,this};function r(l,a){if(!Mi(a))throw new TypeError("Invalid index");var d=a.isScalar();if(d)return l.get(a.min());var h=a.size();if(h.length!==l._size.length)throw new de(h.length,l._size.length);for(var D=a.min(),g=a.max(),A=0,p=l._size.length;A<p;A++)Re(D[A],l._size[A]),Re(g[A],l._size[A]);return new n(u(l._data,a,h.length,0),l._datatype)}function u(l,a,d,h){var D=h===d-1,g=a.dimension(h);return D?g.map(function(A){return Re(A,l.length),l[A]}).valueOf():g.map(function(A){Re(A,l.length);var p=l[A];return u(p,a,d,h+1)}).valueOf()}function i(l,a,d,h){if(!a||a.isIndex!==!0)throw new TypeError("Invalid index");var D=a.size(),g=a.isScalar(),A;if(_t(d)?(A=d.size(),d=d.valueOf()):A=mt(d),g){if(A.length!==0)throw new TypeError("Scalar expected");l.set(a.min(),d,h)}else{if(!Xt(A,D))try{A.length===0?d=Xi([d],D):d=Xi(d,D),A=mt(d)}catch(S){}if(D.length<l._size.length)throw new de(D.length,l._size.length,"<");if(A.length<D.length){for(var p=0,y=0;D[p]===1&&A[p]===1;)p++;for(;D[p]===1;)y++,p++;d=np(d,D.length,y,A)}if(!Xt(D,A))throw new de(D,A,">");var m=a.max().map(function(S){return S+1});c(l,m,h);var C=D.length,w=0;o(l._data,a,d,C,w)}return l}function o(l,a,d,h,D){var g=D===h-1,A=a.dimension(D);g?A.forEach(function(p,y){Re(p),l[p]=d[y[0]]}):A.forEach(function(p,y){Re(p),o(l[p],a,d[y[0]],h,D+1)})}n.prototype.resize=function(l,a,d){if(!Lr(l))throw new TypeError("Array or Matrix expected");var h=l.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),D=d?this.clone():this;return s(D,h,a)};function s(l,a,d){if(a.length===0){for(var h=l._data;Oe(h);)h=h[0];return h}return l._size=a.slice(0),l._data=Vi(l._data,l._size,d),l}n.prototype.reshape=function(l,a){var d=a?this.clone():this;d._data=Hi(d._data,l);var h=d._size.reduce((D,g)=>D*g);return d._size=zi(l,h),d};function c(l,a,d){for(var h=l._size.slice(0),D=!1;h.length<a.length;)h.push(0),D=!0;for(var g=0,A=a.length;g<A;g++)a[g]>h[g]&&(h[g]=a[g],D=!0);D&&s(l,h,d)}n.prototype.clone=function(){var l=new n({data:vt(this._data),size:vt(this._size),datatype:this._datatype});return l},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(l){var a=this,d=_D(l),h=function A(p,y){return Oe(p)?p.map(function(m,C){return A(m,y.concat(C))}):d===1?l(p):d===2?l(p,y):l(p,y,a)},D=h(this._data,[]),g=this._datatype!==void 0?zr(D,kr):void 0;return new n(D,g)},n.prototype.forEach=function(l){var a=this,d=function h(D,g){Oe(D)?D.forEach(function(A,p){h(A,g.concat(p))}):l(D,g,a)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*a(d,h){if(Oe(d))for(var D=0;D<d.length;D++)yield*a(d[D],h.concat(D));else yield{value:d,index:h}};yield*l(this._data,[])},n.prototype.rows=function(){var l=[],a=this.size();if(a.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)l.push(new n([h],this._datatype));return l},n.prototype.columns=function(){var l=this,a=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,D=function(p){var y=h.map(m=>[m[p]]);a.push(new n(y,l._datatype))},g=0;g<d[1];g++)D(g);return a},n.prototype.toArray=function(){return vt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(l){return yt(this._data,l)},n.prototype.toString=function(){return yt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(l){if(l){if(Qe(l)&&(l=l.toNumber()),!ve(l)||!Ve(l))throw new TypeError("The parameter k must be an integer number")}else l=0;for(var a=l>0?l:0,d=l<0?-l:0,h=this._size[0],D=this._size[1],g=Math.min(h-d,D-a),A=[],p=0;p<g;p++)A[p]=this._data[p+d][p+a];return new n({data:A,size:[g],datatype:this._datatype})},n.diagonal=function(l,a,d,h){if(!Oe(l))throw new TypeError("Array expected, size parameter");if(l.length!==2)throw new Error("Only two dimensions matrix are supported");if(l=l.map(function(I){if(Qe(I)&&(I=I.toNumber()),!ve(I)||!Ve(I)||I<1)throw new Error("Size values must be positive integers");return I}),d){if(Qe(d)&&(d=d.toNumber()),!ve(d)||!Ve(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var D=d>0?d:0,g=d<0?-d:0,A=l[0],p=l[1],y=Math.min(A-g,p-D),m;if(Oe(a)){if(a.length!==y)throw new Error("Invalid value array length");m=function(j){return a[j]}}else if(_t(a)){var C=a.size();if(C.length!==1||C[0]!==y)throw new Error("Invalid matrix length");m=function(j){return a.get([j])}}else m=function(){return a};h||(h=Qe(m(0))?m(0).mul(0):0);var w=[];if(l.length>0){w=Vi(w,l,h);for(var S=0;S<y;S++)w[S+g][S+D]=m(S)}return new n({data:w,size:[A,p]})},n.fromJSON=function(l){return new n(l)},n.prototype.swapRows=function(l,a){if(!ve(l)||!Ve(l)||!ve(a)||!Ve(a))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Re(l,this._size[0]),Re(a,this._size[0]),n._swapRows(l,a,this._data),this},n._swapRows=function(l,a,d){var h=d[l];d[l]=d[a],d[a]=h};function f(l){return _t(l)?f(l.valueOf()):Oe(l)?l.map(f):l}return n},{isClass:!0}),vo="equalScalar";we(vo,["typed","config"],e=>{var{typed:t,config:n}=e;return t(vo,{"number, number":function(u,i){return Gh(u,i,n.epsilon)}})});function Qt(e,t,n,r){if(!(this instanceof Qt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Qt.prototype=new Error,Qt.prototype.constructor=Error,Qt.prototype.name="ArgumentsError",Qt.prototype.isArgumentsError=!0;var yo="format",ND=["typed"],OD=we(yo,ND,e=>{var{typed:t}=e;return t(yo,{any:yt,"any, Object | function | number":yt})}),mo="bin",xD=["typed","format"];we(mo,xD,e=>{var{typed:t,format:n}=e;return t(mo,{"number | BigNumber":function(u){return n(u,{notation:"bin"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"bin",wordSize:i})}})});var Eo="oct",RD=["typed","format"];we(Eo,RD,e=>{var{typed:t,format:n}=e;return t(Eo,{"number | BigNumber":function(u){return n(u,{notation:"oct"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"oct",wordSize:i})}})});var Ao="hex",$D=["typed","format"];we(Ao,$D,e=>{var{typed:t,format:n}=e;return t(Ao,{"number | BigNumber":function(u){return n(u,{notation:"hex"})},"number | BigNumber, number":function(u,i){return n(u,{notation:"hex",wordSize:i})}})});var Co="equal";we(Co,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Co,{"any, any":function(u,i){return u===null?i===null:i===null?u===null:u===void 0?i===void 0:i===void 0?u===void 0:n(u,i)}})});var Fo="unequal";we(Fo,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Fo,{"any, any":function(u,i){return u===null?i!==null:i===null?u!==null:u===void 0?i!==void 0:i===void 0?u!==void 0:!n(u,i)}})});var wo={exports:{}};(function(e){(function(t,n,r){function u(c){var f=this,l=s();f.next=function(){var a=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=a-(f.c=a|0)},f.c=1,f.s0=l(" "),f.s1=l(" "),f.s2=l(" "),f.s0-=l(c),f.s0<0&&(f.s0+=1),f.s1-=l(c),f.s1<0&&(f.s1+=1),f.s2-=l(c),f.s2<0&&(f.s2+=1),l=null}function i(c,f){return f.c=c.c,f.s0=c.s0,f.s1=c.s1,f.s2=c.s2,f}function o(c,f){var l=new u(c),a=f&&f.state,d=l.next;return d.int32=function(){return l.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,a&&(typeof a=="object"&&i(a,l),d.state=function(){return i(l,{})}),d}function s(){var c=4022871197,f=function(l){l=String(l);for(var a=0;a<l.length;a++){c+=l.charCodeAt(a);var d=.02519603282416938*c;c=d>>>0,d-=c,d*=c,c=d>>>0,d-=c,c+=d*4294967296}return(c>>>0)*23283064365386963e-26};return f}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(tt,e,!1)})(wo);var bo={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this,f="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var a=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^a^a>>>8},s===(s|0)?c.x=s:f+=s;for(var l=0;l<f.length+64;l++)c.x^=f.charCodeAt(l)|0,c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c}function o(s,c){var f=new u(s),l=c&&c.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,D=(d+h)/(1<<21);while(D===0);return D},a.int32=f.next,a.quick=a,l&&(typeof l=="object"&&i(l,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(tt,e,!1)})(bo);var Bo={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this,f="";c.next=function(){var a=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(a^a<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,s===(s|0)?c.x=s:f+=s;for(var l=0;l<f.length+64;l++)c.x^=f.charCodeAt(l)|0,l==f.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c.v=s.v,c.d=s.d,c}function o(s,c){var f=new u(s),l=c&&c.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,D=(d+h)/(1<<21);while(D===0);return D},a.int32=f.next,a.quick=a,l&&(typeof l=="object"&&i(l,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(tt,e,!1)})(Bo);var _o={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this;c.next=function(){var l=c.x,a=c.i,d,h;return d=l[a],d^=d>>>7,h=d^d<<24,d=l[a+1&7],h^=d^d>>>10,d=l[a+3&7],h^=d^d>>>3,d=l[a+4&7],h^=d^d<<7,d=l[a+7&7],d=d^d<<13,h^=d^d<<9,l[a]=h,c.i=a+1&7,h};function f(l,a){var d,h=[];if(a===(a|0))h[0]=a;else for(a=""+a,d=0;d<a.length;++d)h[d&7]=h[d&7]<<15^a.charCodeAt(d)+h[d+1&7]<<13;for(;h.length<8;)h.push(0);for(d=0;d<8&&h[d]===0;++d);for(d==8?h[7]=-1:h[d],l.x=h,l.i=0,d=256;d>0;--d)l.next()}f(c,s)}function i(s,c){return c.x=s.x.slice(),c.i=s.i,c}function o(s,c){s==null&&(s=+new Date);var f=new u(s),l=c&&c.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,D=(d+h)/(1<<21);while(D===0);return D},a.int32=f.next,a.quick=a,l&&(l.x&&i(l,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(tt,e,!1)})(_o);var So={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this;c.next=function(){var l=c.w,a=c.X,d=c.i,h,D;return c.w=l=l+1640531527|0,D=a[d+34&127],h=a[d=d+1&127],D^=D<<13,h^=h<<17,D^=D>>>15,h^=h>>>12,D=a[d]=D^h,c.i=d,D+(l^l>>>16)|0};function f(l,a){var d,h,D,g,A,p=[],y=128;for(a===(a|0)?(h=a,a=null):(a=a+"\0",h=0,y=Math.max(y,a.length)),D=0,g=-32;g<y;++g)a&&(h^=a.charCodeAt((g+32)%a.length)),g===0&&(A=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,g>=0&&(A=A+1640531527|0,d=p[g&127]^=h+A,D=d==0?D+1:0);for(D>=128&&(p[(a&&a.length||0)&127]=-1),D=127,g=4*128;g>0;--g)h=p[D+34&127],d=p[D=D+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,p[D]=h^d;l.w=A,l.X=p,l.i=D}f(c,s)}function i(s,c){return c.i=s.i,c.w=s.w,c.X=s.X.slice(),c}function o(s,c){s==null&&(s=+new Date);var f=new u(s),l=c&&c.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,D=(d+h)/(1<<21);while(D===0);return D},a.int32=f.next,a.quick=a,l&&(l.X&&i(l,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(tt,e,!1)})(So);var Mo={exports:{}};(function(e){(function(t,n,r){function u(s){var c=this,f="";c.next=function(){var a=c.b,d=c.c,h=c.d,D=c.a;return a=a<<25^a>>>7^d,d=d-h|0,h=h<<24^h>>>8^D,D=D-a|0,c.b=a=a<<20^a>>>12^d,c.c=d=d-h|0,c.d=h<<16^d>>>16^D,c.a=D-a|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,s===Math.floor(s)?(c.a=s/4294967296|0,c.b=s|0):f+=s;for(var l=0;l<f.length+20;l++)c.b^=f.charCodeAt(l)|0,c.next()}function i(s,c){return c.a=s.a,c.b=s.b,c.c=s.c,c.d=s.d,c}function o(s,c){var f=new u(s),l=c&&c.state,a=function(){return(f.next()>>>0)/4294967296};return a.double=function(){do var d=f.next()>>>11,h=(f.next()>>>0)/4294967296,D=(d+h)/(1<<21);while(D===0);return D},a.int32=f.next,a.quick=a,l&&(typeof l=="object"&&i(l,f),a.state=function(){return i(f,{})}),a}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(tt,e,!1)})(Mo);var Io={exports:{}};(function(e){(function(t,n,r){var u=256,i=6,o=52,s="random",c=r.pow(u,i),f=r.pow(2,o),l=f*2,a=u-1,d;function h(C,w,S){var I=[];w=w==!0?{entropy:!0}:w||{};var j=p(A(w.entropy?[C,m(n)]:C==null?y():C,3),I),H=new D(I),z=function(){for(var x=H.g(i),P=c,G=0;x<f;)x=(x+G)*u,P*=u,G=H.g(1);for(;x>=l;)x/=2,P/=2,G>>>=1;return(x+G)/P};return z.int32=function(){return H.g(4)|0},z.quick=function(){return H.g(4)/4294967296},z.double=z,p(m(H.S),n),(w.pass||S||function(x,P,G,Z){return Z&&(Z.S&&g(Z,H),x.state=function(){return g(H,{})}),G?(r[s]=x,P):x})(z,j,"global"in w?w.global:this==r,w.state)}function D(C){var w,S=C.length,I=this,j=0,H=I.i=I.j=0,z=I.S=[];for(S||(C=[S++]);j<u;)z[j]=j++;for(j=0;j<u;j++)z[j]=z[H=a&H+C[j%S]+(w=z[j])],z[H]=w;(I.g=function(x){for(var P,G=0,Z=I.i,Q=I.j,q=I.S;x--;)P=q[Z=a&Z+1],G=G*u+q[a&(q[Z]=q[Q=a&Q+P])+(q[Q]=P)];return I.i=Z,I.j=Q,G})(u)}function g(C,w){return w.i=C.i,w.j=C.j,w.S=C.S.slice(),w}function A(C,w){var S=[],I=typeof C,j;if(w&&I=="object")for(j in C)try{S.push(A(C[j],w-1))}catch(H){}return S.length?S:I=="string"?C:C+"\0"}function p(C,w){for(var S=C+"",I,j=0;j<S.length;)w[a&j]=a&(I^=w[a&j]*19)+S.charCodeAt(j++);return m(w)}function y(){try{var C;return d&&(C=d.randomBytes)?C=C(u):(C=new Uint8Array(u),(t.crypto||t.msCrypto).getRandomValues(C)),m(C)}catch(I){var w=t.navigator,S=w&&w.plugins;return[+new Date,t,S,t.screen,m(n)]}}function m(C){return String.fromCharCode.apply(0,C)}if(p(r.random(),n),e.exports){e.exports=h;try{d=Ln.default}catch(C){}}else r["seed"+s]=h})(typeof self!="undefined"?self:tt,[],Math)})(Io);var PD=wo.exports,TD=bo.exports,jD=Bo.exports,LD=_o.exports,kD=So.exports,qD=Mo.exports,Rt=Io.exports;Rt.alea=PD,Rt.xor128=TD,Rt.xorwow=jD,Rt.xorshift7=LD,Rt.xor4096=kD,Rt.tychei=qD,$n("fineStructure",.0072973525693),$n("weakMixingAngle",.2229),$n("efimovFactor",22.7),$n("sackurTetrode",-1.16487052358);function $n(e,t){var n=["config","BigNumber"];return we(e,n,r=>{var{config:u,BigNumber:i}=r;return u.number==="BigNumber"?new i(t):t})}var UD=vD({config:Ni}),VD=ED({}),HD=FD({}),zD=BD({}),WD=ID({Matrix:zD}),ZD=Ep({BigNumber:UD,Complex:VD,DenseMatrix:WD,Fraction:HD}),JD=OD({typed:ZD});class GD{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{(t.props.dataBind.result.fieldCode===null||t.props.dataBind.result.fieldCode===void 0)&&this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===ne.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===$e.VariableInMainTable||r.type===$e.VariableInCurrentSubTable||r.type===$e.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===$e.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(u=>{const i=u.children[0];i&&this.engine.assertInstance(i,ne.CALC)&&n.push(i)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(u=>{this.computedCalcValue(u)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var i,o,s;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(i=t.options)==null?void 0:i.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(c=>{this.computedCalcValue(c)}),((s=this.dependenciesTriggerMap.get(t.instance.id))!=null?s:[]).forEach(c=>{this.computedCalcValue(c)})})}watchControlChange(){this.engine.on("change",t=>{var u;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(u=this.dependenciesTriggerMap.get(n.id))!=null?u:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(i=>{this.controlInSubtable(i)&&this.engine.getInstanceRowIndex(i)!==t.rowIndex||this.computedCalcValue(i)}):r.forEach(i=>{this.computedCalcValue(i)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===ne.SUBTABLE_COLUMN}computedCalcValue(t){var c;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const u=n.reduce((f,l)=>{if(l.type===$e.Operator||l.type===$e.Number)return f+l.name;let a=0,d;switch(l.type){case $e.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(l.id));d=this.engine.getInstance(l.id),a=Number(h);break}case $e.VariableInCurrentSubTable:{d=this.engine.getInstance(l.id,r);const h=this.engine.getState(l.id,r),D=this.getNumberValue(h);a=Number(D);break}case $e.VariableInOtherSubTable:{const h=this.engine.getState(l.id),D=Array.isArray(h)?h.map(A=>this.getNumberValue(A)):[],g=this.getAggregateTypeValue(D,l.aggregateType);d=this.engine.getInstance(l.subTableId),a=Number(g);break}}return!Number.isNaN(a)&&this.controlNeedComputedValue(d)?f+=`(${a})`:f+=0,f},"");let i;if(this.cacheComputedResult[u]!==void 0?i=this.cacheComputedResult[u]:(i=Number(JD(new Function(`return ${u}`)(),{precision:16})),this.cacheComputedResult[u]=i),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),s=!i||i===1/0||i===-1/0?0:t.props.precision===""?i:Number(i.toFixed(t.props.precision));s!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:s,unit:(c=o==null?void 0:o.unit)!=null?c:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case Et.MAX:return Math.max(...t);case Et.MIN:return Math.min(...t);case Et.SUM:return t.reduce((r,u)=>r+u);case Et.AVG:return t.reduce((r,u)=>r+u)/t.length}}}class XD{constructor(t,n=!0){this.config=t,this.isPc=n}apply(t){var o,s;this.engine=t;const n=(s=(o=this.config)==null?void 0:o.source)!=null?s:"";let r=document.createElement("style");r.className="edit-css-"+t.id;let u=document.querySelector("head");u==null||u.appendChild(r);let i;this.isPc?i=`[data-engine-id='${t.id}']{ ${n} }`:i=n,r.appendChild(document.createTextNode(i))}}W.CalcPlugin=GD,W.ControlsEventPlugin=fh,W.ES6ModulePlugin=sh,W.Engine=jr,W.LifecycleEventPlugin=lh,W.Plugin=ah,W.StylePlugin=XD,W.buildUUID=Zt,W.hasChildrenControl=mn,W.loopDataViewControl=gt,W.loopFormControl=Dt,W.parseModule=wi,Object.defineProperty(W,"__esModule",{value:!0})});
27
+ **/(function(e,t){(function(n){var r=2e3,i={s:1,n:0,d:1};function u(p,v){if(isNaN(p=parseInt(p,10)))throw D();return p*v}function o(p,v){if(v===0)throw g();var m=Object.create(h.prototype);m.s=p<0?-1:1,p=p<0?-p:p;var C=d(p,v);return m.n=p/C,m.d=v/C,m}function a(p){for(var v={},m=p,C=2,E=4;E<=m;){for(;m%C===0;)m/=C,v[C]=(v[C]||0)+1;E+=1+2*C++}return m!==p?m>1&&(v[m]=(v[m]||0)+1):v[p]=(v[p]||0)+1,v}var c=function(p,v){var m=0,C=1,E=1,S=0,N=0,$=0,z=1,V=1,O=0,j=1,G=1,X=1,Y=1e7,L;if(p!=null)if(v!==void 0){if(m=p,C=v,E=m*C,m%1!==0||C%1!==0)throw A()}else switch(typeof p){case"object":{if("d"in p&&"n"in p)m=p.n,C=p.d,"s"in p&&(m*=p.s);else if(0 in p)m=p[0],1 in p&&(C=p[1]);else throw D();E=m*C;break}case"number":{if(p<0&&(E=p,p=-p),p%1===0)m=p;else if(p>0){for(p>=1&&(V=Math.pow(10,Math.floor(1+Math.log(p)/Math.LN10)),p/=V);j<=Y&&X<=Y;)if(L=(O+G)/(j+X),p===L){j+X<=Y?(m=O+G,C=j+X):X>j?(m=G,C=X):(m=O,C=j);break}else p>L?(O+=G,j+=X):(G+=O,X+=j),j>Y?(m=G,C=X):(m=O,C=j);m*=V}else(isNaN(p)||isNaN(v))&&(C=m=NaN);break}case"string":{if(j=p.match(/\d+|./g),j===null)throw D();if(j[O]==="-"?(E=-1,O++):j[O]==="+"&&O++,j.length===O+1?N=u(j[O++],E):j[O+1]==="."||j[O]==="."?(j[O]!=="."&&(S=u(j[O++],E)),O++,(O+1===j.length||j[O+1]==="("&&j[O+3]===")"||j[O+1]==="'"&&j[O+3]==="'")&&(N=u(j[O],E),z=Math.pow(10,j[O].length),O++),(j[O]==="("&&j[O+2]===")"||j[O]==="'"&&j[O+2]==="'")&&($=u(j[O+1],E),V=Math.pow(10,j[O+1].length)-1,O+=3)):j[O+1]==="/"||j[O+1]===":"?(N=u(j[O],E),z=u(j[O+2],1),O+=3):j[O+3]==="/"&&j[O+1]===" "&&(S=u(j[O],E),N=u(j[O+2],E),z=u(j[O+4],1),O+=5),j.length<=O){C=z*V,E=m=$+C*S+V*N;break}}default:throw D()}if(C===0)throw g();i.s=E<0?-1:1,i.n=Math.abs(m),i.d=Math.abs(C)};function l(p,v,m){for(var C=1;v>0;p=p*p%m,v>>=1)v&1&&(C=C*p%m);return C}function f(p,v){for(;v%2===0;v/=2);for(;v%5===0;v/=5);if(v===1)return 0;for(var m=10%v,C=1;m!==1;C++)if(m=m*10%v,C>r)return 0;return C}function s(p,v,m){for(var C=1,E=l(10,m,v),S=0;S<300;S++){if(C===E)return S;C=C*10%v,E=E*10%v}return 0}function d(p,v){if(!p)return v;if(!v)return p;for(;;){if(p%=v,!p)return v;if(v%=p,!v)return p}}function h(p,v){if(c(p,v),this instanceof h)p=d(i.d,i.n),this.s=i.s,this.n=i.n/p,this.d=i.d/p;else return o(i.s*i.n,i.d)}var g=function(){return new Error("Division by Zero")},D=function(){return new Error("Invalid argument")},A=function(){return new Error("Parameters must be integer")};h.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(p,v){return c(p,v),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(p,v){return c(p,v),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(p,v){return c(p,v),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(p,v){return c(p,v),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(p,v){if(isNaN(this.n)||isNaN(this.d))return new h(NaN);if(p===void 0)return o(this.s*this.n%this.d,1);if(c(p,v),i.n===0&&this.d===0)throw g();return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(p,v){return c(p,v),o(d(i.n,this.n)*d(i.d,this.d),i.d*this.d)},lcm:function(p,v){return c(p,v),i.n===0&&this.n===0?o(0,1):o(i.n*this.n,d(i.n,this.n)*d(i.d,this.d))},ceil:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.ceil(p*this.s*this.n/this.d),p)},floor:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.floor(p*this.s*this.n/this.d),p)},round:function(p){return p=Math.pow(10,p||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):o(Math.round(p*this.s*this.n/this.d),p)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(p,v){if(c(p,v),i.d===1)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var m=a(this.n),C=a(this.d),E=1,S=1;for(var N in m)if(N!=="1"){if(N==="0"){E=0;break}if(m[N]*=i.n,m[N]%i.d===0)m[N]/=i.d;else return null;E*=Math.pow(N,m[N])}for(var N in C)if(N!=="1"){if(C[N]*=i.n,C[N]%i.d===0)C[N]/=i.d;else return null;S*=Math.pow(N,C[N])}return i.s<0?o(S,E):o(E,S)},equals:function(p,v){return c(p,v),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(p,v){c(p,v);var m=this.s*this.n*i.d-i.s*i.n*this.d;return(0<m)-(m<0)},simplify:function(p){if(isNaN(this.n)||isNaN(this.d))return this;p=p||.001;for(var v=this.abs(),m=v.toContinued(),C=1;C<m.length;C++){for(var E=o(m[C-1],1),S=C-2;S>=0;S--)E=E.inverse().add(m[S]);if(Math.abs(E.sub(v).valueOf())<p)return E.mul(this.s)}return this},divisible:function(p,v){return c(p,v),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(p){var v,m="",C=this.n,E=this.d;return this.s<0&&(m+="-"),E===1?m+=C:(p&&(v=Math.floor(C/E))>0&&(m+=v,m+=" ",C%=E),m+=C,m+="/",m+=E),m},toLatex:function(p){var v,m="",C=this.n,E=this.d;return this.s<0&&(m+="-"),E===1?m+=C:(p&&(v=Math.floor(C/E))>0&&(m+=v,C%=E),m+="\\frac{",m+=C,m+="}{",m+=E,m+="}"),m},toContinued:function(){var p,v=this.n,m=this.d,C=[];if(isNaN(v)||isNaN(m))return C;do C.push(Math.floor(v/m)),p=v%m,v=m,m=p;while(v!==1);return C},toString:function(p){var v=this.n,m=this.d;if(isNaN(v)||isNaN(m))return"NaN";p=p||15;var C=f(v,m),E=s(v,m,C),S=this.s<0?"-":"";if(S+=v/m|0,v%=m,v*=10,v&&(S+="."),C){for(var N=E;N--;)S+=v/m|0,v%=m,v*=10;S+="(";for(var N=C;N--;)S+=v/m|0,v%=m,v*=10;S+=")"}else for(var N=p;v&&N--;)S+=v/m|0,v%=m,v*=10;return S}},Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Fraction=h,e.exports=h})()})(co);var Ye=ci(co.exports),h0="Fraction",p0=[],g0=_e(h0,p0,()=>(Object.defineProperty(Ye,"name",{value:"Fraction"}),Ye.prototype.constructor=Ye,Ye.prototype.type="Fraction",Ye.prototype.isFraction=!0,Ye.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ye.fromJSON=function(e){return new Ye(e)},Ye),{isClass:!0}),D0="Matrix",y0=[],v0=_e(D0,y0,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(t,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(t,n,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function m0(e){return Object.keys(e.signatures||{}).reduce(function(t,n){var r=(n.match(/,/g)||[]).length+1;return Math.max(t,r)},-1)}var w0="DenseMatrix",A0=["Matrix"],C0=_e(w0,A0,e=>{var{Matrix:t}=e;function n(f,s){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(s&&!Cn(s))throw new Error("Invalid datatype: "+s);if(Bt(f))f.type==="DenseMatrix"?(this._data=yt(f._data),this._size=yt(f._size),this._datatype=s||f._datatype):(this._data=f.toArray(),this._size=f.size(),this._datatype=s||f._datatype);else if(f&&Oe(f.data)&&Oe(f.size))this._data=f.data,this._size=f.size,ju(this._data,this._size),this._datatype=s||f.datatype;else if(Oe(f))this._data=l(f),this._size=mt(this._data),ju(this._data,this._size),this._datatype=s;else{if(f)throw new TypeError("Unsupported type of data ("+$r(f)+")");this._data=[],this._size=[0],this._datatype=s}}n.prototype=new t,n.prototype.createDenseMatrix=function(f,s){return new n(f,s)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Lr(this._data,$r)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(f,s){return new n(f,s)},n.prototype.subset=function(f,s,d){switch(arguments.length){case 1:return r(this,f);case 2:case 3:return u(this,f,s,d);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(f){if(!Oe(f))throw new TypeError("Array expected");if(f.length!==this._size.length)throw new he(f.length,this._size.length);for(var s=0;s<f.length;s++)Pe(f[s],this._size[s]);for(var d=this._data,h=0,g=f.length;h<g;h++){var D=f[h];Pe(D,d.length),d=d[D]}return d},n.prototype.set=function(f,s,d){if(!Oe(f))throw new TypeError("Array expected");if(f.length<this._size.length)throw new he(f.length,this._size.length,"<");var h,g,D,A=f.map(function(v){return v+1});c(this,A,d);var p=this._data;for(h=0,g=f.length-1;h<g;h++)D=f[h],Pe(D,p.length),p=p[D];return D=f[f.length-1],Pe(D,p.length),p[D]=s,this};function r(f,s){if(!bu(s))throw new TypeError("Invalid index");var d=s.isScalar();if(d)return f.get(s.min());var h=s.size();if(h.length!==f._size.length)throw new he(h.length,f._size.length);for(var g=s.min(),D=s.max(),A=0,p=f._size.length;A<p;A++)Pe(g[A],f._size[A]),Pe(D[A],f._size[A]);return new n(i(f._data,s,h.length,0),f._datatype)}function i(f,s,d,h){var g=h===d-1,D=s.dimension(h);return g?D.map(function(A){return Pe(A,f.length),f[A]}).valueOf():D.map(function(A){Pe(A,f.length);var p=f[A];return i(p,s,d,h+1)}).valueOf()}function u(f,s,d,h){if(!s||s.isIndex!==!0)throw new TypeError("Invalid index");var g=s.size(),D=s.isScalar(),A;if(Bt(d)?(A=d.size(),d=d.valueOf()):A=mt(d),D){if(A.length!==0)throw new TypeError("Scalar expected");f.set(s.min(),d,h)}else{if(!Gt(A,g))try{A.length===0?d=Vu([d],g):d=Vu(d,g),A=mt(d)}catch(S){}if(g.length<f._size.length)throw new he(g.length,f._size.length,"<");if(A.length<g.length){for(var p=0,v=0;g[p]===1&&A[p]===1;)p++;for(;g[p]===1;)v++,p++;d=Xf(d,g.length,v,A)}if(!Gt(g,A))throw new he(g,A,">");var m=s.max().map(function(S){return S+1});c(f,m,h);var C=g.length,E=0;o(f._data,s,d,C,E)}return f}function o(f,s,d,h,g){var D=g===h-1,A=s.dimension(g);D?A.forEach(function(p,v){Pe(p),f[p]=d[v[0]]}):A.forEach(function(p,v){Pe(p),o(f[p],s,d[v[0]],h,g+1)})}n.prototype.resize=function(f,s,d){if(!jr(f))throw new TypeError("Array or Matrix expected");var h=f.valueOf().map(D=>Array.isArray(D)&&D.length===1?D[0]:D),g=d?this.clone():this;return a(g,h,s)};function a(f,s,d){if(s.length===0){for(var h=f._data;Oe(h);)h=h[0];return h}return f._size=s.slice(0),f._data=$u(f._data,f._size,d),f}n.prototype.reshape=function(f,s){var d=s?this.clone():this;d._data=ku(d._data,f);var h=d._size.reduce((g,D)=>g*D);return d._size=Tu(f,h),d};function c(f,s,d){for(var h=f._size.slice(0),g=!1;h.length<s.length;)h.push(0),g=!0;for(var D=0,A=s.length;D<A;D++)s[D]>h[D]&&(h[D]=s[D],g=!0);g&&a(f,h,d)}n.prototype.clone=function(){var f=new n({data:yt(this._data),size:yt(this._size),datatype:this._datatype});return f},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(f){var s=this,d=m0(f),h=function A(p,v){return Oe(p)?p.map(function(m,C){return A(m,v.concat(C))}):d===1?f(p):d===2?f(p,v):f(p,v,s)},g=h(this._data,[]),D=this._datatype!==void 0?Lr(g,$r):void 0;return new n(g,D)},n.prototype.forEach=function(f){var s=this,d=function h(g,D){Oe(g)?g.forEach(function(A,p){h(A,D.concat(p))}):f(g,D,s)};d(this._data,[])},n.prototype[Symbol.iterator]=function*(){var f=function*s(d,h){if(Oe(d))for(var g=0;g<d.length;g++)yield*s(d[g],h.concat(g));else yield{value:d,index:h}};yield*f(this._data,[])},n.prototype.rows=function(){var f=[],s=this.size();if(s.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var d=this._data;for(var h of d)f.push(new n([h],this._datatype));return f},n.prototype.columns=function(){var f=this,s=[],d=this.size();if(d.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var h=this._data,g=function(p){var v=h.map(m=>[m[p]]);s.push(new n(v,f._datatype))},D=0;D<d[1];D++)g(D);return s},n.prototype.toArray=function(){return yt(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(f){return vt(this._data,f)},n.prototype.toString=function(){return vt(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(f){if(f){if(Ke(f)&&(f=f.toNumber()),!ve(f)||!He(f))throw new TypeError("The parameter k must be an integer number")}else f=0;for(var s=f>0?f:0,d=f<0?-f:0,h=this._size[0],g=this._size[1],D=Math.min(h-d,g-s),A=[],p=0;p<D;p++)A[p]=this._data[p+d][p+s];return new n({data:A,size:[D],datatype:this._datatype})},n.diagonal=function(f,s,d,h){if(!Oe(f))throw new TypeError("Array expected, size parameter");if(f.length!==2)throw new Error("Only two dimensions matrix are supported");if(f=f.map(function(N){if(Ke(N)&&(N=N.toNumber()),!ve(N)||!He(N)||N<1)throw new Error("Size values must be positive integers");return N}),d){if(Ke(d)&&(d=d.toNumber()),!ve(d)||!He(d))throw new TypeError("The parameter k must be an integer number")}else d=0;var g=d>0?d:0,D=d<0?-d:0,A=f[0],p=f[1],v=Math.min(A-D,p-g),m;if(Oe(s)){if(s.length!==v)throw new Error("Invalid value array length");m=function($){return s[$]}}else if(Bt(s)){var C=s.size();if(C.length!==1||C[0]!==v)throw new Error("Invalid matrix length");m=function($){return s.get([$])}}else m=function(){return s};h||(h=Ke(m(0))?m(0).mul(0):0);var E=[];if(f.length>0){E=$u(E,f,h);for(var S=0;S<v;S++)E[S+D][S+g]=m(S)}return new n({data:E,size:[A,p]})},n.fromJSON=function(f){return new n(f)},n.prototype.swapRows=function(f,s){if(!ve(f)||!He(f)||!ve(s)||!He(s))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Pe(f,this._size[0]),Pe(s,this._size[0]),n._swapRows(f,s,this._data),this},n._swapRows=function(f,s,d){var h=d[f];d[f]=d[s],d[s]=h};function l(f){return Bt(f)?l(f.valueOf()):Oe(f)?f.map(l):f}return n},{isClass:!0}),fo="equalScalar";_e(fo,["typed","config"],e=>{var{typed:t,config:n}=e;return t(fo,{"number, number":function(i,u){return Uf(i,u,n.epsilon)}})});function Qt(e,t,n,r){if(!(this instanceof Qt))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(r!=null?"-"+r:"")+" expected)",this.stack=new Error().stack}Qt.prototype=new Error,Qt.prototype.constructor=Error,Qt.prototype.name="ArgumentsError",Qt.prototype.isArgumentsError=!0;var lo="format",b0=["typed"],E0=_e(lo,b0,e=>{var{typed:t}=e;return t(lo,{any:vt,"any, Object | function | number":vt})}),ho="bin",F0=["typed","format"];_e(ho,F0,e=>{var{typed:t,format:n}=e;return t(ho,{"number | BigNumber":function(i){return n(i,{notation:"bin"})},"number | BigNumber, number":function(i,u){return n(i,{notation:"bin",wordSize:u})}})});var po="oct",_0=["typed","format"];_e(po,_0,e=>{var{typed:t,format:n}=e;return t(po,{"number | BigNumber":function(i){return n(i,{notation:"oct"})},"number | BigNumber, number":function(i,u){return n(i,{notation:"oct",wordSize:u})}})});var go="hex",B0=["typed","format"];_e(go,B0,e=>{var{typed:t,format:n}=e;return t(go,{"number | BigNumber":function(i){return n(i,{notation:"hex"})},"number | BigNumber, number":function(i,u){return n(i,{notation:"hex",wordSize:u})}})});var Do="equal";_e(Do,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(Do,{"any, any":function(i,u){return i===null?u===null:u===null?i===null:i===void 0?u===void 0:u===void 0?i===void 0:n(i,u)}})});var yo="unequal";_e(yo,["typed","equalScalar"],e=>{var{typed:t,equalScalar:n}=e;return t(yo,{"any, any":function(i,u){return i===null?u!==null:u===null?i!==null:i===void 0?u!==void 0:u===void 0?i!==void 0:!n(i,u)}})});var vo={exports:{}};(function(e){(function(t,n,r){function i(c){var l=this,f=a();l.next=function(){var s=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=s-(l.c=s|0)},l.c=1,l.s0=f(" "),l.s1=f(" "),l.s2=f(" "),l.s0-=f(c),l.s0<0&&(l.s0+=1),l.s1-=f(c),l.s1<0&&(l.s1+=1),l.s2-=f(c),l.s2<0&&(l.s2+=1),f=null}function u(c,l){return l.c=c.c,l.s0=c.s0,l.s1=c.s1,l.s2=c.s2,l}function o(c,l){var f=new i(c),s=l&&l.state,d=f.next;return d.int32=function(){return f.next()*4294967296|0},d.double=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.quick=d,s&&(typeof s=="object"&&u(s,f),d.state=function(){return u(f,{})}),d}function a(){var c=4022871197,l=function(f){f=String(f);for(var s=0;s<f.length;s++){c+=f.charCodeAt(s);var d=.02519603282416938*c;c=d>>>0,d-=c,d*=c,c=d>>>0,d-=c,c+=d*4294967296}return(c>>>0)*23283064365386963e-26};return l}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(tt,e,!1)})(vo);var mo={exports:{}};(function(e){(function(t,n,r){function i(a){var c=this,l="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var s=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^s^s>>>8},a===(a|0)?c.x=a:l+=a;for(var f=0;f<l.length+64;f++)c.x^=l.charCodeAt(f)|0,c.next()}function u(a,c){return c.x=a.x,c.y=a.y,c.z=a.z,c.w=a.w,c}function o(a,c){var l=new i(a),f=c&&c.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,h=(l.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&u(f,l),s.state=function(){return u(l,{})}),s}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(tt,e,!1)})(mo);var wo={exports:{}};(function(e){(function(t,n,r){function i(a){var c=this,l="";c.next=function(){var s=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(s^s<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,a===(a|0)?c.x=a:l+=a;for(var f=0;f<l.length+64;f++)c.x^=l.charCodeAt(f)|0,f==l.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function u(a,c){return c.x=a.x,c.y=a.y,c.z=a.z,c.w=a.w,c.v=a.v,c.d=a.d,c}function o(a,c){var l=new i(a),f=c&&c.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,h=(l.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&u(f,l),s.state=function(){return u(l,{})}),s}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(tt,e,!1)})(wo);var Ao={exports:{}};(function(e){(function(t,n,r){function i(a){var c=this;c.next=function(){var f=c.x,s=c.i,d,h;return d=f[s],d^=d>>>7,h=d^d<<24,d=f[s+1&7],h^=d^d>>>10,d=f[s+3&7],h^=d^d>>>3,d=f[s+4&7],h^=d^d<<7,d=f[s+7&7],d=d^d<<13,h^=d^d<<9,f[s]=h,c.i=s+1&7,h};function l(f,s){var d,h=[];if(s===(s|0))h[0]=s;else for(s=""+s,d=0;d<s.length;++d)h[d&7]=h[d&7]<<15^s.charCodeAt(d)+h[d+1&7]<<13;for(;h.length<8;)h.push(0);for(d=0;d<8&&h[d]===0;++d);for(d==8?h[7]=-1:h[d],f.x=h,f.i=0,d=256;d>0;--d)f.next()}l(c,a)}function u(a,c){return c.x=a.x.slice(),c.i=a.i,c}function o(a,c){a==null&&(a=+new Date);var l=new i(a),f=c&&c.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,h=(l.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},s.int32=l.next,s.quick=s,f&&(f.x&&u(f,l),s.state=function(){return u(l,{})}),s}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(tt,e,!1)})(Ao);var Co={exports:{}};(function(e){(function(t,n,r){function i(a){var c=this;c.next=function(){var f=c.w,s=c.X,d=c.i,h,g;return c.w=f=f+1640531527|0,g=s[d+34&127],h=s[d=d+1&127],g^=g<<13,h^=h<<17,g^=g>>>15,h^=h>>>12,g=s[d]=g^h,c.i=d,g+(f^f>>>16)|0};function l(f,s){var d,h,g,D,A,p=[],v=128;for(s===(s|0)?(h=s,s=null):(s=s+"\0",h=0,v=Math.max(v,s.length)),g=0,D=-32;D<v;++D)s&&(h^=s.charCodeAt((D+32)%s.length)),D===0&&(A=h),h^=h<<10,h^=h>>>15,h^=h<<4,h^=h>>>13,D>=0&&(A=A+1640531527|0,d=p[D&127]^=h+A,g=d==0?g+1:0);for(g>=128&&(p[(s&&s.length||0)&127]=-1),g=127,D=4*128;D>0;--D)h=p[g+34&127],d=p[g=g+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,p[g]=h^d;f.w=A,f.X=p,f.i=g}l(c,a)}function u(a,c){return c.i=a.i,c.w=a.w,c.X=a.X.slice(),c}function o(a,c){a==null&&(a=+new Date);var l=new i(a),f=c&&c.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,h=(l.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},s.int32=l.next,s.quick=s,f&&(f.X&&u(f,l),s.state=function(){return u(l,{})}),s}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(tt,e,!1)})(Co);var bo={exports:{}};(function(e){(function(t,n,r){function i(a){var c=this,l="";c.next=function(){var s=c.b,d=c.c,h=c.d,g=c.a;return s=s<<25^s>>>7^d,d=d-h|0,h=h<<24^h>>>8^g,g=g-s|0,c.b=s=s<<20^s>>>12^d,c.c=d=d-h|0,c.d=h<<16^d>>>16^g,c.a=g-s|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,a===Math.floor(a)?(c.a=a/4294967296|0,c.b=a|0):l+=a;for(var f=0;f<l.length+20;f++)c.b^=l.charCodeAt(f)|0,c.next()}function u(a,c){return c.a=a.a,c.b=a.b,c.c=a.c,c.d=a.d,c}function o(a,c){var l=new i(a),f=c&&c.state,s=function(){return(l.next()>>>0)/4294967296};return s.double=function(){do var d=l.next()>>>11,h=(l.next()>>>0)/4294967296,g=(d+h)/(1<<21);while(g===0);return g},s.int32=l.next,s.quick=s,f&&(typeof f=="object"&&u(f,l),s.state=function(){return u(l,{})}),s}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(tt,e,!1)})(bo);var Eo={exports:{}};(function(e){(function(t,n,r){var i=256,u=6,o=52,a="random",c=r.pow(i,u),l=r.pow(2,o),f=l*2,s=i-1,d;function h(C,E,S){var N=[];E=E==!0?{entropy:!0}:E||{};var $=p(A(E.entropy?[C,m(n)]:C==null?v():C,3),N),z=new g(N),V=function(){for(var O=z.g(u),j=c,G=0;O<l;)O=(O+G)*i,j*=i,G=z.g(1);for(;O>=f;)O/=2,j/=2,G>>>=1;return(O+G)/j};return V.int32=function(){return z.g(4)|0},V.quick=function(){return z.g(4)/4294967296},V.double=V,p(m(z.S),n),(E.pass||S||function(O,j,G,X){return X&&(X.S&&D(X,z),O.state=function(){return D(z,{})}),G?(r[a]=O,j):O})(V,$,"global"in E?E.global:this==r,E.state)}function g(C){var E,S=C.length,N=this,$=0,z=N.i=N.j=0,V=N.S=[];for(S||(C=[S++]);$<i;)V[$]=$++;for($=0;$<i;$++)V[$]=V[z=s&z+C[$%S]+(E=V[$])],V[z]=E;(N.g=function(O){for(var j,G=0,X=N.i,Y=N.j,L=N.S;O--;)j=L[X=s&X+1],G=G*i+L[s&(L[X]=L[Y=s&Y+j])+(L[Y]=j)];return N.i=X,N.j=Y,G})(i)}function D(C,E){return E.i=C.i,E.j=C.j,E.S=C.S.slice(),E}function A(C,E){var S=[],N=typeof C,$;if(E&&N=="object")for($ in C)try{S.push(A(C[$],E-1))}catch(z){}return S.length?S:N=="string"?C:C+"\0"}function p(C,E){for(var S=C+"",N,$=0;$<S.length;)E[s&$]=s&(N^=E[s&$]*19)+S.charCodeAt($++);return m(E)}function v(){try{var C;return d&&(C=d.randomBytes)?C=C(i):(C=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(C)),m(C)}catch(N){var E=t.navigator,S=E&&E.plugins;return[+new Date,t,S,t.screen,m(n)]}}function m(C){return String.fromCharCode.apply(0,C)}if(p(r.random(),n),e.exports){e.exports=h;try{d=kn.default}catch(C){}}else r["seed"+a]=h})(typeof self!="undefined"?self:tt,[],Math)})(Eo);var S0=vo.exports,M0=mo.exports,N0=wo.exports,I0=Ao.exports,x0=Co.exports,O0=bo.exports,Rt=Eo.exports;Rt.alea=S0,Rt.xor128=M0,Rt.xorwow=N0,Rt.xorshift7=I0,Rt.xor4096=x0,Rt.tychei=O0,Rn("fineStructure",.0072973525693),Rn("weakMixingAngle",.2229),Rn("efimovFactor",22.7),Rn("sackurTetrode",-1.16487052358);function Rn(e,t){var n=["config","BigNumber"];return _e(e,n,r=>{var{config:i,BigNumber:u}=r;return i.number==="BigNumber"?new u(t):t})}var R0=c0({config:Fu}),P0=d0({}),j0=g0({}),$0=v0({}),k0=C0({Matrix:$0}),T0=dl({BigNumber:R0,Complex:P0,DenseMatrix:k0,Fraction:j0}),q0=E0({typed:T0});class U0{constructor(t){this.calcControls=[],this.dependenciesTriggerMap=new Map,this.hideNotRememberControlIds=[],this.dontHasPermissionControlIds=[],this.cacheComputedResult={},this.options=t,this.getDontHasPermissionControlIds(),this.getNeedHideRememberControlIds()}getNeedHideRememberControlIds(){var t;!((t=this.options)!=null&&t.displayBoList)||(this.hideNotRememberControlIds=this.options.displayBoList.reduce((n,r)=>(r.is_remember||n.push(...r.hide_controls),n),[]))}getDontHasPermissionControlIds(){var t;!((t=this.options)!=null&&t.behavior)||(this.dontHasPermissionControlIds=this.options.behavior.reduce((n,r)=>(r.ctrlBehavior===1&&n.push(r.ctrlId),n),[]))}controlNeedComputedValue(t){if(!t)return!1;const n=this.getControlIsHide(t);return!(this.dontHasPermissionControlIds.includes(t.id)&&n||this.hideNotRememberControlIds.includes(t.id)&&n)}getControlIsHide(t){return t.props.isHide?!0:t.parent===null||t.parent===void 0?!1:this.getControlIsHide(t.parent)}apply(t){this.engine=t,this.watchControlChange(),this.watchSubtableChange(),this.watchSchemaHideChange(),this.engine.on("engine-mounted",()=>{requestAnimationFrame(()=>{this.resetDependencies(),this.allCalcControlComputed()})})}resetDependencies(){this.calcControls=[],this.dependenciesTriggerMap.clear(),this.getAllCalcControl(),this.getCalcDependencies()}allCalcControlComputed(){this.calcControls.forEach(t=>{(t.props.dataBind.result.fieldCode===null||t.props.dataBind.result.fieldCode===void 0)&&this.computedCalcValue(t)})}getAllCalcControl(){this.calcControls=this.engine.runtime.flatInstances.filter(t=>t.type===re.CALC)}getCalcDependencies(){this.calcControls.forEach(t=>{const{scriptEcho:n}=t.props;n.forEach(r=>{(r.type===Ce.VariableInMainTable||r.type===Ce.VariableInCurrentSubTable||r.type===Ce.VariableInOtherSubTable)&&this.setDependenciesTriggerMapItem(r.id,t),r.type===Ce.VariableInOtherSubTable&&r.subTableId&&this.setDependenciesTriggerMapItem(r.subTableId,t)})})}setDependenciesTriggerMapItem(t,n){this.dependenciesTriggerMap.has(t)||this.dependenciesTriggerMap.set(t,[]);const r=this.dependenciesTriggerMap.get(t);r.includes(n)||r.push(n)}getCalcControlsFromSubtableRows(t){return t.reduce((n,r)=>(r.children.forEach(i=>{const u=i.children[0];u&&this.engine.assertInstance(u,re.CALC)&&n.push(u)}),n),[])}watchSchemaHideChange(){this.engine.on("schema-change",t=>{var n;t.props==="isHide"&&((n=this.dependenciesTriggerMap.get(t.instance.id))!=null?n:[]).forEach(i=>{this.computedCalcValue(i)})})}watchSubtableChange(){this.engine.on("list-change",t=>{var u,o,a;if(this.engine.isMounted===!1)return;this.resetDependencies();const n=(o=(u=t.options)==null?void 0:u.changed)!=null?o:[];this.getCalcControlsFromSubtableRows(n).forEach(c=>{this.computedCalcValue(c)}),((a=this.dependenciesTriggerMap.get(t.instance.id))!=null?a:[]).forEach(c=>{this.computedCalcValue(c)})})}watchControlChange(){this.engine.on("change",t=>{var i;if(this.engine.isMounted===!1)return;const{instance:n}=t;if(!this.dependenciesTriggerMap.has(n.id))return;const r=(i=this.dependenciesTriggerMap.get(n.id))!=null?i:[];t.rowIndex!==void 0&&t.rowIndex>-1?r.forEach(u=>{this.controlInSubtable(u)&&this.engine.getInstanceRowIndex(u)!==t.rowIndex||this.computedCalcValue(u)}):r.forEach(u=>{this.computedCalcValue(u)})})}controlInSubtable(t){var n;return((n=t.parent)==null?void 0:n.type)===re.SUBTABLE_COLUMN}computedCalcValue(t){var c;const n=t.props.scriptEcho;if(!n||n.length===0)return;let r;this.controlInSubtable(t)&&(r=this.engine.getInstanceRowIndex(t));const i=n.reduce((l,f)=>{if(f.type===Ce.Operator||f.type===Ce.Number)return l+f.name;let s=0,d;switch(f.type){case Ce.VariableInMainTable:{const h=this.getNumberValue(this.engine.getState(f.id));d=this.engine.getInstance(f.id),s=Number(h);break}case Ce.VariableInCurrentSubTable:{d=this.engine.getInstance(f.id,r);const h=this.engine.getState(f.id,r),g=this.getNumberValue(h);s=Number(g);break}case Ce.VariableInOtherSubTable:{const h=this.engine.getState(f.id),g=Array.isArray(h)?h.map(A=>this.getNumberValue(A)):[],D=this.getAggregateTypeValue(g,f.aggregateType);d=this.engine.getInstance(f.subTableId),s=Number(D);break}}return!Number.isNaN(s)&&this.controlNeedComputedValue(d)?l+=`(${s})`:l+=0,l},"");let u;if(this.cacheComputedResult[i]!==void 0?u=this.cacheComputedResult[i]:(u=Number(q0(new Function(`return ${i}`)(),{precision:16})),this.cacheComputedResult[i]=u),this.controlInSubtable(t)&&r===void 0)return;const o=this.engine.getState(t.id,r),a=!u||u===1/0||u===-1/0?0:t.props.precision===""?u:Number(u.toFixed(t.props.precision));a!==(o==null?void 0:o.result)&&this.engine.setState(t.id,{result:a,unit:(c=o==null?void 0:o.unit)!=null?c:""},r)}getNumberValue(t){if(typeof t=="object"&&t){if("result"in t)return t.result;if("amount"in t)return t.amount}return typeof t=="number"?t:0}getAggregateTypeValue(t,n){if(!n||!t||!t.length)return 0;switch(n){case et.MAX:return Math.max(...t);case et.MIN:return Math.min(...t);case et.SUM:return t.reduce((r,i)=>r+i);case et.AVG:return t.reduce((r,i)=>r+i)/t.length}}}class L0{constructor(t,n=!0){this.config=t,this.isPc=n}apply(t){var o,a;this.engine=t;const n=(a=(o=this.config)==null?void 0:o.source)!=null?a:"";let r=document.createElement("style");r.className="edit-css-"+t.id;let i=document.querySelector("head");i==null||i.appendChild(r);let u;this.isPc?u=`[data-engine-id='${t.id}']{ ${n} }`:u=n,r.appendChild(document.createTextNode(u))}}Z.CalcPlugin=U0,Z.ControlsEventPlugin=nf,Z.ES6ModulePlugin=Yc,Z.Engine=Pr,Z.LifecycleEventPlugin=tf,Z.Plugin=Qc,Z.StylePlugin=L0,Z.buildUUID=Zt,Z.hasChildrenControl=vn,Z.loopDataViewControl=Dt,Z.loopFormControl=gt,Z.parseModule=vu,Object.defineProperty(Z,"__esModule",{value:!0})});