@wibetter/json-utils 5.0.2 → 5.0.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.
@@ -1 +1,4713 @@
1
- import{cloneDeep as e,isEqual as t}from"lodash";function r(t){return e(t)}function i(e,r){return t(e,r)}function a(e){var t=!1;return null!=e&&(t=!0),t}function o(e,t,i){var a=t;if(i&&(a=r(t)),e)for(var o=e.split("-"),n=0,p=o.length;n<p;n++){var l=o[n];l&&(a=a&&a[l])}return a}function n(e,t,i){var a=t;if(i&&(a=r(t)),e)for(var o=e.split("-"),n=0,p=o.length;n<p;n++){var l=o[n];if("0"!==l||"array"!==a.format&&"radio"!==a.format&&"single-select"!==a.format&&"select"!==a.format||!a.items){if(l){var d="0";if(a.propertyOrder)d=a.propertyOrder[l];else if(a.properties){d=Object.keys(a.properties)[l]}a=a.properties[d]}}else a=a.items}return a}function p(e,t,i){var a=t;if(i&&(a=r(t)),e&&a)for(var o=e.split("-"),n=0,p=o.length;n<p;n++){var l=o[n];l&&a.properties&&(a=a.properties[l])}return a}function l(e,t){for(var r=t,i="",a=e.split("-"),o=0,n=a.length;o<n;o++){var p=a[o];if("0"===p&&r.items)r=r.items,i=i?i+"-items":"items";else if(p){var l="0";if(r.propertyOrder)l=r.propertyOrder[p];else if(r.properties){l=Object.keys(r.properties)[p]}r=r.properties[l],i=i?i+"-"+l:l}}return i}function d(e,t){for(var r=t,i="",a=e.split("-"),o=0,n=a.length;o<n;o++){var p=a[o];if(p){var l=-1;if(r.propertyOrder)l=r.propertyOrder.indexOf(p),r=r.properties[p];else if(r.properties){l=Object.keys(r.properties).indexOf(p),r=r.properties[p]}else r.items&&(l=0,r=r.items);i=i?i+"-"+l:l.toString()}}return i}var u={type:"object",format:"event",title:"事件",isRequired:!1,readOnly:!1,properties:{type:{type:"string",default:"emit",format:"typeSelect",enum:["on","emit"],enumextra:["on","emit"],title:"事件类型",isRequired:!1,readOnly:!1},trigger:{type:"string",format:"input",default:"eventName",title:"触发事件",description:"用于输入触发事件的名称",placeholder:"请输入触发事件的名称",isRequired:!1,readOnly:!1},eventData:{type:"string",title:"事件数据",format:"json",default:"{}",description:"传递给触发事件的数据对象",isRequired:!1,readOnly:!1}},required:["type","trigger","eventData"],propertyOrder:["type","trigger","eventData"]},s={type:"object",format:"datasource",title:"数据源",readOnly:!1,properties:{type:{type:"string",default:"local",format:"typeSelect",enum:["local","remote"],enumextra:["local","remote"],title:"数据源类型"},data:{type:"string",title:"本地json数据",placeholder:"请输入静态json数据",format:"json",default:"{}",description:"用于设置本地的静态json数据",isRequired:!0},filter:{type:"string",title:"过滤器",format:"codearea",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},required:["type","data","filter"],propertyOrder:["type","data","filter"]},f={type:"local",config:{dataName:"",body:{},filter:"return data;"},data:"{}",localFilter:"return data;"},c={jsonschema:{type:"object",title:"jsonSchemaObject",properties:{func:{type:"object",format:"func",title:"功能设置",readOnly:!0,properties:{a:{type:"string",title:"单文本框",format:"input",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1}},required:["a"],propertyOrder:["a"]},style:{type:"object",format:"style",title:"样式设置",readOnly:!0,properties:{b:{type:"string",title:"单文本框",format:"input",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1}},required:["b"],propertyOrder:["b"]},data:{type:"object",format:"data",title:"数据设置",readOnly:!0,properties:{c:{type:"string",title:"单文本框",format:"input",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1}},required:["c"],propertyOrder:["c"]}},required:["func","style","data"],propertyOrder:["func","style","data"]},input:{type:"string",title:"单文本框",format:"input",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},boolean:{type:"boolean",title:"布尔值",format:"boolean",default:!1,description:"",isRequired:!1,readOnly:!1},object:{type:"object",format:"object",title:"对象Object",description:"",isRequired:!1,readOnly:!1,properties:{a:{type:"string",title:"单文本框",format:"input",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1}},required:["a"],propertyOrder:["a"]},array:{type:"array",format:"array",title:"数组Array",description:"",isRequired:!1,readOnly:!1,items:{type:"object",format:"object",title:"数组项",description:"",isRequired:!1,readOnly:!1,properties:{name:{type:"string",format:"input",title:"名字",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1}},required:["name"],propertyOrder:["name"]}},"empty-array":{type:"array",format:"array",title:"数组Array",description:"",items:{type:"object",format:"object",title:"数组项",description:"",properties:{}}},"empty-object":{type:"object",format:"object",title:"对象Object",description:"",properties:{}},url:{type:"string",title:"链接地址url",format:"url",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},textarea:{type:"string",title:"多行文本框",format:"textarea",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},color:{type:"string",title:"颜色color",format:"color",default:"#ffffff",description:"",isRequired:!1,readOnly:!1},image:{type:"string",title:"图片",format:"image",default:"",description:"上传图片",imgWidth:200,imgHeight:200,imgRatioReadOnly:!0,templateId:"",isRequired:!1},number:{type:"number",title:"数量number",format:"number",default:1,minimum:0,maximum:1e3,description:"",isRequired:!1,readOnly:!1},json:{type:"string",title:"json数据",format:"json",default:"{}",description:"",isRequired:!1,readOnly:!1},codearea:{type:"string",title:"函数类型",format:"codearea",placeholder:"请输入函数方法",default:'function func() { console.log("hello, world!"); }',description:"用于定义函数方法",isRequired:!1,readOnly:!1},htmlarea:{type:"string",title:"富文本",format:"htmlarea",placeholder:"请输入html代码片段",default:"<p>hello,world!</p>",description:"用于放置html代码片段",isRequired:!1,readOnly:!1},"text-editor":{type:"string",title:"富文本",format:"text-editor",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},date:{type:"string",title:"日期Date",format:"date",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},"date-time":{type:"string",title:"日期时间",format:"date-time",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},time:{type:"string",title:"时间Time",format:"time",default:"",description:"",placeholder:"",isRequired:!1,readOnly:!1},quantity:{type:"object",format:"quantity",title:"单位计量",isRequired:!1,readOnly:!1,properties:{unit:{type:"number",title:"单位数值",format:"number",default:50,minimum:0,maximum:1e3,description:"",isRequired:!1,readOnly:!1},quantity:{type:"string",format:"typeSelect",default:"px",enum:["px","rem","em","%"],enumextra:["px","rem","em","%"],title:"单位类型",isRequired:!1,readOnly:!1}},required:["unit","quantity"],propertyOrder:["unit","quantity"]},"box-style":{type:"object",format:"box-style",title:"盒子模型",isRequired:!1,readOnly:!1,properties:{unit:{type:"string",title:"单位数值",format:"string",default:"0",description:"",isRequired:!1,readOnly:!1},quantity:{type:"string",format:"typeSelect",default:"px",enum:["px","rem","em","%"],enumextra:["px","rem","em","%"],title:"单位类型",isRequired:!1,readOnly:!1}},required:["unit","quantity"],propertyOrder:["unit","quantity"]},radio:{type:"string",title:"单选",format:"radio",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:"",isRequired:!1,readOnly:!1},"single-select":{type:"string",title:"下拉单选",format:"single-select",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:"",isRequired:!1,readOnly:!1},select:{type:"array",title:"多选",format:"select",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:"",isRequired:!1,readOnly:!1},"dynamic-data":{type:"object",format:"dynamic-data",title:"动态数据源",readOnly:!1,properties:{type:{type:"string",default:"local",format:"typeSelect",enum:["local","remote"],enumextra:["本地数据","接口数据"],title:"数据类型"},config:{type:"object",title:"接口配置",format:"object",description:"用于存放接口的配置数据(url、请求参数等)",isRequired:!0,properties:{dataName:{type:"string",default:"local",format:"typeSelect",enum:["local","remote"],enumextra:["本地数据","接口数据"],title:"数据类型"},body:{type:"object",title:"请求参数配置",format:"object",description:"用于配置当前接口的请求参数数值",isRequired:!0},filter:{type:"string",title:"过滤器函数体",format:"codearea",default:"return data;",description:"用于定义过滤接口数据",isRequired:!0}},required:["dataName","body","filter"],propertyOrder:["dataName","body","filter"]},data:{type:"string",title:"数据内容",format:"json",default:"{}",description:"用于存放DynamicData的数据内容",isRequired:!0},localFilter:{type:"string",title:"过滤器",format:"codearea",default:"return data;",description:"用于定义过滤本地数据",isRequired:!0}},required:["type","config","data","localFilter"],propertyOrder:["type","config","data","localFilter"]},datasource:s,event:u,widget:{type:"string",title:"内嵌组件数据",format:"widget",default:"{}",description:"用于存放内嵌组件的渲染相关数据",isRequired:!1,readOnly:!0}},y={on:{type:"object",format:"event",title:"事件",isRequired:!1,readOnly:!1,properties:{type:{type:"string",default:"on",format:"typeSelect",enum:["on","emit"],enumextra:["on","emit"],title:"事件类型",isRequired:!1,readOnly:!1},register:{type:"string",format:"input",default:"eventName",title:"注册事件",description:"用于输入注册事件的名称",placeholder:"请输入注册事件的名称",isRequired:!1,readOnly:!1},actionFunc:{type:"string",title:"执行函数",format:"codearea",default:"() => {}",description:"",isRequired:!1,readOnly:!1}},required:["type","register","actionFunc"],propertyOrder:["type","register","actionFunc"]},emit:u},m={local:s,remote:{type:"object",format:"datasource",title:"数据源",readOnly:!1,properties:{type:{type:"string",default:"remote",format:"typeSelect",enum:["local","remote"],enumextra:["local","remote"],title:"数据源类型"},data:{type:"string",title:"远程json数据",placeholder:"请输入远程json数据源地址",format:"url",default:"http://xxx",isRequired:!0,description:"用于设置获取元素数据的请求地址"},filter:{type:"string",title:"过滤器",format:"codearea",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},required:["type","data","filter"],propertyOrder:["type","data","filter"]}};function g(e){return/^http[s]?:\/\/.*/.test(e)}function v(e){return"String"===Object.prototype.toString.call(e).slice(8,-1)}function b(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function O(e){return"Boolean"===Object.prototype.toString.call(e).slice(8,-1)}function j(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function q(e){return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e)||/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)}function h(e){return/^\d{2}:\d{2}:\d{2}$/.test(e)||/^\d{2}:\d{2}$/.test(e)}function x(e){var t=!1;return"Array"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function R(e){if(!x(e))return!1;for(var t=0,r=e.length;t<r;t++){if(!v(e[t]))return!1}return!0}function N(e){var t=!1;return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function S(e){var t=!1;return c.quantity.properties.quantity.enum.indexOf(e)>=0&&(t=!0),t}function F(e){return/^#[0-9a-f]{6}$/.test(e)||/^#[0-9a-f]{3}$/.test(e)}function k(e){var t=!1;return"Function"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function D(e){var t={};return t=e&&N(e)?function(e){var t;if(N(e)){var i=Object.keys(e);e.data&&e.filter&&2===i.length?t=x(e.data)||N(e.data)?r(m.local):r(m.remote):e.trigger&&e.eventData&&2===i.length?t=r(y.emit):e.register&&e.actionFunc&&2===i.length?t=r(y.on):e.quantity&&S(e.quantity)&&2===i.length?t=r(c.quantity):(t=r(c["empty-object"]),Object.keys(e).map((function(r){var i=e[r];t.properties[r]=D(i)})))}return t}(e):e&&x(e)?function(e){var t;if(e&&x(e))if(R(e)){(t=r(c.select)).items.enum=e;var i=t.items.enumextra.length,a=e.length;if(a>i)for(var o=i,n=a;o<n;o++)t.items.enumextra.push("选项"+e(o))}else{t=r(c["empty-array"]);var p=D(e[0]);t.items.properties=p.properties}return t}(e):function(e){var t="";if(O(e))t=r(c.boolean);else if(b(e))t=r(c.number);else if(g(e))t=r(c.url);else if(j(e))t=r(c.date);else if(q(e))t=r(c["date-time"]);else if(h(e))t=r(c.time);else if(F(e))t=r(c.color);else try{t=b(JSON.parse(e))?r(c.input):r(c.json)}catch(i){t=e&&e.length>30?r(c.textarea):r(c.input)}return t}(e),t}function w(e){var t=e&&e.format;return t||(t=e&&e.type?e.type:"input"),t}function $(e){var t=!0;if(!e)return t;var r=w(e);return("object"===r&&e.properties&&e.propertyOrder&&e.propertyOrder.length>0||"array"===r&&e.items&&e.items.properties&&e.items.propertyOrder&&e.items.propertyOrder.length>0||e.type&&"array"!==e.type&&"object"!==e.type||e.format)&&(t=!1),t}function J(e){var t=!0;if(e&&("object"===w(e)&&e.properties&&e.propertyOrder&&e.propertyOrder.length>0)){var r=e.properties.func||{},i=e.properties.style||{},a=e.properties.data||{};(r.propertyOrder&&r.propertyOrder.length>0||i.propertyOrder&&i.propertyOrder.length>0||a.propertyOrder&&a.propertyOrder.length>0)&&(t=!1)}return t}function T(e){var t=!1;e&&("object"===w(e)&&e.properties&&e.propertyOrder&&e.properties.func&&e.properties.style&&e.properties.data&&(t=!0));return t}function A(e){var t=!1,r=e.lastUpdateTime,i=new Date("2020-07-29T07:30:00.691Z").getTime();return r&&new Date(r).getTime()>=i&&(t=!0),t}function U(e){var t=!1;return"object"!==e&&"func"!==e&&"style"!==e&&"data"!==e&&"widgets"!==e&&"func-schema"!==e&&"style-schema"!==e&&"data-schema"!==e&&"event-schema"!==e&&"widgets-schema"!==e||(t=!0),t}function I(e){var t=!1;return"func"!==e&&"style"!==e&&"data"!==e&&"props"!==e&&"event-schema"!==e&&"widgets"!==e||(t=!0),t}function W(e){var t=!0;return"object"===(e.type||w(e))&&e.propertyOrder&&e.properties?e.propertyOrder.map((function(r){var i=e.properties[r];"object"===(e.type||w(i))&&i.propertyOrder&&i.properties||(t=!1)})):t=!1,t}function B(e,t){var r=e.split("-"),i=t.split("-");return r.pop(),i.pop(),r.join("-")===i.join("-")}function E(e,t){for(var r=e.split("-"),i=t.split("-"),a="before",o=0,n=(r.length>i.length?i:r).length;o<n;o+=1){Number(r[o])>Number(i[o])&&(a="after")}return a}function H(e){var t=e.split("-");return t.pop(),t.join("-")}function L(e){var t=e.split("-"),r=t.pop(),i=Number(r)+1;return t.push(""+i),t.join("-")}function Z(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}function z(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)-1),t.join("-")}function C(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)+1),t.join("-")}function G(e,t){var r=t||{};if(N(e)&&"object"===e.type&&e.properties){(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(t){var i=e.properties[t];r=K(i,r)}))}return r}function K(e,t){var r=!t,i=t||{};if(e&&"{}"!==JSON.stringify(e)){var a=w(e);"object"===a||"func"===a||"style"===a||"data"===a?(!r&&i.object?i.object+=1:r||(i.object=1),i=G(e,i)):"array"===a?(!r&&i.array?i.array+=1:r||(i.array=1),i=G(e=e.items,i)):!r&&i[a]?i[a]+=1:r||(i[a]=1)}return i}function M(e){var t=r(e);if(!t.title&&t.description&&(t.title=t.description),t.format||(t.format=w(t)),"quantity"!==t.format&&"array"!==t.format&&"datasource"!==t.format&&"event"!==t.format&&"object"!==t.format&&"radio"!==t.format&&"select"!==t.format||!a(t.default)||delete t.default,"radio"===t.format&&(t.type="string",t.enum&&t.enumextra&&(t.items={type:"string",enum:r(t.enum),enumextra:r(t.enumextra)},delete t.enum,delete t.enumextra)),"quantity"===t.format){var i=t.properties,o=r(c.quantity);if(i.quantity&&N(i.quantity)&&i.quantity.default){var n=i.quantity.default;o.properties.quantity.default="percent"===n?"%":n}t=o}if("datasource"===t.format){var p=t.properties,l=p.type&&p.type.default,d=p.data&&p.data.default,u=p.filter&&p.filter.default;"local"===l?(t=r(m.local)).properties.data.default=d?r(d):"{}":(t=r(m.remote)).properties.data.default=d?r(d):"http://xxx",t.properties.filter.default=u?r(u):"() => {}"}if("event"===t.format){var s=t.properties,f=s.type&&s.type.default;if("in"===f||"on"===f){var g=s.filter&&s.filter.default||"() => {}";t=r(y.on),s.actionFunc&&N(s.actionFunc)&&(t.properties.actionFunc.default=s.actionFunc.default||r(g))}else{var v=s.filter&&s.filter.default||"{}";t=r(y.emit),s.eventData&&N(s.eventData)&&(t.properties.eventData.default=s.eventData.default||r(v))}}return t.properties&&(t.required=Object.keys(t.properties),t.propertyOrder||(t.propertyOrder=t.required),t.propertyOrder.map((function(e){t.properties[e]=M(t.properties[e])}))),t.items&&(t.items=M(t.items)),t}function P(e,t){var r="",i=t;a(i)&&a(e.default)&&typeof i!=typeof e.default&&(i=void 0);var o=a(i)?i:e.default;switch(e.type){case"string":if("typeSelect"===e.format)r=e.default;else if("color"===e.format)"#fff"!==o&&"#FFF"!==o||(o="#ffffff"),r=o||"#ffffff";else if("json"===e.format||"widget"===e.format){var n="";if(N(t)||x(t))n=t;else if(k(t)||""===t)n={};else try{n=JSON.parse(t)}catch(e){n={}}r=n}else r=a(o)?o:"";break;case"boolean":r=!!a(o)&&o;break;case"number":r=a(o)?o:1;break;default:r=a(o)?o:""}return r}function Q(e,t){var i={},o=w(e);if(N(e)&&"object"===e.type){var n=e,p=t;a(p)&&a(n.default)&&typeof p!=typeof n.default&&(p=void 0);var l=a(p)?p:n.default;if("dynamic-data"===o)i=r(f),l&&N(l)&&"{}"!==JSON.stringify(l)&&(i=Object.assign(i,l));else if("datasource"===o)n.properties&&n.properties.type&&n.properties.type.default&&"local"===n.properties.type.default?(i={data:"{}",filter:"() => {}"},l&&l.data&&(i.data=l.data),l&&l.filter&&(i.filter=l.filter),"http://xxx"===i.data&&(i.data="{}")):(i={data:"http://xxx",filter:"() => {}"},l&&l.data&&(i.data=l.data),l&&l.filter&&(i.filter=l.filter),"{}"===i.data&&(i.data="http://xxx"));else if("event"===o)n.properties&&n.properties.type&&n.properties.type.default&&"emit"===n.properties.type.default?l&&"out"===l.type?i={trigger:l&&l.filter||"eventName",eventData:"{}"}:(i={trigger:"eventName",eventData:"{}"},l&&l.trigger&&(i.trigger=l.trigger),l&&l.eventData&&(i.eventData=l.eventData)):l&&"in"===l.type?i={register:"eventName",actionFunc:l&&l.filter||"() => {}"}:(i={register:"eventName",actionFunc:"() => {}"},l&&l.register&&(i.register=l.register),l&&l.actionFunc&&(i.actionFunc=l.actionFunc));else if(e.properties){(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(r){var a=e.properties[r],o=t&&t[r];switch(a.type){case"array":i[r]=V(a,o);break;case"object":i[r]=Q(a,o);break;default:i[r]=P(a,o)}}))}}return i}function V(e,t){var r=[];if(e&&"array"===e.type){var i=t;a(i)&&a(e.default)&&typeof i!=typeof e.default&&(i=void 0);var o=a(i)?i:e.default;if("array"===e.format)if(x(o))o.map((function(t){r.push(Q(e.items,t))}));else{var n=Q(e.items,o);r.push(n)}else r=a(o)?o:[]}return r}function X(e,t){return"object"===e.type?Q(e,t):"array"===e.type?V(e,t):P(e,t)}var Y=c;function _(e,t){var r=t||[];if(e&&"{}"!==JSON.stringify(e))if(N(e))if(e.type&&"remote"===e.type&&e.config&&N(e.config)&&e.config.dataName&&a(e.localFilter)&&a(e.data)){var i=e.config.body;if(i&&!N(i))try{i=JSON.parse(i)}catch(e){i={}}r.push({id:e.config.id,dataName:e.config.dataName,body:i})}else{Object.keys(e).map((function(t){_(e[t],r)}))}else x(e)&&e.map((function(e){_(e,r)}));return r}function ee(e,t){var r=t||"data";return e.split("-").map((function(e){r=/^\d+$/.test(e)?r+"["+e+"]":r+"."+e})),r}function te(e,t){var r=[];N(e)?Object.keys(e).map((function(i){var a=e[i],o=t?t+"-"+i:i;N(a)||x(a)?r.push({title:i,value:o,key:o,children:te(a,o)}):r.push({title:i,value:o,key:o})})):x(e)&&e.map((function(e,i){var a=i.toString(),o=t?t+"-"+i:a;N(e)||x(e)?r.push({title:a,value:o,key:o,children:te(e,o)}):r.push({title:a,value:o,key:o})}));return r}function re(e){var t=e.split("-");return t.pop(),t.join("-")}function ie(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}var ae=["key","enum","enumextra","items","input","boolean","number","color","url","textarea","text-editor","radio","single-select","select","date","date-time","time","json","codearea","htmlarea","quantity","box-style","dynamic-data","datasource","event","array","object","widget","widgets","widgetUUID","embedWidgetList"];export{m as DataSourceTypeList,y as EventTypeDataList,ae as KeyWordList,c as TypeDataList,ee as dataRoute2dataPath,_ as dynamicDataAnalyzer,E as getCurPosition,w as getCurrentFormat,o as getJsonDataByKeyRoute,L as getNextIndexRoute,H as getParentIndexRoute,Z as getParentIndexRoute_CurIndex,re as getParentKeyRoute,ie as getParentKeyRoute_CurKey,n as getSchemaByIndexRoute,p as getSchemaByKeyRoute,a as hasProperties,l as indexRoute2keyRoute,x as isArray,O as isBoolean,U as isBoxSchemaData,F as isColor,j as isDateStr,q as isDateTimeStr,$ as isEmptySchema,J as isEmptyWidgetSchema,i as isEqual,I as isFirstSchemaData,k as isFunction,A as isNewSchemaData,b as isNumber,N as isObject,S as isQuantity,B as isSameParent,R as isSelect,v as isString,W as isStructuredSchema,h as isTimeStr,g as isURL,T as isUsedToWidgetConfig,D as json2schema,te as json2treeData,d as keyRoute2indexRoute,K as metaElemAnalyzer,C as moveBackward,z as moveForward,r as objClone,M as oldSchemaToNewSchema,X as schema2json,Y as schemaMetaList};
1
+ import { cloneDeep as e, isEqual as t, truncate as r } from 'lodash';
2
+ function n(t) {
3
+ return e(t);
4
+ }
5
+ function o(e, r) {
6
+ return t(e, r);
7
+ }
8
+ function i(e) {
9
+ var t = !1;
10
+ return null != e && (t = !0), t;
11
+ }
12
+ function a(e, t) {
13
+ return r(e, t);
14
+ }
15
+ function s(e, t, r) {
16
+ var o = t;
17
+ if ((r && (o = n(t)), e))
18
+ for (var i = e.split('-'), a = 0, s = i.length; a < s; a++) {
19
+ var u = i[a];
20
+ u && (o = o && o[u]);
21
+ }
22
+ return o;
23
+ }
24
+ function u(e, t, r) {
25
+ var o = t;
26
+ if ((r && (o = n(t)), e))
27
+ for (var i = e.split('-'), a = 0, s = i.length; a < s; a++) {
28
+ var u = i[a];
29
+ if (
30
+ '0' !== u ||
31
+ ('array' !== o.type &&
32
+ 'radio' !== o.type &&
33
+ 'select' !== o.type &&
34
+ 'checkboxes' !== o.type) ||
35
+ (!o.options && !o.items)
36
+ ) {
37
+ if (u) {
38
+ var c = '0';
39
+ if (o.propertyOrder) c = o.propertyOrder[u];
40
+ else if (o.properties) {
41
+ c = Object.keys(o.properties)[u];
42
+ }
43
+ o = o.properties[c];
44
+ }
45
+ } else o = o.options || o.items;
46
+ }
47
+ return o;
48
+ }
49
+ function c(e, t, r) {
50
+ var o = t;
51
+ if ((r && (o = n(t)), e && o))
52
+ for (var i = e.split('-'), a = 0, s = i.length; a < s; a++) {
53
+ var u = i[a];
54
+ u && o.properties && (o = o.properties[u]);
55
+ }
56
+ return o;
57
+ }
58
+ function l(e, t) {
59
+ for (var r = t, n = '', o = e.split('-'), i = 0, a = o.length; i < a; i++) {
60
+ var s = o[i];
61
+ if ('0' === s && r.items) (r = r.items), (n = n ? n + '-items' : 'items');
62
+ else if ('0' === s && r.options)
63
+ (r = r.options), (n = n ? n + '-options' : 'options');
64
+ else if (s) {
65
+ var u = '0';
66
+ if (r.propertyOrder) u = r.propertyOrder[s];
67
+ else if (r.properties) {
68
+ u = Object.keys(r.properties)[s];
69
+ }
70
+ (r = r.properties[u]), (n = n ? n + '-' + u : u);
71
+ }
72
+ }
73
+ return n;
74
+ }
75
+ function p(e, t) {
76
+ for (var r = t, n = '', o = e.split('-'), i = 0, a = o.length; i < a; i++) {
77
+ var s = o[i];
78
+ if (s) {
79
+ var u = -1;
80
+ if (r.propertyOrder)
81
+ (u = r.propertyOrder.indexOf(s)), (r = r.properties[s]);
82
+ else if (r.properties) {
83
+ (u = Object.keys(r.properties).indexOf(s)), (r = r.properties[s]);
84
+ } else
85
+ r.items
86
+ ? ((u = 0), (r = r.items))
87
+ : r.options && ((u = 0), (r = r.options));
88
+ n = n ? n + '-' + u : u.toString();
89
+ }
90
+ }
91
+ return n;
92
+ }
93
+ var d,
94
+ f = {
95
+ type: 'event',
96
+ title: '事件',
97
+ isContainer: !1,
98
+ properties: {
99
+ type: {
100
+ default: 'emit',
101
+ type: 'select',
102
+ options: [
103
+ { label: 'on', value: 'on' },
104
+ { label: 'emit', value: 'emit' },
105
+ ],
106
+ title: '事件类型',
107
+ },
108
+ trigger: {
109
+ type: 'input',
110
+ default: 'eventName',
111
+ title: '触发事件',
112
+ description: '用于输入触发事件的名称',
113
+ placeholder: '请输入触发事件的名称',
114
+ },
115
+ eventData: {
116
+ title: '事件数据',
117
+ type: 'json',
118
+ default: '{}',
119
+ description: '传递给触发事件的数据对象',
120
+ },
121
+ },
122
+ propertyOrder: ['type', 'trigger', 'eventData'],
123
+ },
124
+ h = {
125
+ type: 'datasource',
126
+ title: '数据源',
127
+ isContainer: !1,
128
+ properties: {
129
+ type: {
130
+ default: 'local',
131
+ type: 'select',
132
+ options: [
133
+ { label: '本地数据', value: 'local' },
134
+ { label: '接口数据', value: 'remote' },
135
+ ],
136
+ title: '数据源类型',
137
+ },
138
+ data: {
139
+ title: '本地json数据',
140
+ placeholder: '请输入静态json数据',
141
+ type: 'json',
142
+ default: '{}',
143
+ description: '用于设置本地的静态json数据',
144
+ isRequired: !0,
145
+ },
146
+ filter: {
147
+ title: '过滤器',
148
+ type: 'codearea',
149
+ default: '() => {}',
150
+ description: '用于定义过滤当前数据的函数',
151
+ isRequired: !0,
152
+ },
153
+ },
154
+ propertyOrder: ['type', 'data', 'filter'],
155
+ },
156
+ v =
157
+ (((d = { type: 'object' }).type = 'datasource'),
158
+ (d.title = '数据源'),
159
+ (d.isContainer = !1),
160
+ (d.properties = {
161
+ type: {
162
+ type: 'select',
163
+ default: 'remote',
164
+ options: [
165
+ { label: '本地数据', value: 'local' },
166
+ { label: '接口数据', value: 'remote' },
167
+ ],
168
+ title: '数据源类型',
169
+ },
170
+ data: {
171
+ type: 'url',
172
+ title: '远程json数据',
173
+ placeholder: '请输入远程json数据源地址',
174
+ default: 'http://xxx',
175
+ isRequired: !0,
176
+ description: '用于设置获取元素数据的请求地址',
177
+ },
178
+ filter: {
179
+ type: 'codearea',
180
+ title: '过滤器',
181
+ default: '() => {}',
182
+ description: '用于定义过滤当前数据的函数',
183
+ isRequired: !0,
184
+ },
185
+ }),
186
+ (d.propertyOrder = ['type', 'data', 'filter']),
187
+ d),
188
+ y = {
189
+ type: 'local',
190
+ config: { dataName: '', body: {}, filter: 'return data;' },
191
+ data: '{}',
192
+ localFilter: 'return data;',
193
+ },
194
+ b = {
195
+ jsonschema: {
196
+ type: 'object',
197
+ title: 'jsonSchemaObject',
198
+ properties: {
199
+ func: {
200
+ type: 'object',
201
+ title: '功能设置',
202
+ isContainer: !1,
203
+ properties: {
204
+ a: {
205
+ title: '单文本框',
206
+ type: 'input',
207
+ default: '',
208
+ description: '',
209
+ placeholder: '',
210
+ isRequired: !1,
211
+ },
212
+ },
213
+ propertyOrder: ['a'],
214
+ },
215
+ style: {
216
+ type: 'object',
217
+ title: '样式设置',
218
+ isContainer: !1,
219
+ properties: {
220
+ b: {
221
+ title: '单文本框',
222
+ type: 'input',
223
+ default: '',
224
+ description: '',
225
+ placeholder: '',
226
+ },
227
+ },
228
+ propertyOrder: ['b'],
229
+ },
230
+ data: {
231
+ type: 'data',
232
+ title: '数据设置',
233
+ isContainer: !1,
234
+ properties: {
235
+ c: {
236
+ title: '单文本框',
237
+ type: 'input',
238
+ default: '',
239
+ description: '',
240
+ placeholder: '',
241
+ isRequired: !1,
242
+ },
243
+ },
244
+ propertyOrder: ['c'],
245
+ },
246
+ },
247
+ propertyOrder: ['func', 'style', 'data'],
248
+ },
249
+ input: {
250
+ title: '单文本框',
251
+ type: 'input',
252
+ default: '',
253
+ description: '',
254
+ placeholder: '',
255
+ },
256
+ boolean: { type: 'boolean', title: '布尔值', default: !1, description: '' },
257
+ object: {
258
+ type: 'object',
259
+ title: '对象Object',
260
+ description: '',
261
+ properties: {
262
+ a: {
263
+ type: 'input',
264
+ title: '单文本框',
265
+ default: '',
266
+ description: '',
267
+ placeholder: '',
268
+ },
269
+ },
270
+ propertyOrder: ['a'],
271
+ },
272
+ array: {
273
+ type: 'array',
274
+ title: '数组Array',
275
+ description: '',
276
+ default: [],
277
+ items: {
278
+ type: 'object',
279
+ title: '数组项',
280
+ description: '',
281
+ properties: {
282
+ name: {
283
+ type: 'input',
284
+ title: '名字',
285
+ default: '',
286
+ description: '',
287
+ placeholder: '',
288
+ },
289
+ },
290
+ propertyOrder: ['name'],
291
+ },
292
+ },
293
+ 'empty-array': {
294
+ type: 'array',
295
+ title: '数组Array',
296
+ description: '',
297
+ default: [],
298
+ items: {
299
+ type: 'object',
300
+ title: '数组项',
301
+ description: '',
302
+ properties: {},
303
+ },
304
+ },
305
+ 'empty-object': {
306
+ type: 'object',
307
+ title: '对象Object',
308
+ description: '',
309
+ properties: {},
310
+ },
311
+ url: {
312
+ type: 'url',
313
+ title: '链接地址url',
314
+ default: '',
315
+ description: '',
316
+ placeholder: '',
317
+ },
318
+ textarea: {
319
+ type: 'textarea',
320
+ title: '多行文本框',
321
+ default: '',
322
+ description: '',
323
+ placeholder: '',
324
+ },
325
+ color: {
326
+ type: 'color',
327
+ title: '颜色color',
328
+ default: '#ffffff',
329
+ description: '',
330
+ },
331
+ image: {
332
+ title: '图片',
333
+ type: 'image',
334
+ default: '',
335
+ description: '上传图片',
336
+ imgWidth: 200,
337
+ imgHeight: 200,
338
+ imgRatioReadOnly: !0,
339
+ },
340
+ number: {
341
+ type: 'number',
342
+ title: '数量number',
343
+ default: 1,
344
+ minimum: 0,
345
+ maximum: 1e3,
346
+ description: '',
347
+ },
348
+ json: { title: 'json数据', type: 'json', default: '{}', description: '' },
349
+ codearea: {
350
+ type: 'codearea',
351
+ title: '函数类型',
352
+ placeholder: '请输入函数方法',
353
+ default: 'function func() { console.log("hello, world!"); }',
354
+ description: '用于定义函数方法',
355
+ },
356
+ htmlarea: {
357
+ title: '富文本',
358
+ type: 'htmlarea',
359
+ placeholder: '请输入html代码片段',
360
+ default: '<p>hello,world!</p>',
361
+ description: '用于放置html代码片段',
362
+ },
363
+ 'text-editor': {
364
+ type: 'text-editor',
365
+ title: '富文本',
366
+ default: '',
367
+ description: '',
368
+ placeholder: '',
369
+ },
370
+ date: {
371
+ type: 'date',
372
+ title: '日期Date',
373
+ default: '',
374
+ description: '',
375
+ placeholder: '',
376
+ },
377
+ 'date-time': {
378
+ type: 'date-time',
379
+ title: '日期时间',
380
+ default: '',
381
+ description: '',
382
+ placeholder: '',
383
+ },
384
+ time: {
385
+ type: 'time',
386
+ title: '时间Time',
387
+ default: '',
388
+ description: '',
389
+ placeholder: '',
390
+ },
391
+ quantity: {
392
+ type: 'quantity',
393
+ title: '单位计量',
394
+ isContainer: !1,
395
+ properties: {
396
+ unit: {
397
+ type: 'number',
398
+ title: '单位数值',
399
+ default: 50,
400
+ minimum: 0,
401
+ maximum: 1e3,
402
+ description: '',
403
+ },
404
+ quantity: {
405
+ type: 'select',
406
+ default: 'px',
407
+ options: [
408
+ { label: 'px', value: 'px' },
409
+ { label: 'rem', value: 'rem' },
410
+ { label: 'em', value: 'em' },
411
+ { label: '%', value: '%' },
412
+ ],
413
+ title: '单位类型',
414
+ },
415
+ },
416
+ propertyOrder: ['unit', 'quantity'],
417
+ },
418
+ 'box-style': {
419
+ type: 'box-style',
420
+ title: '盒子模型',
421
+ isContainer: !1,
422
+ properties: {
423
+ unit: {
424
+ title: '单位数值',
425
+ type: 'input',
426
+ default: '0',
427
+ description: '',
428
+ },
429
+ quantity: {
430
+ type: 'select',
431
+ default: 'px',
432
+ options: [
433
+ { label: 'px', value: 'px' },
434
+ { label: 'rem', value: 'rem' },
435
+ { label: 'em', value: 'em' },
436
+ { label: '%', value: '%' },
437
+ ],
438
+ title: '单位类型',
439
+ },
440
+ },
441
+ propertyOrder: ['unit', 'quantity'],
442
+ },
443
+ radio: {
444
+ type: 'radio',
445
+ title: '单选',
446
+ options: [
447
+ { label: '选项a', value: 'a' },
448
+ { label: '选项b', value: 'b' },
449
+ { label: '选项c', value: 'c' },
450
+ ],
451
+ default: 'a',
452
+ description: '',
453
+ },
454
+ select: {
455
+ type: 'select',
456
+ title: '下拉选择',
457
+ options: [
458
+ { label: '选项a', value: 'a' },
459
+ { label: '选项b', value: 'b' },
460
+ { label: '选项c', value: 'c' },
461
+ ],
462
+ default: 'a',
463
+ description: '',
464
+ },
465
+ checkboxes: {
466
+ type: 'checkboxes',
467
+ title: '多选',
468
+ options: [
469
+ { label: '选项a', value: 'a' },
470
+ { label: '选项b', value: 'b' },
471
+ { label: '选项c', value: 'c' },
472
+ ],
473
+ default: ['a'],
474
+ description: '',
475
+ },
476
+ 'dynamic-data': {
477
+ type: 'dynamic-data',
478
+ title: '动态数据源',
479
+ isContainer: !1,
480
+ properties: {
481
+ type: {
482
+ default: 'local',
483
+ type: 'select',
484
+ options: [
485
+ { label: '本地数据', value: 'local' },
486
+ { label: '接口数据', value: 'remote' },
487
+ ],
488
+ title: '数据类型',
489
+ },
490
+ config: {
491
+ title: '接口配置',
492
+ type: 'object',
493
+ description: '用于存放接口的配置数据(url、请求参数等)',
494
+ isRequired: !0,
495
+ properties: {
496
+ dataName: {
497
+ default: 'local',
498
+ type: 'select',
499
+ options: [
500
+ { label: '本地数据', value: 'local' },
501
+ { label: '接口数据', value: 'remote' },
502
+ ],
503
+ title: '数据类型',
504
+ },
505
+ body: {
506
+ type: 'object',
507
+ title: '请求参数配置',
508
+ description: '用于配置当前接口的请求参数数值',
509
+ isRequired: !0,
510
+ },
511
+ filter: {
512
+ title: '过滤器函数体',
513
+ type: 'codearea',
514
+ default: 'return data;',
515
+ description: '用于定义过滤接口数据',
516
+ isRequired: !0,
517
+ },
518
+ },
519
+ propertyOrder: ['dataName', 'body', 'filter'],
520
+ },
521
+ data: {
522
+ title: '数据内容',
523
+ type: 'json',
524
+ default: '{}',
525
+ description: '用于存放DynamicData的数据内容',
526
+ isRequired: !0,
527
+ },
528
+ localFilter: {
529
+ title: '过滤器',
530
+ type: 'codearea',
531
+ default: 'return data;',
532
+ description: '用于定义过滤本地数据',
533
+ isRequired: !0,
534
+ },
535
+ },
536
+ propertyOrder: ['type', 'config', 'data', 'localFilter'],
537
+ },
538
+ datasource: h,
539
+ event: f,
540
+ 'dynamic-config': {
541
+ type: 'dynamic-config',
542
+ title: '动态配置',
543
+ description: '',
544
+ isContainer: !1,
545
+ properties: {
546
+ type: {
547
+ type: 'select',
548
+ title: '数据来源',
549
+ options: [
550
+ { label: '模板直接设置', value: 'DevDefaults' },
551
+ { label: 'mp后台配置', value: 'ContentStaticConfig' },
552
+ { label: '内容Meta数据', value: 'Content' },
553
+ { label: '全局配置数据', value: 'RuntimeConst' },
554
+ { label: '资源中心配置', value: 'ResourceCenter' },
555
+ ],
556
+ default: 'DevDefaults',
557
+ isConditionProp: !0,
558
+ description:
559
+ '目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst',
560
+ },
561
+ value: {
562
+ title: '数据值',
563
+ type: 'input',
564
+ default: '',
565
+ description: '',
566
+ placeholder: '',
567
+ },
568
+ description: {
569
+ title: '属性名称',
570
+ type: 'input',
571
+ default: '',
572
+ description: '',
573
+ placeholder: '',
574
+ },
575
+ valueType: {
576
+ type: 'radio',
577
+ title: '配置方式',
578
+ options: [
579
+ { label: '填写', value: 'string' },
580
+ { label: '选择', value: 'select' },
581
+ ],
582
+ default: 'string',
583
+ isConditionProp: !0,
584
+ description: '',
585
+ },
586
+ range: {
587
+ type: 'select',
588
+ title: '可选项',
589
+ multiple: !0,
590
+ options: [],
591
+ description: '这里会使用value中的配置选项作为options',
592
+ },
593
+ },
594
+ propertyOrder: ['type', 'value', 'description', 'valueType', 'range'],
595
+ showCodeViewBtn: !1,
596
+ },
597
+ 'sohu-source': {
598
+ type: 'sohu-source',
599
+ title: '组件动态数据',
600
+ description: '',
601
+ isContainer: !1,
602
+ properties: {
603
+ mainConfig: {
604
+ type: 'object',
605
+ title: '主要配置',
606
+ description: '',
607
+ isContainer: !1,
608
+ properties: {
609
+ type: {
610
+ type: 'select',
611
+ title: '数据来源',
612
+ isConditionProp: !0,
613
+ options: [
614
+ { label: '模板直接配置', value: 'RuntimeDataSelfDefine' },
615
+ { label: 'mp后台配置', value: 'ContentStaticConfig' },
616
+ { label: '请求当前页面数据', value: 'RuntimeDataSelfContent' },
617
+ { label: '资源中心配置', value: 'ResourceCenter' },
618
+ ],
619
+ default: 'ContentStaticConfig',
620
+ description: '',
621
+ },
622
+ description: {
623
+ title: '数据源名称',
624
+ type: 'input',
625
+ default: '',
626
+ description: '',
627
+ placeholder: '',
628
+ },
629
+ dataType: {
630
+ type: 'radio',
631
+ title: '请求方式',
632
+ options: [
633
+ { label: '批量请求', value: 'FROMCIS' },
634
+ { label: '组件内部请求', value: 'FROMCOMPCIS' },
635
+ { label: '不请求', value: 'false' },
636
+ ],
637
+ description: '',
638
+ },
639
+ CONTENTID: {
640
+ title: '数据源ID',
641
+ type: 'input',
642
+ default: '',
643
+ description: '',
644
+ placeholder: '',
645
+ },
646
+ CONTENTTYPE: {
647
+ type: 'select',
648
+ title: '数据源类型',
649
+ options: [
650
+ { label: 'channle', value: 'channle' },
651
+ { label: 'topic', value: 'topic' },
652
+ { label: 'block', value: 'block' },
653
+ ],
654
+ description: '',
655
+ },
656
+ },
657
+ propertyOrder: [
658
+ 'type',
659
+ 'description',
660
+ 'dataType',
661
+ 'CONTENTID',
662
+ 'CONTENTTYPE',
663
+ ],
664
+ showCodeViewBtn: !1,
665
+ },
666
+ outConfig: {
667
+ type: 'object',
668
+ title: '出流配置',
669
+ description: '',
670
+ isContainer: !1,
671
+ properties: {
672
+ PRO: {
673
+ type: 'select',
674
+ title: '内容类型',
675
+ options: [
676
+ { label: '置顶+加精', value: '4' },
677
+ { label: '长效置顶', value: '5' },
678
+ ],
679
+ description: '',
680
+ },
681
+ FEEDTYPE: {
682
+ type: 'select',
683
+ title: '排序类型',
684
+ options: [
685
+ { label: '综合', value: 'XTOPIC_SYNTHETICAL' },
686
+ { label: '最新', value: 'XTOPIC_LATEST' },
687
+ { label: '相关', value: 'XTOPIC_RELATED' },
688
+ ],
689
+ description: '',
690
+ },
691
+ VIEW: {
692
+ type: 'select',
693
+ title: '数据裁剪',
694
+ options: [
695
+ { label: '相关推荐模式', value: 'articleFeedMode' },
696
+ { label: '文字链裁剪方式', value: 'textMode' },
697
+ { label: '短内容摘录方式', value: 'excerptMode' },
698
+ { label: '互动(点赞/评论)裁剪方式', value: 'interactMode' },
699
+ { label: '评论文字链裁剪方式', value: 'commentTextMode' },
700
+ { label: '摘录方式(无点赞)', value: 'excerptCommentMode' },
701
+ { label: '无限流卡片模式', value: 'dynamicFeedMode' },
702
+ { label: '时间线模式', value: 'timeLineMode' },
703
+ { label: '复合内容流模式', value: 'multiFeedMode' },
704
+ { label: '搜狐号推荐模式', value: 'recommendFeedMode' },
705
+ { label: '作者页内容流模式', value: 'operateFeedMode' },
706
+ { label: '标签内容流模式', value: 'tagsFeedMode' },
707
+ { label: '评论链裁剪方式', value: 'commentMode' },
708
+ { label: '标签摘录方式', value: 'excerptTagsMode' },
709
+ { label: '内容流模式', value: 'feedMode' },
710
+ ],
711
+ description: '',
712
+ },
713
+ CONTENTCONTEXT: {
714
+ type: 'select',
715
+ title: 'mKey参数',
716
+ options: [
717
+ {
718
+ label: '作者ID+栏目ID',
719
+ value: 'authorColumnId_${#authorColumnId}',
720
+ },
721
+ {
722
+ label: '账号ID',
723
+ value: 'accountId_${#contentData_account_id}',
724
+ },
725
+ { label: 'mkeyID', value: 'mid_${#mkeyConst_mid}' },
726
+ { label: 'mkey名称', value: 'mname_${#mkeyConst_mname}' },
727
+ {
728
+ label: '城市Code码',
729
+ value: 'cityCode_${#cityInfo_cityCode}',
730
+ },
731
+ { label: '城市名称', value: 'cityName_${#cityInfo_cityName}' },
732
+ {
733
+ label: '焦点城市Code码',
734
+ value: 'focusCityCode_${#focusCityInfo_cityCode}',
735
+ },
736
+ ],
737
+ description: '',
738
+ },
739
+ CONTENTPARAMS: {
740
+ title: '动态参数',
741
+ type: 'json',
742
+ default: '{}',
743
+ description: '请填写JSON格式的参数',
744
+ placeholder: '',
745
+ },
746
+ },
747
+ propertyOrder: [
748
+ 'PRO',
749
+ 'FEEDTYPE',
750
+ 'VIEW',
751
+ 'CONTENTCONTEXT',
752
+ 'CONTENTPARAMS',
753
+ ],
754
+ showCodeViewBtn: !1,
755
+ },
756
+ otherConfig: {
757
+ type: 'object',
758
+ title: '选配内容',
759
+ description: '',
760
+ isContainer: !1,
761
+ properties: {
762
+ SIZE: {
763
+ type: 'number',
764
+ title: '容量',
765
+ default: 1,
766
+ minimum: 0,
767
+ maximum: 1e3,
768
+ description: '',
769
+ },
770
+ TITLE: {
771
+ title: '标题',
772
+ type: 'input',
773
+ default: '',
774
+ description: '',
775
+ placeholder: '',
776
+ },
777
+ CODE: {
778
+ title: 'Code参数',
779
+ type: 'input',
780
+ default: '',
781
+ description: '',
782
+ placeholder: '',
783
+ },
784
+ URL: {
785
+ type: 'url',
786
+ title: '跳转链接',
787
+ default: '',
788
+ description: '',
789
+ placeholder: '',
790
+ },
791
+ },
792
+ propertyOrder: ['SIZE', 'TITLE', 'URL', 'CODE'],
793
+ showCodeViewBtn: !1,
794
+ },
795
+ },
796
+ propertyOrder: ['mainConfig', 'otherConfig', 'outConfig'],
797
+ showCodeViewBtn: !1,
798
+ },
799
+ 'sohu-event': {
800
+ type: 'sohu-event',
801
+ title: 'sohu组件事件',
802
+ showCodeViewBtn: !1,
803
+ isContainer: !1,
804
+ properties: {
805
+ globalEventMap: {
806
+ type: 'object',
807
+ title: '全局事件Map',
808
+ description: '',
809
+ properties: {
810
+ eventCode: {
811
+ type: 'input',
812
+ title: '事件名称',
813
+ default: '',
814
+ description: '',
815
+ placeholder: '',
816
+ readOnly: !0,
817
+ },
818
+ },
819
+ propertyOrder: ['eventCode'],
820
+ showCodeViewBtn: !1,
821
+ },
822
+ event: {
823
+ type: 'array',
824
+ title: '监听事件',
825
+ description: '当前组件监听事件列表',
826
+ default: [],
827
+ items: {
828
+ type: 'object',
829
+ title: '数组项',
830
+ description: '',
831
+ properties: {
832
+ name: {
833
+ type: 'input',
834
+ title: '事件',
835
+ default: '',
836
+ description: '',
837
+ placeholder: '',
838
+ },
839
+ code: {
840
+ title: '事件code',
841
+ type: 'input',
842
+ default: '',
843
+ description: '',
844
+ placeholder: '',
845
+ },
846
+ listenName: {
847
+ title: '事件名称',
848
+ type: 'input',
849
+ default: '',
850
+ description: '',
851
+ placeholder: '',
852
+ },
853
+ desc: {
854
+ title: '事件描述',
855
+ type: 'input',
856
+ default: '',
857
+ description: '',
858
+ placeholder: '',
859
+ },
860
+ },
861
+ propertyOrder: ['name', 'code', 'listenName', 'desc'],
862
+ },
863
+ showCodeViewBtn: !1,
864
+ },
865
+ },
866
+ propertyOrder: ['globalEventMap', 'event'],
867
+ },
868
+ },
869
+ m = {
870
+ on: {
871
+ type: 'event',
872
+ title: '事件',
873
+ isContainer: !1,
874
+ properties: {
875
+ type: {
876
+ default: 'on',
877
+ type: 'select',
878
+ options: [
879
+ { label: 'on', value: 'on' },
880
+ { label: 'emit', value: 'emit' },
881
+ ],
882
+ title: '事件类型',
883
+ },
884
+ register: {
885
+ type: 'input',
886
+ default: 'eventName',
887
+ title: '注册事件',
888
+ description: '用于输入注册事件的名称',
889
+ placeholder: '请输入注册事件的名称',
890
+ },
891
+ actionFunc: {
892
+ title: '执行函数',
893
+ type: 'codearea',
894
+ default: '() => {}',
895
+ description: '',
896
+ },
897
+ },
898
+ propertyOrder: ['type', 'register', 'actionFunc'],
899
+ },
900
+ emit: f,
901
+ },
902
+ g = { local: h, remote: v };
903
+ function O(e) {
904
+ return /^http[s]?:\/\/.*/.test(e);
905
+ }
906
+ function E(e) {
907
+ return 'String' === Object.prototype.toString.call(e).slice(8, -1);
908
+ }
909
+ function N(e) {
910
+ return (
911
+ 'number' == typeof e ||
912
+ '[object Number]' === Object.prototype.toString.call(e)
913
+ );
914
+ }
915
+ function _(e) {
916
+ return 'Boolean' === Object.prototype.toString.call(e).slice(8, -1);
917
+ }
918
+ function w(e) {
919
+ return /^\d{4}-\d{2}-\d{2}$/.test(e);
920
+ }
921
+ function x(e) {
922
+ return (
923
+ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
924
+ /^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
925
+ );
926
+ }
927
+ function j(e) {
928
+ return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
929
+ }
930
+ function S(e) {
931
+ var t = !1;
932
+ return (
933
+ 'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
934
+ );
935
+ }
936
+ function D(e) {
937
+ if (!S(e)) return !1;
938
+ for (var t = 0, r = e.length; t < r; t++) {
939
+ if (!E(e[t])) return !1;
940
+ }
941
+ return !0;
942
+ }
943
+ function A(e) {
944
+ var t = !1;
945
+ return (
946
+ 'Object' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
947
+ );
948
+ }
949
+ function V(e) {
950
+ var t = !1;
951
+ return b.quantity.properties.quantity.enum.indexOf(e) >= 0 && (t = !0), t;
952
+ }
953
+ function C(e) {
954
+ return /^#[0-9a-f]{6}$/.test(e) || /^#[0-9a-f]{3}$/.test(e);
955
+ }
956
+ function T(e) {
957
+ var t = !1;
958
+ return (
959
+ 'Function' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
960
+ );
961
+ }
962
+ function k(e) {
963
+ var t = {};
964
+ return (
965
+ (t =
966
+ e && A(e)
967
+ ? (function (e) {
968
+ var t;
969
+ if (A(e)) {
970
+ var r = Object.keys(e);
971
+ e.data && e.filter && 2 === r.length
972
+ ? (t = S(e.data) || A(e.data) ? n(g.local) : n(g.remote))
973
+ : e.trigger && e.eventData && 2 === r.length
974
+ ? (t = n(m.emit))
975
+ : e.register && e.actionFunc && 2 === r.length
976
+ ? (t = n(m.on))
977
+ : e.quantity && V(e.quantity) && 2 === r.length
978
+ ? (t = n(b.quantity))
979
+ : ((t = n(b['empty-object'])),
980
+ Object.keys(e).map(function (r) {
981
+ var n = e[r];
982
+ t.properties[r] = k(n);
983
+ }));
984
+ }
985
+ return t;
986
+ })(e)
987
+ : e && S(e)
988
+ ? (function (e) {
989
+ var t;
990
+ if (e && S(e))
991
+ if (D(e)) {
992
+ (t = n(b.select)).items.enum = e;
993
+ var r = t.items.enumextra.length,
994
+ o = e.length;
995
+ if (o > r)
996
+ for (var i = r, a = o; i < a; i++)
997
+ t.items.enumextra.push('选项' + e(i));
998
+ } else {
999
+ t = n(b['empty-array']);
1000
+ var s = k(e[0]);
1001
+ t.items.properties = s.properties;
1002
+ }
1003
+ return t;
1004
+ })(e)
1005
+ : (function (e) {
1006
+ var t = '';
1007
+ if (_(e)) t = n(b.boolean);
1008
+ else if (N(e)) t = n(b.number);
1009
+ else if (O(e)) t = n(b.url);
1010
+ else if (w(e)) t = n(b.date);
1011
+ else if (x(e)) t = n(b['date-time']);
1012
+ else if (j(e)) t = n(b.time);
1013
+ else if (C(e)) t = n(b.color);
1014
+ else
1015
+ try {
1016
+ t = N(JSON.parse(e)) ? n(b.input) : n(b.json);
1017
+ } catch (r) {
1018
+ t = e && e.length > 30 ? n(b.textarea) : n(b.input);
1019
+ }
1020
+ return t;
1021
+ })(e)),
1022
+ t
1023
+ );
1024
+ }
1025
+ function R(e, t) {
1026
+ var r = t || {};
1027
+ if (A(e) && 'object' === getExpectType(e.type) && e.properties) {
1028
+ (e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
1029
+ function (t) {
1030
+ var n = e.properties[t];
1031
+ r = P(n, r);
1032
+ },
1033
+ );
1034
+ }
1035
+ return r;
1036
+ }
1037
+ function P(e, t) {
1038
+ var r = !t,
1039
+ n = t || {};
1040
+ if (e && '{}' !== JSON.stringify(e)) {
1041
+ var o = e.type;
1042
+ 'object' === o || 'func' === o || 'style' === o || 'data' === o
1043
+ ? (!r && n.object ? (n.object += 1) : r || (n.object = 1), (n = R(e, n)))
1044
+ : 'array' === o
1045
+ ? (!r && n.array ? (n.array += 1) : r || (n.array = 1),
1046
+ (n = R((e = e.items), n)))
1047
+ : !r && n[o]
1048
+ ? (n[o] += 1)
1049
+ : r || (n[o] = 1);
1050
+ }
1051
+ return n;
1052
+ }
1053
+ function I(e) {
1054
+ var t = n(e);
1055
+ if (
1056
+ (!t.title && t.description && (t.title = t.description),
1057
+ t.type || (t.type = t.format),
1058
+ ('quantity' !== t.type &&
1059
+ 'array' !== t.type &&
1060
+ 'datasource' !== t.type &&
1061
+ 'event' !== t.type &&
1062
+ 'object' !== t.type) ||
1063
+ !i(t.default) ||
1064
+ delete t.default,
1065
+ 'radio' === t.type &&
1066
+ ((t.type = 'string'),
1067
+ t.enum &&
1068
+ t.enumextra &&
1069
+ ((t.items = {
1070
+ type: 'string',
1071
+ enum: n(t.enum),
1072
+ enumextra: n(t.enumextra),
1073
+ }),
1074
+ delete t.enum,
1075
+ delete t.enumextra)),
1076
+ 'quantity' === t.type)
1077
+ ) {
1078
+ var r = t.properties,
1079
+ o = n(b.quantity);
1080
+ if (r.quantity && A(r.quantity) && r.quantity.default) {
1081
+ var a = r.quantity.default;
1082
+ o.properties.quantity.default = 'percent' === a ? '%' : a;
1083
+ }
1084
+ t = o;
1085
+ }
1086
+ if ('datasource' === t.type) {
1087
+ var s = t.properties,
1088
+ u = s.type && s.type.default,
1089
+ c = s.data && s.data.default,
1090
+ l = s.filter && s.filter.default;
1091
+ 'local' === u
1092
+ ? ((t = n(g.local)).properties.data.default = c ? n(c) : '{}')
1093
+ : ((t = n(g.remote)).properties.data.default = c ? n(c) : 'http://xxx'),
1094
+ (t.properties.filter.default = l ? n(l) : '() => {}');
1095
+ }
1096
+ if ('event' === t.type) {
1097
+ var p = t.properties,
1098
+ d = p.type && p.type.default;
1099
+ if ('in' === d || 'on' === d) {
1100
+ var f = (p.filter && p.filter.default) || '() => {}';
1101
+ (t = n(m.on)),
1102
+ p.actionFunc &&
1103
+ A(p.actionFunc) &&
1104
+ (t.properties.actionFunc.default = p.actionFunc.default || n(f));
1105
+ } else {
1106
+ var h = (p.filter && p.filter.default) || '{}';
1107
+ (t = n(m.emit)),
1108
+ p.eventData &&
1109
+ A(p.eventData) &&
1110
+ (t.properties.eventData.default = p.eventData.default || n(h));
1111
+ }
1112
+ }
1113
+ return (
1114
+ t.properties &&
1115
+ (t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
1116
+ t.propertyOrder.map(function (e) {
1117
+ t.properties[e] = M(t.properties[e]);
1118
+ })),
1119
+ t.items && (t.items = M(t.items)),
1120
+ t
1121
+ );
1122
+ }
1123
+ function M(e) {
1124
+ var t = n(e);
1125
+ return (
1126
+ t.required || delete t.required,
1127
+ t.type && t.type && (t.type = t.type),
1128
+ ('quantity' !== t.type &&
1129
+ 'array' !== t.type &&
1130
+ 'datasource' !== t.type &&
1131
+ 'event' !== t.type &&
1132
+ 'object' !== t.type) ||
1133
+ !i(t.default) ||
1134
+ delete t.default,
1135
+ ('radio' !== t.type && 'checkboxes' !== t.type && 'select' !== t.type) ||
1136
+ (t.items &&
1137
+ t.items.enum &&
1138
+ t.items.enumextra &&
1139
+ ((t.options = []),
1140
+ t.items.enum.forEach(function (e, r) {
1141
+ t.options.push({ label: t.items.enumextra[r] || e, value: e });
1142
+ }),
1143
+ delete t.items)),
1144
+ t.properties &&
1145
+ (t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
1146
+ t.propertyOrder.map(function (e) {
1147
+ t.properties[e] = M(t.properties[e]);
1148
+ })),
1149
+ 'array' === t.type && t.items && (t.items = M(t.items)),
1150
+ t
1151
+ );
1152
+ }
1153
+ var L = [];
1154
+ Object.freeze(L);
1155
+ var B = {};
1156
+ function q() {
1157
+ return ++ut.mobxGuid;
1158
+ }
1159
+ function U(e) {
1160
+ throw (G(!1, e), 'X');
1161
+ }
1162
+ function G(e, t) {
1163
+ if (!e)
1164
+ throw new Error(
1165
+ '[mobx] ' +
1166
+ (t ||
1167
+ 'An invariant failed, however the error is obfuscated because this is a production build.'),
1168
+ );
1169
+ }
1170
+ function F(e) {
1171
+ var t = !1;
1172
+ return function () {
1173
+ if (!t) return (t = !0), e.apply(this, arguments);
1174
+ };
1175
+ }
1176
+ Object.freeze(B);
1177
+ var K = function () {};
1178
+ function z(e) {
1179
+ return null !== e && 'object' == typeof e;
1180
+ }
1181
+ function J(e) {
1182
+ if (null === e || 'object' != typeof e) return !1;
1183
+ var t = Object.getPrototypeOf(e);
1184
+ return t === Object.prototype || null === t;
1185
+ }
1186
+ function H(e, t, r) {
1187
+ Object.defineProperty(e, t, {
1188
+ enumerable: !1,
1189
+ writable: !0,
1190
+ configurable: !0,
1191
+ value: r,
1192
+ });
1193
+ }
1194
+ function W(e, t) {
1195
+ var r = Object.getOwnPropertyDescriptor(e, t);
1196
+ return !r || (!1 !== r.configurable && !1 !== r.writable);
1197
+ }
1198
+ function $(e, t) {
1199
+ var r = 'isMobX' + e;
1200
+ return (
1201
+ (t.prototype[r] = !0),
1202
+ function (e) {
1203
+ return z(e) && !0 === e[r];
1204
+ }
1205
+ );
1206
+ }
1207
+ function X(e) {
1208
+ return e instanceof Map;
1209
+ }
1210
+ function Y(e) {
1211
+ return e instanceof Set;
1212
+ }
1213
+ function Z(e) {
1214
+ var t = new Set();
1215
+ for (var r in e) t.add(r);
1216
+ return (
1217
+ Object.getOwnPropertySymbols(e).forEach(function (r) {
1218
+ Object.getOwnPropertyDescriptor(e, r).enumerable && t.add(r);
1219
+ }),
1220
+ Array.from(t)
1221
+ );
1222
+ }
1223
+ function Q(e) {
1224
+ return e && e.toString ? e.toString() : new String(e).toString();
1225
+ }
1226
+ function ee(e) {
1227
+ return null === e ? null : 'object' == typeof e ? '' + e : e;
1228
+ }
1229
+ var te =
1230
+ 'undefined' != typeof Reflect && Reflect.ownKeys
1231
+ ? Reflect.ownKeys
1232
+ : Object.getOwnPropertySymbols
1233
+ ? function (e) {
1234
+ return Object.getOwnPropertyNames(e).concat(
1235
+ Object.getOwnPropertySymbols(e),
1236
+ );
1237
+ }
1238
+ : Object.getOwnPropertyNames,
1239
+ re = Symbol('mobx administration'),
1240
+ ne = (function () {
1241
+ function e(e) {
1242
+ void 0 === e && (e = 'Atom@' + q()),
1243
+ (this.name = e),
1244
+ (this.isPendingUnobservation = !1),
1245
+ (this.isBeingObserved = !1),
1246
+ (this.observers = new Set()),
1247
+ (this.diffValue = 0),
1248
+ (this.lastAccessedBy = 0),
1249
+ (this.lowestObserverState = ke.NOT_TRACKING);
1250
+ }
1251
+ return (
1252
+ (e.prototype.onBecomeObserved = function () {
1253
+ this.onBecomeObservedListeners &&
1254
+ this.onBecomeObservedListeners.forEach(function (e) {
1255
+ return e();
1256
+ });
1257
+ }),
1258
+ (e.prototype.onBecomeUnobserved = function () {
1259
+ this.onBecomeUnobservedListeners &&
1260
+ this.onBecomeUnobservedListeners.forEach(function (e) {
1261
+ return e();
1262
+ });
1263
+ }),
1264
+ (e.prototype.reportObserved = function () {
1265
+ return ht(this);
1266
+ }),
1267
+ (e.prototype.reportChanged = function () {
1268
+ dt(),
1269
+ (function (e) {
1270
+ if (e.lowestObserverState === ke.STALE) return;
1271
+ (e.lowestObserverState = ke.STALE),
1272
+ e.observers.forEach(function (t) {
1273
+ t.dependenciesState === ke.UP_TO_DATE &&
1274
+ (t.isTracing !== Re.NONE && vt(t, e), t.onBecomeStale()),
1275
+ (t.dependenciesState = ke.STALE);
1276
+ });
1277
+ })(this),
1278
+ ft();
1279
+ }),
1280
+ (e.prototype.toString = function () {
1281
+ return this.name;
1282
+ }),
1283
+ e
1284
+ );
1285
+ })(),
1286
+ oe = $('Atom', ne);
1287
+ function ie(e, t, r) {
1288
+ void 0 === t && (t = K), void 0 === r && (r = K);
1289
+ var n,
1290
+ o = new ne(e);
1291
+ return t !== K && Vt('onBecomeObserved', o, t, n), r !== K && At(o, r), o;
1292
+ }
1293
+ var ae = {
1294
+ identity: function (e, t) {
1295
+ return e === t;
1296
+ },
1297
+ structural: function (e, t) {
1298
+ return gr(e, t);
1299
+ },
1300
+ default: function (e, t) {
1301
+ return Object.is(e, t);
1302
+ },
1303
+ shallow: function (e, t) {
1304
+ return gr(e, t, 1);
1305
+ },
1306
+ },
1307
+ se = function (e, t) {
1308
+ return (
1309
+ (se =
1310
+ Object.setPrototypeOf ||
1311
+ ({ __proto__: [] } instanceof Array &&
1312
+ function (e, t) {
1313
+ e.__proto__ = t;
1314
+ }) ||
1315
+ function (e, t) {
1316
+ for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
1317
+ }),
1318
+ se(e, t)
1319
+ );
1320
+ };
1321
+ /*! *****************************************************************************
1322
+ Copyright (c) Microsoft Corporation. All rights reserved.
1323
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
1324
+ this file except in compliance with the License. You may obtain a copy of the
1325
+ License at http://www.apache.org/licenses/LICENSE-2.0
1326
+
1327
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1328
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
1329
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
1330
+ MERCHANTABLITY OR NON-INFRINGEMENT.
1331
+
1332
+ See the Apache Version 2.0 License for specific language governing permissions
1333
+ and limitations under the License.
1334
+ ***************************************************************************** */ var ue =
1335
+ function () {
1336
+ return (
1337
+ (ue =
1338
+ Object.assign ||
1339
+ function (e) {
1340
+ for (var t, r = 1, n = arguments.length; r < n; r++)
1341
+ for (var o in (t = arguments[r]))
1342
+ Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
1343
+ return e;
1344
+ }),
1345
+ ue.apply(this, arguments)
1346
+ );
1347
+ };
1348
+ function ce(e) {
1349
+ var t = 'function' == typeof Symbol && e[Symbol.iterator],
1350
+ r = 0;
1351
+ return t
1352
+ ? t.call(e)
1353
+ : {
1354
+ next: function () {
1355
+ return (
1356
+ e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }
1357
+ );
1358
+ },
1359
+ };
1360
+ }
1361
+ function le(e, t) {
1362
+ var r = 'function' == typeof Symbol && e[Symbol.iterator];
1363
+ if (!r) return e;
1364
+ var n,
1365
+ o,
1366
+ i = r.call(e),
1367
+ a = [];
1368
+ try {
1369
+ for (; (void 0 === t || t-- > 0) && !(n = i.next()).done; ) a.push(n.value);
1370
+ } catch (e) {
1371
+ o = { error: e };
1372
+ } finally {
1373
+ try {
1374
+ n && !n.done && (r = i.return) && r.call(i);
1375
+ } finally {
1376
+ if (o) throw o.error;
1377
+ }
1378
+ }
1379
+ return a;
1380
+ }
1381
+ function pe() {
1382
+ for (var e = [], t = 0; t < arguments.length; t++)
1383
+ e = e.concat(le(arguments[t]));
1384
+ return e;
1385
+ }
1386
+ var de = Symbol('mobx did run lazy initializers'),
1387
+ fe = Symbol('mobx pending decorators'),
1388
+ he = {},
1389
+ ve = {};
1390
+ function ye(e) {
1391
+ var t, r;
1392
+ if (!0 !== e[de]) {
1393
+ var n = e[fe];
1394
+ if (n) {
1395
+ H(e, de, !0);
1396
+ var o = pe(Object.getOwnPropertySymbols(n), Object.keys(n));
1397
+ try {
1398
+ for (var i = ce(o), a = i.next(); !a.done; a = i.next()) {
1399
+ var s = n[a.value];
1400
+ s.propertyCreator(
1401
+ e,
1402
+ s.prop,
1403
+ s.descriptor,
1404
+ s.decoratorTarget,
1405
+ s.decoratorArguments,
1406
+ );
1407
+ }
1408
+ } catch (e) {
1409
+ t = { error: e };
1410
+ } finally {
1411
+ try {
1412
+ a && !a.done && (r = i.return) && r.call(i);
1413
+ } finally {
1414
+ if (t) throw t.error;
1415
+ }
1416
+ }
1417
+ }
1418
+ }
1419
+ }
1420
+ function be(e, t) {
1421
+ return function () {
1422
+ var r,
1423
+ n = function (n, o, i, a) {
1424
+ if (!0 === a) return t(n, o, i, n, r), null;
1425
+ if (
1426
+ ('production' === process.env.NODE_ENV ||
1427
+ me(arguments) ||
1428
+ U(
1429
+ "This function is a decorator, but it wasn't invoked like a decorator",
1430
+ ),
1431
+ !Object.prototype.hasOwnProperty.call(n, fe))
1432
+ ) {
1433
+ var s = n[fe];
1434
+ H(n, fe, ue({}, s));
1435
+ }
1436
+ return (
1437
+ (n[fe][o] = {
1438
+ prop: o,
1439
+ propertyCreator: t,
1440
+ descriptor: i,
1441
+ decoratorTarget: n,
1442
+ decoratorArguments: r,
1443
+ }),
1444
+ (function (e, t) {
1445
+ var r = t ? he : ve;
1446
+ return (
1447
+ r[e] ||
1448
+ (r[e] = {
1449
+ configurable: !0,
1450
+ enumerable: t,
1451
+ get: function () {
1452
+ return ye(this), this[e];
1453
+ },
1454
+ set: function (t) {
1455
+ ye(this), (this[e] = t);
1456
+ },
1457
+ })
1458
+ );
1459
+ })(o, e)
1460
+ );
1461
+ };
1462
+ return me(arguments)
1463
+ ? ((r = L), n.apply(null, arguments))
1464
+ : ((r = Array.prototype.slice.call(arguments)), n);
1465
+ };
1466
+ }
1467
+ function me(e) {
1468
+ return (
1469
+ ((2 === e.length || 3 === e.length) &&
1470
+ ('string' == typeof e[1] || 'symbol' == typeof e[1])) ||
1471
+ (4 === e.length && !0 === e[3])
1472
+ );
1473
+ }
1474
+ function ge(e, t, r) {
1475
+ return It(e)
1476
+ ? e
1477
+ : Array.isArray(e)
1478
+ ? Ce.array(e, { name: r })
1479
+ : J(e)
1480
+ ? Ce.object(e, void 0, { name: r })
1481
+ : X(e)
1482
+ ? Ce.map(e, { name: r })
1483
+ : Y(e)
1484
+ ? Ce.set(e, { name: r })
1485
+ : e;
1486
+ }
1487
+ function Oe(e) {
1488
+ return e;
1489
+ }
1490
+ function Ee(e) {
1491
+ G(e);
1492
+ var t = be(!0, function (t, r, n, o, i) {
1493
+ 'production' !== process.env.NODE_ENV &&
1494
+ G(
1495
+ !n || !n.get,
1496
+ '@observable cannot be used on getter (property "' +
1497
+ Q(r) +
1498
+ '"), use @computed instead.',
1499
+ );
1500
+ var a = n ? (n.initializer ? n.initializer.call(t) : n.value) : void 0;
1501
+ ur(t).addObservableProp(r, a, e);
1502
+ }),
1503
+ r =
1504
+ 'undefined' != typeof process &&
1505
+ process.env &&
1506
+ 'production' !== process.env.NODE_ENV
1507
+ ? function () {
1508
+ return arguments.length < 2
1509
+ ? U(
1510
+ "Incorrect decorator invocation. @observable decorator doesn't expect any arguments",
1511
+ )
1512
+ : t.apply(null, arguments);
1513
+ }
1514
+ : t;
1515
+ return (r.enhancer = e), r;
1516
+ }
1517
+ var Ne = { deep: !0, name: void 0, defaultDecorator: void 0, proxy: !0 };
1518
+ function _e(e) {
1519
+ /^(deep|name|equals|defaultDecorator|proxy)$/.test(e) ||
1520
+ U('invalid option for (extend)observable: ' + e);
1521
+ }
1522
+ function we(e) {
1523
+ if (null == e) return Ne;
1524
+ if ('string' == typeof e) return { name: e, deep: !0, proxy: !0 };
1525
+ if ('production' !== process.env.NODE_ENV) {
1526
+ if ('object' != typeof e) return U('expected options object');
1527
+ Object.keys(e).forEach(_e);
1528
+ }
1529
+ return e;
1530
+ }
1531
+ Object.freeze(Ne);
1532
+ var xe = Ee(ge),
1533
+ je = Ee(function (e, t, r) {
1534
+ return null == e || fr(e) || Qt(e) || nr(e) || ar(e)
1535
+ ? e
1536
+ : Array.isArray(e)
1537
+ ? Ce.array(e, { name: r, deep: !1 })
1538
+ : J(e)
1539
+ ? Ce.object(e, void 0, { name: r, deep: !1 })
1540
+ : X(e)
1541
+ ? Ce.map(e, { name: r, deep: !1 })
1542
+ : Y(e)
1543
+ ? Ce.set(e, { name: r, deep: !1 })
1544
+ : U(
1545
+ 'production' !== process.env.NODE_ENV &&
1546
+ 'The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets',
1547
+ );
1548
+ }),
1549
+ Se = Ee(Oe),
1550
+ De = Ee(function (e, t, r) {
1551
+ if ('production' !== process.env.NODE_ENV && It(e))
1552
+ throw 'observable.struct should not be used with observable values';
1553
+ return gr(e, t) ? t : e;
1554
+ });
1555
+ function Ae(e) {
1556
+ return e.defaultDecorator
1557
+ ? e.defaultDecorator.enhancer
1558
+ : !1 === e.deep
1559
+ ? Oe
1560
+ : ge;
1561
+ }
1562
+ var Ve = {
1563
+ box: function (e, t) {
1564
+ arguments.length > 2 && Te('box');
1565
+ var r = we(t);
1566
+ return new tt(e, Ae(r), r.name, !0, r.equals);
1567
+ },
1568
+ array: function (e, t) {
1569
+ arguments.length > 2 && Te('array');
1570
+ var r = we(t);
1571
+ return (function (e, t, r, n) {
1572
+ void 0 === r && (r = 'ObservableArray@' + q());
1573
+ void 0 === n && (n = !1);
1574
+ var o = new $t(r, t, n);
1575
+ (i = o.values),
1576
+ (a = re),
1577
+ (s = o),
1578
+ Object.defineProperty(i, a, {
1579
+ enumerable: !1,
1580
+ writable: !1,
1581
+ configurable: !0,
1582
+ value: s,
1583
+ });
1584
+ var i, a, s;
1585
+ var u = new Proxy(o.values, Wt);
1586
+ if (((o.proxy = u), e && e.length)) {
1587
+ var c = Qe(!0);
1588
+ o.spliceWithArray(0, 0, e), et(c);
1589
+ }
1590
+ return u;
1591
+ })(e, Ae(r), r.name);
1592
+ },
1593
+ map: function (e, t) {
1594
+ arguments.length > 2 && Te('map');
1595
+ var r = we(t);
1596
+ return new rr(e, Ae(r), r.name);
1597
+ },
1598
+ set: function (e, t) {
1599
+ arguments.length > 2 && Te('set');
1600
+ var r = we(t);
1601
+ return new ir(e, Ae(r), r.name);
1602
+ },
1603
+ object: function (e, t, r) {
1604
+ 'string' == typeof arguments[1] && Te('object');
1605
+ var n = we(r);
1606
+ if (!1 === n.proxy) return Ct({}, e, t, n);
1607
+ var o = Tt(n),
1608
+ i = (function (e) {
1609
+ var t = new Proxy(e, Ut);
1610
+ return (e[re].proxy = t), t;
1611
+ })(Ct({}, void 0, void 0, n));
1612
+ return kt(i, e, t, o), i;
1613
+ },
1614
+ ref: Se,
1615
+ shallow: je,
1616
+ deep: xe,
1617
+ struct: De,
1618
+ },
1619
+ Ce = function (e, t, r) {
1620
+ if ('string' == typeof arguments[1] || 'symbol' == typeof arguments[1])
1621
+ return xe.apply(null, arguments);
1622
+ if (It(e)) return e;
1623
+ var n = J(e)
1624
+ ? Ce.object(e, t, r)
1625
+ : Array.isArray(e)
1626
+ ? Ce.array(e, t)
1627
+ : X(e)
1628
+ ? Ce.map(e, t)
1629
+ : Y(e)
1630
+ ? Ce.set(e, t)
1631
+ : e;
1632
+ if (n !== e) return n;
1633
+ U(
1634
+ 'production' !== process.env.NODE_ENV &&
1635
+ "The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'",
1636
+ );
1637
+ };
1638
+ function Te(e) {
1639
+ U(
1640
+ 'Expected one or two arguments to observable.' +
1641
+ e +
1642
+ '. Did you accidentally try to use observable.' +
1643
+ e +
1644
+ ' as decorator?',
1645
+ );
1646
+ }
1647
+ Object.keys(Ve).forEach(function (e) {
1648
+ return (Ce[e] = Ve[e]);
1649
+ });
1650
+ var ke,
1651
+ Re,
1652
+ Pe = be(!1, function (e, t, r, n, o) {
1653
+ 'production' !== process.env.NODE_ENV &&
1654
+ G(
1655
+ r && r.get,
1656
+ "Trying to declare a computed value for unspecified getter '" +
1657
+ Q(t) +
1658
+ "'",
1659
+ );
1660
+ var i = r.get,
1661
+ a = r.set,
1662
+ s = o[0] || {};
1663
+ ur(e).addComputedProp(e, t, ue({ get: i, set: a, context: e }, s));
1664
+ });
1665
+ Pe({ equals: ae.structural }),
1666
+ (function (e) {
1667
+ (e[(e.NOT_TRACKING = -1)] = 'NOT_TRACKING'),
1668
+ (e[(e.UP_TO_DATE = 0)] = 'UP_TO_DATE'),
1669
+ (e[(e.POSSIBLY_STALE = 1)] = 'POSSIBLY_STALE'),
1670
+ (e[(e.STALE = 2)] = 'STALE');
1671
+ })(ke || (ke = {})),
1672
+ (function (e) {
1673
+ (e[(e.NONE = 0)] = 'NONE'),
1674
+ (e[(e.LOG = 1)] = 'LOG'),
1675
+ (e[(e.BREAK = 2)] = 'BREAK');
1676
+ })(Re || (Re = {}));
1677
+ var Ie = function (e) {
1678
+ this.cause = e;
1679
+ };
1680
+ function Me(e) {
1681
+ return e instanceof Ie;
1682
+ }
1683
+ function Le(e) {
1684
+ switch (e.dependenciesState) {
1685
+ case ke.UP_TO_DATE:
1686
+ return !1;
1687
+ case ke.NOT_TRACKING:
1688
+ case ke.STALE:
1689
+ return !0;
1690
+ case ke.POSSIBLY_STALE:
1691
+ for (
1692
+ var t = ze(!0), r = Fe(), n = e.observing, o = n.length, i = 0;
1693
+ i < o;
1694
+ i++
1695
+ ) {
1696
+ var a = n[i];
1697
+ if (nt(a)) {
1698
+ if (ut.disableErrorBoundaries) a.get();
1699
+ else
1700
+ try {
1701
+ a.get();
1702
+ } catch (e) {
1703
+ return Ke(r), Je(t), !0;
1704
+ }
1705
+ if (e.dependenciesState === ke.STALE) return Ke(r), Je(t), !0;
1706
+ }
1707
+ }
1708
+ return He(e), Ke(r), Je(t), !1;
1709
+ }
1710
+ }
1711
+ function Be(e) {
1712
+ var t = e.observers.size > 0;
1713
+ ut.computationDepth > 0 &&
1714
+ t &&
1715
+ U(
1716
+ 'production' !== process.env.NODE_ENV &&
1717
+ 'Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ' +
1718
+ e.name,
1719
+ ),
1720
+ ut.allowStateChanges ||
1721
+ (!t && 'strict' !== ut.enforceActions) ||
1722
+ U(
1723
+ 'production' !== process.env.NODE_ENV &&
1724
+ (ut.enforceActions
1725
+ ? 'Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: '
1726
+ : 'Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ') +
1727
+ e.name,
1728
+ );
1729
+ }
1730
+ function qe(e, t, r) {
1731
+ var n = ze(!0);
1732
+ He(e),
1733
+ (e.newObserving = new Array(e.observing.length + 100)),
1734
+ (e.unboundDepsCount = 0),
1735
+ (e.runId = ++ut.runId);
1736
+ var o,
1737
+ i = ut.trackingDerivation;
1738
+ if (((ut.trackingDerivation = e), !0 === ut.disableErrorBoundaries))
1739
+ o = t.call(r);
1740
+ else
1741
+ try {
1742
+ o = t.call(r);
1743
+ } catch (e) {
1744
+ o = new Ie(e);
1745
+ }
1746
+ return (
1747
+ (ut.trackingDerivation = i),
1748
+ (function (e) {
1749
+ for (
1750
+ var t = e.observing,
1751
+ r = (e.observing = e.newObserving),
1752
+ n = ke.UP_TO_DATE,
1753
+ o = 0,
1754
+ i = e.unboundDepsCount,
1755
+ a = 0;
1756
+ a < i;
1757
+ a++
1758
+ ) {
1759
+ 0 === (s = r[a]).diffValue &&
1760
+ ((s.diffValue = 1), o !== a && (r[o] = s), o++),
1761
+ s.dependenciesState > n && (n = s.dependenciesState);
1762
+ }
1763
+ (r.length = o), (e.newObserving = null), (i = t.length);
1764
+ for (; i--; ) {
1765
+ 0 === (s = t[i]).diffValue && lt(s, e), (s.diffValue = 0);
1766
+ }
1767
+ for (; o--; ) {
1768
+ var s;
1769
+ 1 === (s = r[o]).diffValue && ((s.diffValue = 0), ct(s, e));
1770
+ }
1771
+ n !== ke.UP_TO_DATE && ((e.dependenciesState = n), e.onBecomeStale());
1772
+ })(e),
1773
+ (function (e) {
1774
+ if ('production' === process.env.NODE_ENV) return;
1775
+ if (0 !== e.observing.length) return;
1776
+ (ut.reactionRequiresObservable || e.requiresObservable) &&
1777
+ console.warn(
1778
+ '[mobx] Derivation ' +
1779
+ e.name +
1780
+ ' is created/updated without reading any observable value',
1781
+ );
1782
+ })(e),
1783
+ Je(n),
1784
+ o
1785
+ );
1786
+ }
1787
+ function Ue(e) {
1788
+ var t = e.observing;
1789
+ e.observing = [];
1790
+ for (var r = t.length; r--; ) lt(t[r], e);
1791
+ e.dependenciesState = ke.NOT_TRACKING;
1792
+ }
1793
+ function Ge(e) {
1794
+ var t = Fe();
1795
+ try {
1796
+ return e();
1797
+ } finally {
1798
+ Ke(t);
1799
+ }
1800
+ }
1801
+ function Fe() {
1802
+ var e = ut.trackingDerivation;
1803
+ return (ut.trackingDerivation = null), e;
1804
+ }
1805
+ function Ke(e) {
1806
+ ut.trackingDerivation = e;
1807
+ }
1808
+ function ze(e) {
1809
+ var t = ut.allowStateReads;
1810
+ return (ut.allowStateReads = e), t;
1811
+ }
1812
+ function Je(e) {
1813
+ ut.allowStateReads = e;
1814
+ }
1815
+ function He(e) {
1816
+ if (e.dependenciesState !== ke.UP_TO_DATE) {
1817
+ e.dependenciesState = ke.UP_TO_DATE;
1818
+ for (var t = e.observing, r = t.length; r--; )
1819
+ t[r].lowestObserverState = ke.UP_TO_DATE;
1820
+ }
1821
+ }
1822
+ var We = 0,
1823
+ $e = 1,
1824
+ Xe = Object.getOwnPropertyDescriptor(function () {}, 'name'),
1825
+ Ye = Xe && Xe.configurable;
1826
+ function Ze(e, t, r) {
1827
+ 'production' !== process.env.NODE_ENV &&
1828
+ (G('function' == typeof t, '`action` can only be invoked on functions'),
1829
+ ('string' == typeof e && e) ||
1830
+ U("actions should have valid names, got: '" + e + "'"));
1831
+ var n = function () {
1832
+ return (function (e, t, r, n) {
1833
+ var o = (function (e, t, r) {
1834
+ var n = _t() && !!e,
1835
+ o = 0;
1836
+ if (n && 'production' !== process.env.NODE_ENV) {
1837
+ o = Date.now();
1838
+ var i = (r && r.length) || 0,
1839
+ a = new Array(i);
1840
+ if (i > 0) for (var s = 0; s < i; s++) a[s] = r[s];
1841
+ xt({ type: 'action', name: e, object: t, arguments: a });
1842
+ }
1843
+ var u = Fe();
1844
+ dt();
1845
+ var c = Qe(!0),
1846
+ l = ze(!0),
1847
+ p = {
1848
+ prevDerivation: u,
1849
+ prevAllowStateChanges: c,
1850
+ prevAllowStateReads: l,
1851
+ notifySpy: n,
1852
+ startTime: o,
1853
+ actionId: $e++,
1854
+ parentActionId: We,
1855
+ };
1856
+ return (We = p.actionId), p;
1857
+ })(e, r, n);
1858
+ try {
1859
+ return t.apply(r, n);
1860
+ } catch (e) {
1861
+ throw ((o.error = e), e);
1862
+ } finally {
1863
+ !(function (e) {
1864
+ We !== e.actionId &&
1865
+ U('invalid action stack. did you forget to finish an action?');
1866
+ (We = e.parentActionId),
1867
+ void 0 !== e.error && (ut.suppressReactionErrors = !0);
1868
+ et(e.prevAllowStateChanges),
1869
+ Je(e.prevAllowStateReads),
1870
+ ft(),
1871
+ Ke(e.prevDerivation),
1872
+ e.notifySpy &&
1873
+ 'production' !== process.env.NODE_ENV &&
1874
+ St({ time: Date.now() - e.startTime });
1875
+ ut.suppressReactionErrors = !1;
1876
+ })(o);
1877
+ }
1878
+ })(e, t, r || this, arguments);
1879
+ };
1880
+ return (
1881
+ (n.isMobxAction = !0),
1882
+ 'production' !== process.env.NODE_ENV &&
1883
+ Ye &&
1884
+ Object.defineProperty(n, 'name', { value: e }),
1885
+ n
1886
+ );
1887
+ }
1888
+ function Qe(e) {
1889
+ var t = ut.allowStateChanges;
1890
+ return (ut.allowStateChanges = e), t;
1891
+ }
1892
+ function et(e) {
1893
+ ut.allowStateChanges = e;
1894
+ }
1895
+ var tt = (function (e) {
1896
+ function t(t, r, n, o, i) {
1897
+ void 0 === n && (n = 'ObservableValue@' + q()),
1898
+ void 0 === o && (o = !0),
1899
+ void 0 === i && (i = ae.default);
1900
+ var a = e.call(this, n) || this;
1901
+ return (
1902
+ (a.enhancer = r),
1903
+ (a.name = n),
1904
+ (a.equals = i),
1905
+ (a.hasUnreportedChange = !1),
1906
+ (a.value = r(t, void 0, n)),
1907
+ o &&
1908
+ _t() &&
1909
+ 'production' !== process.env.NODE_ENV &&
1910
+ wt({ type: 'create', name: a.name, newValue: '' + a.value }),
1911
+ a
1912
+ );
1913
+ }
1914
+ return (
1915
+ (function (e, t) {
1916
+ function r() {
1917
+ this.constructor = e;
1918
+ }
1919
+ se(e, t),
1920
+ (e.prototype =
1921
+ null === t
1922
+ ? Object.create(t)
1923
+ : ((r.prototype = t.prototype), new r()));
1924
+ })(t, e),
1925
+ (t.prototype.dehanceValue = function (e) {
1926
+ return void 0 !== this.dehancer ? this.dehancer(e) : e;
1927
+ }),
1928
+ (t.prototype.set = function (e) {
1929
+ var t = this.value;
1930
+ if ((e = this.prepareNewValue(e)) !== ut.UNCHANGED) {
1931
+ var r = _t();
1932
+ r &&
1933
+ 'production' !== process.env.NODE_ENV &&
1934
+ xt({ type: 'update', name: this.name, newValue: e, oldValue: t }),
1935
+ this.setNewValue(e),
1936
+ r && 'production' !== process.env.NODE_ENV && St();
1937
+ }
1938
+ }),
1939
+ (t.prototype.prepareNewValue = function (e) {
1940
+ if ((Be(this), Gt(this))) {
1941
+ var t = Kt(this, { object: this, type: 'update', newValue: e });
1942
+ if (!t) return ut.UNCHANGED;
1943
+ e = t.newValue;
1944
+ }
1945
+ return (
1946
+ (e = this.enhancer(e, this.value, this.name)),
1947
+ this.equals(this.value, e) ? ut.UNCHANGED : e
1948
+ );
1949
+ }),
1950
+ (t.prototype.setNewValue = function (e) {
1951
+ var t = this.value;
1952
+ (this.value = e),
1953
+ this.reportChanged(),
1954
+ zt(this) &&
1955
+ Ht(this, { type: 'update', object: this, newValue: e, oldValue: t });
1956
+ }),
1957
+ (t.prototype.get = function () {
1958
+ return this.reportObserved(), this.dehanceValue(this.value);
1959
+ }),
1960
+ (t.prototype.intercept = function (e) {
1961
+ return Ft(this, e);
1962
+ }),
1963
+ (t.prototype.observe = function (e, t) {
1964
+ return (
1965
+ t &&
1966
+ e({
1967
+ object: this,
1968
+ type: 'update',
1969
+ newValue: this.value,
1970
+ oldValue: void 0,
1971
+ }),
1972
+ Jt(this, e)
1973
+ );
1974
+ }),
1975
+ (t.prototype.toJSON = function () {
1976
+ return this.get();
1977
+ }),
1978
+ (t.prototype.toString = function () {
1979
+ return this.name + '[' + this.value + ']';
1980
+ }),
1981
+ (t.prototype.valueOf = function () {
1982
+ return ee(this.get());
1983
+ }),
1984
+ (t.prototype[Symbol.toPrimitive] = function () {
1985
+ return this.valueOf();
1986
+ }),
1987
+ t
1988
+ );
1989
+ })(ne);
1990
+ $('ObservableValue', tt);
1991
+ var rt = (function () {
1992
+ function e(e) {
1993
+ (this.dependenciesState = ke.NOT_TRACKING),
1994
+ (this.observing = []),
1995
+ (this.newObserving = null),
1996
+ (this.isBeingObserved = !1),
1997
+ (this.isPendingUnobservation = !1),
1998
+ (this.observers = new Set()),
1999
+ (this.diffValue = 0),
2000
+ (this.runId = 0),
2001
+ (this.lastAccessedBy = 0),
2002
+ (this.lowestObserverState = ke.UP_TO_DATE),
2003
+ (this.unboundDepsCount = 0),
2004
+ (this.__mapid = '#' + q()),
2005
+ (this.value = new Ie(null)),
2006
+ (this.isComputing = !1),
2007
+ (this.isRunningSetter = !1),
2008
+ (this.isTracing = Re.NONE),
2009
+ G(e.get, 'missing option for computed: get'),
2010
+ (this.derivation = e.get),
2011
+ (this.name = e.name || 'ComputedValue@' + q()),
2012
+ e.set && (this.setter = Ze(this.name + '-setter', e.set)),
2013
+ (this.equals =
2014
+ e.equals ||
2015
+ (e.compareStructural || e.struct ? ae.structural : ae.default)),
2016
+ (this.scope = e.context),
2017
+ (this.requiresReaction = !!e.requiresReaction),
2018
+ (this.keepAlive = !!e.keepAlive);
2019
+ }
2020
+ return (
2021
+ (e.prototype.onBecomeStale = function () {
2022
+ !(function (e) {
2023
+ if (e.lowestObserverState !== ke.UP_TO_DATE) return;
2024
+ (e.lowestObserverState = ke.POSSIBLY_STALE),
2025
+ e.observers.forEach(function (t) {
2026
+ t.dependenciesState === ke.UP_TO_DATE &&
2027
+ ((t.dependenciesState = ke.POSSIBLY_STALE),
2028
+ t.isTracing !== Re.NONE && vt(t, e),
2029
+ t.onBecomeStale());
2030
+ });
2031
+ })(this);
2032
+ }),
2033
+ (e.prototype.onBecomeObserved = function () {
2034
+ this.onBecomeObservedListeners &&
2035
+ this.onBecomeObservedListeners.forEach(function (e) {
2036
+ return e();
2037
+ });
2038
+ }),
2039
+ (e.prototype.onBecomeUnobserved = function () {
2040
+ this.onBecomeUnobservedListeners &&
2041
+ this.onBecomeUnobservedListeners.forEach(function (e) {
2042
+ return e();
2043
+ });
2044
+ }),
2045
+ (e.prototype.get = function () {
2046
+ this.isComputing &&
2047
+ U(
2048
+ 'Cycle detected in computation ' +
2049
+ this.name +
2050
+ ': ' +
2051
+ this.derivation,
2052
+ ),
2053
+ 0 !== ut.inBatch || 0 !== this.observers.size || this.keepAlive
2054
+ ? (ht(this),
2055
+ Le(this) &&
2056
+ this.trackAndCompute() &&
2057
+ (function (e) {
2058
+ if (e.lowestObserverState === ke.STALE) return;
2059
+ (e.lowestObserverState = ke.STALE),
2060
+ e.observers.forEach(function (t) {
2061
+ t.dependenciesState === ke.POSSIBLY_STALE
2062
+ ? (t.dependenciesState = ke.STALE)
2063
+ : t.dependenciesState === ke.UP_TO_DATE &&
2064
+ (e.lowestObserverState = ke.UP_TO_DATE);
2065
+ });
2066
+ })(this))
2067
+ : Le(this) &&
2068
+ (this.warnAboutUntrackedRead(),
2069
+ dt(),
2070
+ (this.value = this.computeValue(!1)),
2071
+ ft());
2072
+ var e = this.value;
2073
+ if (Me(e)) throw e.cause;
2074
+ return e;
2075
+ }),
2076
+ (e.prototype.peek = function () {
2077
+ var e = this.computeValue(!1);
2078
+ if (Me(e)) throw e.cause;
2079
+ return e;
2080
+ }),
2081
+ (e.prototype.set = function (e) {
2082
+ if (this.setter) {
2083
+ G(
2084
+ !this.isRunningSetter,
2085
+ "The setter of computed value '" +
2086
+ this.name +
2087
+ "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?",
2088
+ ),
2089
+ (this.isRunningSetter = !0);
2090
+ try {
2091
+ this.setter.call(this.scope, e);
2092
+ } finally {
2093
+ this.isRunningSetter = !1;
2094
+ }
2095
+ } else
2096
+ G(
2097
+ !1,
2098
+ 'production' !== process.env.NODE_ENV &&
2099
+ "[ComputedValue '" +
2100
+ this.name +
2101
+ "'] It is not possible to assign a new value to a computed value.",
2102
+ );
2103
+ }),
2104
+ (e.prototype.trackAndCompute = function () {
2105
+ _t() &&
2106
+ 'production' !== process.env.NODE_ENV &&
2107
+ wt({ object: this.scope, type: 'compute', name: this.name });
2108
+ var e = this.value,
2109
+ t = this.dependenciesState === ke.NOT_TRACKING,
2110
+ r = this.computeValue(!0),
2111
+ n = t || Me(e) || Me(r) || !this.equals(e, r);
2112
+ return n && (this.value = r), n;
2113
+ }),
2114
+ (e.prototype.computeValue = function (e) {
2115
+ var t;
2116
+ if (((this.isComputing = !0), ut.computationDepth++, e))
2117
+ t = qe(this, this.derivation, this.scope);
2118
+ else if (!0 === ut.disableErrorBoundaries)
2119
+ t = this.derivation.call(this.scope);
2120
+ else
2121
+ try {
2122
+ t = this.derivation.call(this.scope);
2123
+ } catch (e) {
2124
+ t = new Ie(e);
2125
+ }
2126
+ return ut.computationDepth--, (this.isComputing = !1), t;
2127
+ }),
2128
+ (e.prototype.suspend = function () {
2129
+ this.keepAlive || (Ue(this), (this.value = void 0));
2130
+ }),
2131
+ (e.prototype.observe = function (e, t) {
2132
+ var r = this,
2133
+ n = !0,
2134
+ o = void 0;
2135
+ return (function (e, t) {
2136
+ void 0 === t && (t = B);
2137
+ 'production' !== process.env.NODE_ENV &&
2138
+ (G(
2139
+ 'function' == typeof e,
2140
+ 'Autorun expects a function as first argument',
2141
+ ),
2142
+ G(
2143
+ !1 == ('function' == typeof (r = e) && !0 === r.isMobxAction),
2144
+ 'Autorun does not accept actions since actions are untrackable',
2145
+ ));
2146
+ var r;
2147
+ var n,
2148
+ o = (t && t.name) || e.name || 'Autorun@' + q();
2149
+ if (t.scheduler || t.delay) {
2150
+ var i = (function (e) {
2151
+ return e.scheduler
2152
+ ? e.scheduler
2153
+ : e.delay
2154
+ ? function (t) {
2155
+ return setTimeout(t, e.delay);
2156
+ }
2157
+ : Dt;
2158
+ })(t),
2159
+ a = !1;
2160
+ n = new bt(
2161
+ o,
2162
+ function () {
2163
+ a ||
2164
+ ((a = !0),
2165
+ i(function () {
2166
+ (a = !1), n.isDisposed || n.track(s);
2167
+ }));
2168
+ },
2169
+ t.onError,
2170
+ t.requiresObservable,
2171
+ );
2172
+ } else
2173
+ n = new bt(
2174
+ o,
2175
+ function () {
2176
+ this.track(s);
2177
+ },
2178
+ t.onError,
2179
+ t.requiresObservable,
2180
+ );
2181
+ function s() {
2182
+ e(n);
2183
+ }
2184
+ return n.schedule(), n.getDisposer();
2185
+ })(function () {
2186
+ var i = r.get();
2187
+ if (!n || t) {
2188
+ var a = Fe();
2189
+ e({ type: 'update', object: r, newValue: i, oldValue: o }), Ke(a);
2190
+ }
2191
+ (n = !1), (o = i);
2192
+ });
2193
+ }),
2194
+ (e.prototype.warnAboutUntrackedRead = function () {
2195
+ 'production' !== process.env.NODE_ENV &&
2196
+ (!0 === this.requiresReaction &&
2197
+ U(
2198
+ '[mobx] Computed value ' +
2199
+ this.name +
2200
+ ' is read outside a reactive context',
2201
+ ),
2202
+ this.isTracing !== Re.NONE &&
2203
+ console.log(
2204
+ "[mobx.trace] '" +
2205
+ this.name +
2206
+ "' is being read outside a reactive context. Doing a full recompute",
2207
+ ),
2208
+ ut.computedRequiresReaction &&
2209
+ console.warn(
2210
+ '[mobx] Computed value ' +
2211
+ this.name +
2212
+ ' is being read outside a reactive context. Doing a full recompute',
2213
+ ));
2214
+ }),
2215
+ (e.prototype.toJSON = function () {
2216
+ return this.get();
2217
+ }),
2218
+ (e.prototype.toString = function () {
2219
+ return this.name + '[' + this.derivation.toString() + ']';
2220
+ }),
2221
+ (e.prototype.valueOf = function () {
2222
+ return ee(this.get());
2223
+ }),
2224
+ (e.prototype[Symbol.toPrimitive] = function () {
2225
+ return this.valueOf();
2226
+ }),
2227
+ e
2228
+ );
2229
+ })(),
2230
+ nt = $('ComputedValue', rt),
2231
+ ot = function () {
2232
+ (this.version = 5),
2233
+ (this.UNCHANGED = {}),
2234
+ (this.trackingDerivation = null),
2235
+ (this.computationDepth = 0),
2236
+ (this.runId = 0),
2237
+ (this.mobxGuid = 0),
2238
+ (this.inBatch = 0),
2239
+ (this.pendingUnobservations = []),
2240
+ (this.pendingReactions = []),
2241
+ (this.isRunningReactions = !1),
2242
+ (this.allowStateChanges = !0),
2243
+ (this.allowStateReads = !0),
2244
+ (this.enforceActions = !1),
2245
+ (this.spyListeners = []),
2246
+ (this.globalReactionErrorHandlers = []),
2247
+ (this.computedRequiresReaction = !1),
2248
+ (this.reactionRequiresObservable = !1),
2249
+ (this.observableRequiresReaction = !1),
2250
+ (this.computedConfigurable = !1),
2251
+ (this.disableErrorBoundaries = !1),
2252
+ (this.suppressReactionErrors = !1);
2253
+ },
2254
+ it = {};
2255
+ function at() {
2256
+ return 'undefined' != typeof window
2257
+ ? window
2258
+ : 'undefined' != typeof global
2259
+ ? global
2260
+ : 'undefined' != typeof self
2261
+ ? self
2262
+ : it;
2263
+ }
2264
+ var st = !0,
2265
+ ut = (function () {
2266
+ var e = at();
2267
+ return (
2268
+ e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (st = !1),
2269
+ e.__mobxGlobals &&
2270
+ e.__mobxGlobals.version !== new ot().version &&
2271
+ (st = !1),
2272
+ st
2273
+ ? e.__mobxGlobals
2274
+ ? ((e.__mobxInstanceCount += 1),
2275
+ e.__mobxGlobals.UNCHANGED || (e.__mobxGlobals.UNCHANGED = {}),
2276
+ e.__mobxGlobals)
2277
+ : ((e.__mobxInstanceCount = 1), (e.__mobxGlobals = new ot()))
2278
+ : (setTimeout(function () {
2279
+ U(
2280
+ 'There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`',
2281
+ );
2282
+ }, 1),
2283
+ new ot())
2284
+ );
2285
+ })();
2286
+ function ct(e, t) {
2287
+ e.observers.add(t),
2288
+ e.lowestObserverState > t.dependenciesState &&
2289
+ (e.lowestObserverState = t.dependenciesState);
2290
+ }
2291
+ function lt(e, t) {
2292
+ e.observers.delete(t), 0 === e.observers.size && pt(e);
2293
+ }
2294
+ function pt(e) {
2295
+ !1 === e.isPendingUnobservation &&
2296
+ ((e.isPendingUnobservation = !0), ut.pendingUnobservations.push(e));
2297
+ }
2298
+ function dt() {
2299
+ ut.inBatch++;
2300
+ }
2301
+ function ft() {
2302
+ if (0 == --ut.inBatch) {
2303
+ Ot();
2304
+ for (var e = ut.pendingUnobservations, t = 0; t < e.length; t++) {
2305
+ var r = e[t];
2306
+ (r.isPendingUnobservation = !1),
2307
+ 0 === r.observers.size &&
2308
+ (r.isBeingObserved &&
2309
+ ((r.isBeingObserved = !1), r.onBecomeUnobserved()),
2310
+ r instanceof rt && r.suspend());
2311
+ }
2312
+ ut.pendingUnobservations = [];
2313
+ }
2314
+ }
2315
+ function ht(e) {
2316
+ !(function (e) {
2317
+ 'production' !== process.env.NODE_ENV &&
2318
+ !ut.allowStateReads &&
2319
+ ut.observableRequiresReaction &&
2320
+ console.warn(
2321
+ '[mobx] Observable ' +
2322
+ e.name +
2323
+ ' being read outside a reactive context',
2324
+ );
2325
+ })(e);
2326
+ var t = ut.trackingDerivation;
2327
+ return null !== t
2328
+ ? (t.runId !== e.lastAccessedBy &&
2329
+ ((e.lastAccessedBy = t.runId),
2330
+ (t.newObserving[t.unboundDepsCount++] = e),
2331
+ e.isBeingObserved || ((e.isBeingObserved = !0), e.onBecomeObserved())),
2332
+ !0)
2333
+ : (0 === e.observers.size && ut.inBatch > 0 && pt(e), !1);
2334
+ }
2335
+ function vt(e, t) {
2336
+ if (
2337
+ (console.log(
2338
+ "[mobx.trace] '" +
2339
+ e.name +
2340
+ "' is invalidated due to a change in: '" +
2341
+ t.name +
2342
+ "'",
2343
+ ),
2344
+ e.isTracing === Re.BREAK)
2345
+ ) {
2346
+ var r = [];
2347
+ yt(Rt(hr(e, n)), r, 1),
2348
+ new Function(
2349
+ "debugger;\n/*\nTracing '" +
2350
+ e.name +
2351
+ "'\n\nYou are entering this break point because derivation '" +
2352
+ e.name +
2353
+ "' is being traced and '" +
2354
+ t.name +
2355
+ "' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n" +
2356
+ (e instanceof rt
2357
+ ? e.derivation.toString().replace(/[*]\//g, '/')
2358
+ : '') +
2359
+ '\n\nThe dependencies for this derivation are:\n\n' +
2360
+ r.join('\n') +
2361
+ '\n*/\n ',
2362
+ )();
2363
+ }
2364
+ var n;
2365
+ }
2366
+ function yt(e, t, r) {
2367
+ t.length >= 1e3
2368
+ ? t.push('(and many more)')
2369
+ : (t.push('' + new Array(r).join('\t') + e.name),
2370
+ e.dependencies &&
2371
+ e.dependencies.forEach(function (e) {
2372
+ return yt(e, t, r + 1);
2373
+ }));
2374
+ }
2375
+ var bt = (function () {
2376
+ function e(e, t, r, n) {
2377
+ void 0 === e && (e = 'Reaction@' + q()),
2378
+ void 0 === n && (n = !1),
2379
+ (this.name = e),
2380
+ (this.onInvalidate = t),
2381
+ (this.errorHandler = r),
2382
+ (this.requiresObservable = n),
2383
+ (this.observing = []),
2384
+ (this.newObserving = []),
2385
+ (this.dependenciesState = ke.NOT_TRACKING),
2386
+ (this.diffValue = 0),
2387
+ (this.runId = 0),
2388
+ (this.unboundDepsCount = 0),
2389
+ (this.__mapid = '#' + q()),
2390
+ (this.isDisposed = !1),
2391
+ (this._isScheduled = !1),
2392
+ (this._isTrackPending = !1),
2393
+ (this._isRunning = !1),
2394
+ (this.isTracing = Re.NONE);
2395
+ }
2396
+ return (
2397
+ (e.prototype.onBecomeStale = function () {
2398
+ this.schedule();
2399
+ }),
2400
+ (e.prototype.schedule = function () {
2401
+ this._isScheduled ||
2402
+ ((this._isScheduled = !0), ut.pendingReactions.push(this), Ot());
2403
+ }),
2404
+ (e.prototype.isScheduled = function () {
2405
+ return this._isScheduled;
2406
+ }),
2407
+ (e.prototype.runReaction = function () {
2408
+ if (!this.isDisposed) {
2409
+ if ((dt(), (this._isScheduled = !1), Le(this))) {
2410
+ this._isTrackPending = !0;
2411
+ try {
2412
+ this.onInvalidate(),
2413
+ this._isTrackPending &&
2414
+ _t() &&
2415
+ 'production' !== process.env.NODE_ENV &&
2416
+ wt({ name: this.name, type: 'scheduled-reaction' });
2417
+ } catch (e) {
2418
+ this.reportExceptionInDerivation(e);
2419
+ }
2420
+ }
2421
+ ft();
2422
+ }
2423
+ }),
2424
+ (e.prototype.track = function (e) {
2425
+ if (!this.isDisposed) {
2426
+ dt();
2427
+ var t,
2428
+ r = _t();
2429
+ r &&
2430
+ 'production' !== process.env.NODE_ENV &&
2431
+ ((t = Date.now()), xt({ name: this.name, type: 'reaction' })),
2432
+ (this._isRunning = !0);
2433
+ var n = qe(this, e, void 0);
2434
+ (this._isRunning = !1),
2435
+ (this._isTrackPending = !1),
2436
+ this.isDisposed && Ue(this),
2437
+ Me(n) && this.reportExceptionInDerivation(n.cause),
2438
+ r &&
2439
+ 'production' !== process.env.NODE_ENV &&
2440
+ St({ time: Date.now() - t }),
2441
+ ft();
2442
+ }
2443
+ }),
2444
+ (e.prototype.reportExceptionInDerivation = function (e) {
2445
+ var t = this;
2446
+ if (this.errorHandler) this.errorHandler(e, this);
2447
+ else {
2448
+ if (ut.disableErrorBoundaries) throw e;
2449
+ var r =
2450
+ "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" +
2451
+ this +
2452
+ "'";
2453
+ ut.suppressReactionErrors
2454
+ ? console.warn(
2455
+ "[mobx] (error in reaction '" +
2456
+ this.name +
2457
+ "' suppressed, fix error of causing action below)",
2458
+ )
2459
+ : console.error(r, e),
2460
+ _t() &&
2461
+ wt({ type: 'error', name: this.name, message: r, error: '' + e }),
2462
+ ut.globalReactionErrorHandlers.forEach(function (r) {
2463
+ return r(e, t);
2464
+ });
2465
+ }
2466
+ }),
2467
+ (e.prototype.dispose = function () {
2468
+ this.isDisposed ||
2469
+ ((this.isDisposed = !0), this._isRunning || (dt(), Ue(this), ft()));
2470
+ }),
2471
+ (e.prototype.getDisposer = function () {
2472
+ var e = this.dispose.bind(this);
2473
+ return (e[re] = this), e;
2474
+ }),
2475
+ (e.prototype.toString = function () {
2476
+ return 'Reaction[' + this.name + ']';
2477
+ }),
2478
+ (e.prototype.trace = function (e) {
2479
+ void 0 === e && (e = !1),
2480
+ (function () {
2481
+ for (var e = [], t = 0; t < arguments.length; t++)
2482
+ e[t] = arguments[t];
2483
+ var r = !1;
2484
+ 'boolean' == typeof e[e.length - 1] && (r = e.pop());
2485
+ var n = (function (e) {
2486
+ switch (e.length) {
2487
+ case 0:
2488
+ return ut.trackingDerivation;
2489
+ case 1:
2490
+ return hr(e[0]);
2491
+ case 2:
2492
+ return hr(e[0], e[1]);
2493
+ }
2494
+ })(e);
2495
+ if (!n)
2496
+ return U(
2497
+ 'production' !== process.env.NODE_ENV &&
2498
+ "'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly",
2499
+ );
2500
+ n.isTracing === Re.NONE &&
2501
+ console.log("[mobx.trace] '" + n.name + "' tracing enabled");
2502
+ n.isTracing = r ? Re.BREAK : Re.LOG;
2503
+ })(this, e);
2504
+ }),
2505
+ e
2506
+ );
2507
+ })(),
2508
+ mt = 100,
2509
+ gt = function (e) {
2510
+ return e();
2511
+ };
2512
+ function Ot() {
2513
+ ut.inBatch > 0 || ut.isRunningReactions || gt(Et);
2514
+ }
2515
+ function Et() {
2516
+ ut.isRunningReactions = !0;
2517
+ for (var e = ut.pendingReactions, t = 0; e.length > 0; ) {
2518
+ ++t === mt &&
2519
+ (console.error(
2520
+ "Reaction doesn't converge to a stable state after " +
2521
+ mt +
2522
+ ' iterations. Probably there is a cycle in the reactive function: ' +
2523
+ e[0],
2524
+ ),
2525
+ e.splice(0));
2526
+ for (var r = e.splice(0), n = 0, o = r.length; n < o; n++)
2527
+ r[n].runReaction();
2528
+ }
2529
+ ut.isRunningReactions = !1;
2530
+ }
2531
+ var Nt = $('Reaction', bt);
2532
+ function _t() {
2533
+ return 'production' !== process.env.NODE_ENV && !!ut.spyListeners.length;
2534
+ }
2535
+ function wt(e) {
2536
+ if ('production' !== process.env.NODE_ENV && ut.spyListeners.length)
2537
+ for (var t = ut.spyListeners, r = 0, n = t.length; r < n; r++) t[r](e);
2538
+ }
2539
+ function xt(e) {
2540
+ 'production' !== process.env.NODE_ENV &&
2541
+ wt(ue(ue({}, e), { spyReportStart: !0 }));
2542
+ }
2543
+ var jt = { spyReportEnd: !0 };
2544
+ function St(e) {
2545
+ 'production' !== process.env.NODE_ENV &&
2546
+ wt(e ? ue(ue({}, e), { spyReportEnd: !0 }) : jt);
2547
+ }
2548
+ var Dt = function (e) {
2549
+ return e();
2550
+ };
2551
+ function At(e, t, r) {
2552
+ return Vt('onBecomeUnobserved', e, t, r);
2553
+ }
2554
+ function Vt(e, t, r, n) {
2555
+ var o = 'function' == typeof n ? hr(t, r) : hr(t),
2556
+ i = 'function' == typeof n ? n : r,
2557
+ a = e + 'Listeners';
2558
+ return (
2559
+ o[a] ? o[a].add(i) : (o[a] = new Set([i])),
2560
+ 'function' != typeof o[e]
2561
+ ? U(
2562
+ 'production' !== process.env.NODE_ENV &&
2563
+ 'Not an atom that can be (un)observed',
2564
+ )
2565
+ : function () {
2566
+ var e = o[a];
2567
+ e && (e.delete(i), 0 === e.size && delete o[a]);
2568
+ }
2569
+ );
2570
+ }
2571
+ function Ct(e, t, r, n) {
2572
+ 'production' !== process.env.NODE_ENV &&
2573
+ (G(
2574
+ arguments.length >= 2 && arguments.length <= 4,
2575
+ "'extendObservable' expected 2-4 arguments",
2576
+ ),
2577
+ G(
2578
+ 'object' == typeof e,
2579
+ "'extendObservable' expects an object as first argument",
2580
+ ),
2581
+ G(
2582
+ !nr(e),
2583
+ "'extendObservable' should not be used on maps, use map.merge instead",
2584
+ ));
2585
+ var o = Tt((n = we(n)));
2586
+ return ye(e), ur(e, n.name, o.enhancer), t && kt(e, t, r, o), e;
2587
+ }
2588
+ function Tt(e) {
2589
+ return e.defaultDecorator || (!1 === e.deep ? Se : xe);
2590
+ }
2591
+ function kt(e, t, r, n) {
2592
+ var o, i, a, s;
2593
+ if (
2594
+ 'production' !== process.env.NODE_ENV &&
2595
+ (G(
2596
+ !It(t),
2597
+ 'Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540',
2598
+ ),
2599
+ r)
2600
+ ) {
2601
+ var u = Z(r);
2602
+ try {
2603
+ for (var c = ce(u), l = c.next(); !l.done; l = c.next()) {
2604
+ (f = l.value) in t ||
2605
+ U(
2606
+ "Trying to declare a decorator for unspecified property '" +
2607
+ Q(f) +
2608
+ "'",
2609
+ );
2610
+ }
2611
+ } catch (e) {
2612
+ o = { error: e };
2613
+ } finally {
2614
+ try {
2615
+ l && !l.done && (i = c.return) && i.call(c);
2616
+ } finally {
2617
+ if (o) throw o.error;
2618
+ }
2619
+ }
2620
+ }
2621
+ dt();
2622
+ try {
2623
+ u = te(t);
2624
+ try {
2625
+ for (var p = ce(u), d = p.next(); !d.done; d = p.next()) {
2626
+ var f = d.value,
2627
+ h = Object.getOwnPropertyDescriptor(t, f);
2628
+ 'production' !== process.env.NODE_ENV &&
2629
+ (J(t) ||
2630
+ U(
2631
+ "'extendObservable' only accepts plain objects as second argument",
2632
+ ),
2633
+ Pt(h.value) &&
2634
+ U(
2635
+ "Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead",
2636
+ ));
2637
+ var v = r && f in r ? r[f] : h.get ? Pe : n;
2638
+ 'production' !== process.env.NODE_ENV &&
2639
+ 'function' != typeof v &&
2640
+ U("Not a valid decorator for '" + Q(f) + "', got: " + v);
2641
+ var y = v(e, f, h, !0);
2642
+ y && Object.defineProperty(e, f, y);
2643
+ }
2644
+ } catch (e) {
2645
+ a = { error: e };
2646
+ } finally {
2647
+ try {
2648
+ d && !d.done && (s = p.return) && s.call(p);
2649
+ } finally {
2650
+ if (a) throw a.error;
2651
+ }
2652
+ }
2653
+ } finally {
2654
+ ft();
2655
+ }
2656
+ }
2657
+ function Rt(e) {
2658
+ var t,
2659
+ r,
2660
+ n = { name: e.name };
2661
+ return (
2662
+ e.observing &&
2663
+ e.observing.length > 0 &&
2664
+ (n.dependencies = ((t = e.observing),
2665
+ (r = []),
2666
+ t.forEach(function (e) {
2667
+ -1 === r.indexOf(e) && r.push(e);
2668
+ }),
2669
+ r).map(Rt)),
2670
+ n
2671
+ );
2672
+ }
2673
+ function Pt(e) {
2674
+ return arguments.length > 1
2675
+ ? U(
2676
+ 'production' !== process.env.NODE_ENV &&
2677
+ 'isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property',
2678
+ )
2679
+ : (function (e, t) {
2680
+ if (null == e) return !1;
2681
+ if (void 0 !== t) {
2682
+ if (!1 === fr(e)) return !1;
2683
+ if (!e[re].values.has(t)) return !1;
2684
+ var r = hr(e, t);
2685
+ return nt(r);
2686
+ }
2687
+ return nt(e);
2688
+ })(e);
2689
+ }
2690
+ function It(e) {
2691
+ return (
2692
+ 1 !== arguments.length &&
2693
+ U(
2694
+ 'production' !== process.env.NODE_ENV &&
2695
+ 'isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property',
2696
+ ),
2697
+ (function (e, t) {
2698
+ return (
2699
+ null != e &&
2700
+ (void 0 !== t
2701
+ ? 'production' !== process.env.NODE_ENV && (nr(e) || Qt(e))
2702
+ ? U(
2703
+ 'isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.',
2704
+ )
2705
+ : !!fr(e) && e[re].values.has(t)
2706
+ : fr(e) || !!e[re] || oe(e) || Nt(e) || nt(e))
2707
+ );
2708
+ })(e)
2709
+ );
2710
+ }
2711
+ function Mt(e, t, r) {
2712
+ if (2 !== arguments.length || ar(e))
2713
+ if (fr(e)) {
2714
+ var n = e[re];
2715
+ n.values.get(t)
2716
+ ? n.write(t, r)
2717
+ : n.addObservableProp(t, r, n.defaultEnhancer);
2718
+ } else if (nr(e)) e.set(t, r);
2719
+ else if (ar(e)) e.add(t);
2720
+ else {
2721
+ if (!Qt(e))
2722
+ return U(
2723
+ 'production' !== process.env.NODE_ENV &&
2724
+ "'set()' can only be used on observable objects, arrays and maps",
2725
+ );
2726
+ 'number' != typeof t && (t = parseInt(t, 10)),
2727
+ G(t >= 0, "Not a valid index: '" + t + "'"),
2728
+ dt(),
2729
+ t >= e.length && (e.length = t + 1),
2730
+ (e[t] = r),
2731
+ ft();
2732
+ }
2733
+ else {
2734
+ dt();
2735
+ var o = t;
2736
+ try {
2737
+ for (var i in o) Mt(e, i, o[i]);
2738
+ } finally {
2739
+ ft();
2740
+ }
2741
+ }
2742
+ }
2743
+ function Lt(e, t) {
2744
+ void 0 === t && (t = void 0), dt();
2745
+ try {
2746
+ return e.apply(t);
2747
+ } finally {
2748
+ ft();
2749
+ }
2750
+ }
2751
+ function Bt(e) {
2752
+ return e[re];
2753
+ }
2754
+ function qt(e) {
2755
+ return 'string' == typeof e || 'number' == typeof e || 'symbol' == typeof e;
2756
+ }
2757
+ var Ut = {
2758
+ has: function (e, t) {
2759
+ if (t === re || 'constructor' === t || t === de) return !0;
2760
+ var r = Bt(e);
2761
+ return qt(t) ? r.has(t) : t in e;
2762
+ },
2763
+ get: function (e, t) {
2764
+ if (t === re || 'constructor' === t || t === de) return e[t];
2765
+ var r = Bt(e),
2766
+ n = r.values.get(t);
2767
+ if (n instanceof ne) {
2768
+ var o = n.get();
2769
+ return void 0 === o && r.has(t), o;
2770
+ }
2771
+ return qt(t) && r.has(t), e[t];
2772
+ },
2773
+ set: function (e, t, r) {
2774
+ return !!qt(t) && (Mt(e, t, r), !0);
2775
+ },
2776
+ deleteProperty: function (e, t) {
2777
+ return !!qt(t) && (Bt(e).remove(t), !0);
2778
+ },
2779
+ ownKeys: function (e) {
2780
+ return Bt(e).keysAtom.reportObserved(), Reflect.ownKeys(e);
2781
+ },
2782
+ preventExtensions: function (e) {
2783
+ return U('Dynamic observable objects cannot be frozen'), !1;
2784
+ },
2785
+ };
2786
+ function Gt(e) {
2787
+ return void 0 !== e.interceptors && e.interceptors.length > 0;
2788
+ }
2789
+ function Ft(e, t) {
2790
+ var r = e.interceptors || (e.interceptors = []);
2791
+ return (
2792
+ r.push(t),
2793
+ F(function () {
2794
+ var e = r.indexOf(t);
2795
+ -1 !== e && r.splice(e, 1);
2796
+ })
2797
+ );
2798
+ }
2799
+ function Kt(e, t) {
2800
+ var r = Fe();
2801
+ try {
2802
+ for (
2803
+ var n = pe(e.interceptors || []), o = 0, i = n.length;
2804
+ o < i &&
2805
+ (G(
2806
+ !(t = n[o](t)) || t.type,
2807
+ 'Intercept handlers should return nothing or a change object',
2808
+ ),
2809
+ t);
2810
+ o++
2811
+ );
2812
+ return t;
2813
+ } finally {
2814
+ Ke(r);
2815
+ }
2816
+ }
2817
+ function zt(e) {
2818
+ return void 0 !== e.changeListeners && e.changeListeners.length > 0;
2819
+ }
2820
+ function Jt(e, t) {
2821
+ var r = e.changeListeners || (e.changeListeners = []);
2822
+ return (
2823
+ r.push(t),
2824
+ F(function () {
2825
+ var e = r.indexOf(t);
2826
+ -1 !== e && r.splice(e, 1);
2827
+ })
2828
+ );
2829
+ }
2830
+ function Ht(e, t) {
2831
+ var r = Fe(),
2832
+ n = e.changeListeners;
2833
+ if (n) {
2834
+ for (var o = 0, i = (n = n.slice()).length; o < i; o++) n[o](t);
2835
+ Ke(r);
2836
+ }
2837
+ }
2838
+ var Wt = {
2839
+ get: function (e, t) {
2840
+ return t === re
2841
+ ? e[re]
2842
+ : 'length' === t
2843
+ ? e[re].getArrayLength()
2844
+ : 'number' == typeof t
2845
+ ? Xt.get.call(e, t)
2846
+ : 'string' != typeof t || isNaN(t)
2847
+ ? Xt.hasOwnProperty(t)
2848
+ ? Xt[t]
2849
+ : e[t]
2850
+ : Xt.get.call(e, parseInt(t));
2851
+ },
2852
+ set: function (e, t, r) {
2853
+ return (
2854
+ 'length' === t && e[re].setArrayLength(r),
2855
+ 'number' == typeof t && Xt.set.call(e, t, r),
2856
+ 'symbol' == typeof t || isNaN(t)
2857
+ ? (e[t] = r)
2858
+ : Xt.set.call(e, parseInt(t), r),
2859
+ !0
2860
+ );
2861
+ },
2862
+ preventExtensions: function (e) {
2863
+ return U('Observable arrays cannot be frozen'), !1;
2864
+ },
2865
+ };
2866
+ var $t = (function () {
2867
+ function e(e, t, r) {
2868
+ (this.owned = r),
2869
+ (this.values = []),
2870
+ (this.proxy = void 0),
2871
+ (this.lastKnownLength = 0),
2872
+ (this.atom = new ne(e || 'ObservableArray@' + q())),
2873
+ (this.enhancer = function (r, n) {
2874
+ return t(r, n, e + '[..]');
2875
+ });
2876
+ }
2877
+ return (
2878
+ (e.prototype.dehanceValue = function (e) {
2879
+ return void 0 !== this.dehancer ? this.dehancer(e) : e;
2880
+ }),
2881
+ (e.prototype.dehanceValues = function (e) {
2882
+ return void 0 !== this.dehancer && e.length > 0
2883
+ ? e.map(this.dehancer)
2884
+ : e;
2885
+ }),
2886
+ (e.prototype.intercept = function (e) {
2887
+ return Ft(this, e);
2888
+ }),
2889
+ (e.prototype.observe = function (e, t) {
2890
+ return (
2891
+ void 0 === t && (t = !1),
2892
+ t &&
2893
+ e({
2894
+ object: this.proxy,
2895
+ type: 'splice',
2896
+ index: 0,
2897
+ added: this.values.slice(),
2898
+ addedCount: this.values.length,
2899
+ removed: [],
2900
+ removedCount: 0,
2901
+ }),
2902
+ Jt(this, e)
2903
+ );
2904
+ }),
2905
+ (e.prototype.getArrayLength = function () {
2906
+ return this.atom.reportObserved(), this.values.length;
2907
+ }),
2908
+ (e.prototype.setArrayLength = function (e) {
2909
+ if ('number' != typeof e || e < 0)
2910
+ throw new Error('[mobx.array] Out of range: ' + e);
2911
+ var t = this.values.length;
2912
+ if (e !== t)
2913
+ if (e > t) {
2914
+ for (var r = new Array(e - t), n = 0; n < e - t; n++) r[n] = void 0;
2915
+ this.spliceWithArray(t, 0, r);
2916
+ } else this.spliceWithArray(e, t - e);
2917
+ }),
2918
+ (e.prototype.updateArrayLength = function (e, t) {
2919
+ if (e !== this.lastKnownLength)
2920
+ throw new Error(
2921
+ '[mobx] Modification exception: the internal structure of an observable array was changed.',
2922
+ );
2923
+ this.lastKnownLength += t;
2924
+ }),
2925
+ (e.prototype.spliceWithArray = function (e, t, r) {
2926
+ var n = this;
2927
+ Be(this.atom);
2928
+ var o = this.values.length;
2929
+ if (
2930
+ (void 0 === e
2931
+ ? (e = 0)
2932
+ : e > o
2933
+ ? (e = o)
2934
+ : e < 0 && (e = Math.max(0, o + e)),
2935
+ (t =
2936
+ 1 === arguments.length
2937
+ ? o - e
2938
+ : null == t
2939
+ ? 0
2940
+ : Math.max(0, Math.min(t, o - e))),
2941
+ void 0 === r && (r = L),
2942
+ Gt(this))
2943
+ ) {
2944
+ var i = Kt(this, {
2945
+ object: this.proxy,
2946
+ type: 'splice',
2947
+ index: e,
2948
+ removedCount: t,
2949
+ added: r,
2950
+ });
2951
+ if (!i) return L;
2952
+ (t = i.removedCount), (r = i.added);
2953
+ }
2954
+ if (
2955
+ ((r =
2956
+ 0 === r.length
2957
+ ? r
2958
+ : r.map(function (e) {
2959
+ return n.enhancer(e, void 0);
2960
+ })),
2961
+ 'production' !== process.env.NODE_ENV)
2962
+ ) {
2963
+ var a = r.length - t;
2964
+ this.updateArrayLength(o, a);
2965
+ }
2966
+ var s = this.spliceItemsIntoValues(e, t, r);
2967
+ return (
2968
+ (0 === t && 0 === r.length) || this.notifyArraySplice(e, r, s),
2969
+ this.dehanceValues(s)
2970
+ );
2971
+ }),
2972
+ (e.prototype.spliceItemsIntoValues = function (e, t, r) {
2973
+ var n;
2974
+ if (r.length < 1e4)
2975
+ return (n = this.values).splice.apply(n, pe([e, t], r));
2976
+ var o = this.values.slice(e, e + t);
2977
+ return (
2978
+ (this.values = this.values
2979
+ .slice(0, e)
2980
+ .concat(r, this.values.slice(e + t))),
2981
+ o
2982
+ );
2983
+ }),
2984
+ (e.prototype.notifyArrayChildUpdate = function (e, t, r) {
2985
+ var n = !this.owned && _t(),
2986
+ o = zt(this),
2987
+ i =
2988
+ o || n
2989
+ ? {
2990
+ object: this.proxy,
2991
+ type: 'update',
2992
+ index: e,
2993
+ newValue: t,
2994
+ oldValue: r,
2995
+ }
2996
+ : null;
2997
+ n &&
2998
+ 'production' !== process.env.NODE_ENV &&
2999
+ xt(ue(ue({}, i), { name: this.atom.name })),
3000
+ this.atom.reportChanged(),
3001
+ o && Ht(this, i),
3002
+ n && 'production' !== process.env.NODE_ENV && St();
3003
+ }),
3004
+ (e.prototype.notifyArraySplice = function (e, t, r) {
3005
+ var n = !this.owned && _t(),
3006
+ o = zt(this),
3007
+ i =
3008
+ o || n
3009
+ ? {
3010
+ object: this.proxy,
3011
+ type: 'splice',
3012
+ index: e,
3013
+ removed: r,
3014
+ added: t,
3015
+ removedCount: r.length,
3016
+ addedCount: t.length,
3017
+ }
3018
+ : null;
3019
+ n &&
3020
+ 'production' !== process.env.NODE_ENV &&
3021
+ xt(ue(ue({}, i), { name: this.atom.name })),
3022
+ this.atom.reportChanged(),
3023
+ o && Ht(this, i),
3024
+ n && 'production' !== process.env.NODE_ENV && St();
3025
+ }),
3026
+ e
3027
+ );
3028
+ })(),
3029
+ Xt = {
3030
+ intercept: function (e) {
3031
+ return this[re].intercept(e);
3032
+ },
3033
+ observe: function (e, t) {
3034
+ return void 0 === t && (t = !1), this[re].observe(e, t);
3035
+ },
3036
+ clear: function () {
3037
+ return this.splice(0);
3038
+ },
3039
+ replace: function (e) {
3040
+ var t = this[re];
3041
+ return t.spliceWithArray(0, t.values.length, e);
3042
+ },
3043
+ toJS: function () {
3044
+ return this.slice();
3045
+ },
3046
+ toJSON: function () {
3047
+ return this.toJS();
3048
+ },
3049
+ splice: function (e, t) {
3050
+ for (var r = [], n = 2; n < arguments.length; n++)
3051
+ r[n - 2] = arguments[n];
3052
+ var o = this[re];
3053
+ switch (arguments.length) {
3054
+ case 0:
3055
+ return [];
3056
+ case 1:
3057
+ return o.spliceWithArray(e);
3058
+ case 2:
3059
+ return o.spliceWithArray(e, t);
3060
+ }
3061
+ return o.spliceWithArray(e, t, r);
3062
+ },
3063
+ spliceWithArray: function (e, t, r) {
3064
+ return this[re].spliceWithArray(e, t, r);
3065
+ },
3066
+ push: function () {
3067
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
3068
+ var r = this[re];
3069
+ return r.spliceWithArray(r.values.length, 0, e), r.values.length;
3070
+ },
3071
+ pop: function () {
3072
+ return this.splice(Math.max(this[re].values.length - 1, 0), 1)[0];
3073
+ },
3074
+ shift: function () {
3075
+ return this.splice(0, 1)[0];
3076
+ },
3077
+ unshift: function () {
3078
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
3079
+ var r = this[re];
3080
+ return r.spliceWithArray(0, 0, e), r.values.length;
3081
+ },
3082
+ reverse: function () {
3083
+ 'production' !== process.env.NODE_ENV &&
3084
+ console.warn(
3085
+ '[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place',
3086
+ );
3087
+ var e = this.slice();
3088
+ return e.reverse.apply(e, arguments);
3089
+ },
3090
+ sort: function (e) {
3091
+ 'production' !== process.env.NODE_ENV &&
3092
+ console.warn(
3093
+ '[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place',
3094
+ );
3095
+ var t = this.slice();
3096
+ return t.sort.apply(t, arguments);
3097
+ },
3098
+ remove: function (e) {
3099
+ var t = this[re],
3100
+ r = t.dehanceValues(t.values).indexOf(e);
3101
+ return r > -1 && (this.splice(r, 1), !0);
3102
+ },
3103
+ get: function (e) {
3104
+ var t = this[re];
3105
+ if (t) {
3106
+ if (e < t.values.length)
3107
+ return t.atom.reportObserved(), t.dehanceValue(t.values[e]);
3108
+ console.warn(
3109
+ '[mobx.array] Attempt to read an array index (' +
3110
+ e +
3111
+ ') that is out of bounds (' +
3112
+ t.values.length +
3113
+ '). Please check length first. Out of bound indices will not be tracked by MobX',
3114
+ );
3115
+ }
3116
+ },
3117
+ set: function (e, t) {
3118
+ var r = this[re],
3119
+ n = r.values;
3120
+ if (e < n.length) {
3121
+ Be(r.atom);
3122
+ var o = n[e];
3123
+ if (Gt(r)) {
3124
+ var i = Kt(r, {
3125
+ type: 'update',
3126
+ object: r.proxy,
3127
+ index: e,
3128
+ newValue: t,
3129
+ });
3130
+ if (!i) return;
3131
+ t = i.newValue;
3132
+ }
3133
+ (t = r.enhancer(t, o)) !== o &&
3134
+ ((n[e] = t), r.notifyArrayChildUpdate(e, t, o));
3135
+ } else {
3136
+ if (e !== n.length)
3137
+ throw new Error(
3138
+ '[mobx.array] Index out of bounds, ' +
3139
+ e +
3140
+ ' is larger than ' +
3141
+ n.length,
3142
+ );
3143
+ r.spliceWithArray(e, 0, [t]);
3144
+ }
3145
+ },
3146
+ };
3147
+ [
3148
+ 'concat',
3149
+ 'flat',
3150
+ 'includes',
3151
+ 'indexOf',
3152
+ 'join',
3153
+ 'lastIndexOf',
3154
+ 'slice',
3155
+ 'toString',
3156
+ 'toLocaleString',
3157
+ ].forEach(function (e) {
3158
+ 'function' == typeof Array.prototype[e] &&
3159
+ (Xt[e] = function () {
3160
+ var t = this[re];
3161
+ t.atom.reportObserved();
3162
+ var r = t.dehanceValues(t.values);
3163
+ return r[e].apply(r, arguments);
3164
+ });
3165
+ }),
3166
+ [
3167
+ 'every',
3168
+ 'filter',
3169
+ 'find',
3170
+ 'findIndex',
3171
+ 'flatMap',
3172
+ 'forEach',
3173
+ 'map',
3174
+ 'some',
3175
+ ].forEach(function (e) {
3176
+ 'function' == typeof Array.prototype[e] &&
3177
+ (Xt[e] = function (t, r) {
3178
+ var n = this,
3179
+ o = this[re];
3180
+ return (
3181
+ o.atom.reportObserved(),
3182
+ o.dehanceValues(o.values)[e](function (e, o) {
3183
+ return t.call(r, e, o, n);
3184
+ }, r)
3185
+ );
3186
+ });
3187
+ }),
3188
+ ['reduce', 'reduceRight'].forEach(function (e) {
3189
+ Xt[e] = function () {
3190
+ var t = this,
3191
+ r = this[re];
3192
+ r.atom.reportObserved();
3193
+ var n = arguments[0];
3194
+ return (
3195
+ (arguments[0] = function (e, o, i) {
3196
+ return (o = r.dehanceValue(o)), n(e, o, i, t);
3197
+ }),
3198
+ r.values[e].apply(r.values, arguments)
3199
+ );
3200
+ };
3201
+ });
3202
+ var Yt,
3203
+ Zt = $('ObservableArrayAdministration', $t);
3204
+ function Qt(e) {
3205
+ return z(e) && Zt(e[re]);
3206
+ }
3207
+ var er,
3208
+ tr = {},
3209
+ rr = (function () {
3210
+ function e(e, t, r) {
3211
+ if (
3212
+ (void 0 === t && (t = ge),
3213
+ void 0 === r && (r = 'ObservableMap@' + q()),
3214
+ (this.enhancer = t),
3215
+ (this.name = r),
3216
+ (this[Yt] = tr),
3217
+ (this._keysAtom = ie(this.name + '.keys()')),
3218
+ (this[Symbol.toStringTag] = 'Map'),
3219
+ 'function' != typeof Map)
3220
+ )
3221
+ throw new Error(
3222
+ 'mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js',
3223
+ );
3224
+ (this._data = new Map()), (this._hasMap = new Map()), this.merge(e);
3225
+ }
3226
+ return (
3227
+ (e.prototype._has = function (e) {
3228
+ return this._data.has(e);
3229
+ }),
3230
+ (e.prototype.has = function (e) {
3231
+ var t = this;
3232
+ if (!ut.trackingDerivation) return this._has(e);
3233
+ var r = this._hasMap.get(e);
3234
+ if (!r) {
3235
+ var n = (r = new tt(
3236
+ this._has(e),
3237
+ Oe,
3238
+ this.name + '.' + Q(e) + '?',
3239
+ !1,
3240
+ ));
3241
+ this._hasMap.set(e, n),
3242
+ At(n, function () {
3243
+ return t._hasMap.delete(e);
3244
+ });
3245
+ }
3246
+ return r.get();
3247
+ }),
3248
+ (e.prototype.set = function (e, t) {
3249
+ var r = this._has(e);
3250
+ if (Gt(this)) {
3251
+ var n = Kt(this, {
3252
+ type: r ? 'update' : 'add',
3253
+ object: this,
3254
+ newValue: t,
3255
+ name: e,
3256
+ });
3257
+ if (!n) return this;
3258
+ t = n.newValue;
3259
+ }
3260
+ return r ? this._updateValue(e, t) : this._addValue(e, t), this;
3261
+ }),
3262
+ (e.prototype.delete = function (e) {
3263
+ var t = this;
3264
+ if (
3265
+ (Be(this._keysAtom), Gt(this)) &&
3266
+ !(o = Kt(this, { type: 'delete', object: this, name: e }))
3267
+ )
3268
+ return !1;
3269
+ if (this._has(e)) {
3270
+ var r = _t(),
3271
+ n = zt(this),
3272
+ o =
3273
+ n || r
3274
+ ? {
3275
+ type: 'delete',
3276
+ object: this,
3277
+ oldValue: this._data.get(e).value,
3278
+ name: e,
3279
+ }
3280
+ : null;
3281
+ return (
3282
+ r &&
3283
+ 'production' !== process.env.NODE_ENV &&
3284
+ xt(ue(ue({}, o), { name: this.name, key: e })),
3285
+ Lt(function () {
3286
+ t._keysAtom.reportChanged(),
3287
+ t._updateHasMapEntry(e, !1),
3288
+ t._data.get(e).setNewValue(void 0),
3289
+ t._data.delete(e);
3290
+ }),
3291
+ n && Ht(this, o),
3292
+ r && 'production' !== process.env.NODE_ENV && St(),
3293
+ !0
3294
+ );
3295
+ }
3296
+ return !1;
3297
+ }),
3298
+ (e.prototype._updateHasMapEntry = function (e, t) {
3299
+ var r = this._hasMap.get(e);
3300
+ r && r.setNewValue(t);
3301
+ }),
3302
+ (e.prototype._updateValue = function (e, t) {
3303
+ var r = this._data.get(e);
3304
+ if ((t = r.prepareNewValue(t)) !== ut.UNCHANGED) {
3305
+ var n = _t(),
3306
+ o = zt(this),
3307
+ i =
3308
+ o || n
3309
+ ? {
3310
+ type: 'update',
3311
+ object: this,
3312
+ oldValue: r.value,
3313
+ name: e,
3314
+ newValue: t,
3315
+ }
3316
+ : null;
3317
+ n &&
3318
+ 'production' !== process.env.NODE_ENV &&
3319
+ xt(ue(ue({}, i), { name: this.name, key: e })),
3320
+ r.setNewValue(t),
3321
+ o && Ht(this, i),
3322
+ n && 'production' !== process.env.NODE_ENV && St();
3323
+ }
3324
+ }),
3325
+ (e.prototype._addValue = function (e, t) {
3326
+ var r = this;
3327
+ Be(this._keysAtom),
3328
+ Lt(function () {
3329
+ var n = new tt(t, r.enhancer, r.name + '.' + Q(e), !1);
3330
+ r._data.set(e, n),
3331
+ (t = n.value),
3332
+ r._updateHasMapEntry(e, !0),
3333
+ r._keysAtom.reportChanged();
3334
+ });
3335
+ var n = _t(),
3336
+ o = zt(this),
3337
+ i =
3338
+ o || n ? { type: 'add', object: this, name: e, newValue: t } : null;
3339
+ n &&
3340
+ 'production' !== process.env.NODE_ENV &&
3341
+ xt(ue(ue({}, i), { name: this.name, key: e })),
3342
+ o && Ht(this, i),
3343
+ n && 'production' !== process.env.NODE_ENV && St();
3344
+ }),
3345
+ (e.prototype.get = function (e) {
3346
+ return this.has(e)
3347
+ ? this.dehanceValue(this._data.get(e).get())
3348
+ : this.dehanceValue(void 0);
3349
+ }),
3350
+ (e.prototype.dehanceValue = function (e) {
3351
+ return void 0 !== this.dehancer ? this.dehancer(e) : e;
3352
+ }),
3353
+ (e.prototype.keys = function () {
3354
+ return this._keysAtom.reportObserved(), this._data.keys();
3355
+ }),
3356
+ (e.prototype.values = function () {
3357
+ var e = this,
3358
+ t = this.keys();
3359
+ return _r({
3360
+ next: function () {
3361
+ var r = t.next(),
3362
+ n = r.done,
3363
+ o = r.value;
3364
+ return { done: n, value: n ? void 0 : e.get(o) };
3365
+ },
3366
+ });
3367
+ }),
3368
+ (e.prototype.entries = function () {
3369
+ var e = this,
3370
+ t = this.keys();
3371
+ return _r({
3372
+ next: function () {
3373
+ var r = t.next(),
3374
+ n = r.done,
3375
+ o = r.value;
3376
+ return { done: n, value: n ? void 0 : [o, e.get(o)] };
3377
+ },
3378
+ });
3379
+ }),
3380
+ (e.prototype[((Yt = re), Symbol.iterator)] = function () {
3381
+ return this.entries();
3382
+ }),
3383
+ (e.prototype.forEach = function (e, t) {
3384
+ var r, n;
3385
+ try {
3386
+ for (var o = ce(this), i = o.next(); !i.done; i = o.next()) {
3387
+ var a = le(i.value, 2),
3388
+ s = a[0],
3389
+ u = a[1];
3390
+ e.call(t, u, s, this);
3391
+ }
3392
+ } catch (e) {
3393
+ r = { error: e };
3394
+ } finally {
3395
+ try {
3396
+ i && !i.done && (n = o.return) && n.call(o);
3397
+ } finally {
3398
+ if (r) throw r.error;
3399
+ }
3400
+ }
3401
+ }),
3402
+ (e.prototype.merge = function (e) {
3403
+ var t = this;
3404
+ return (
3405
+ nr(e) && (e = e.toJS()),
3406
+ Lt(function () {
3407
+ var r = Qe(!0);
3408
+ try {
3409
+ J(e)
3410
+ ? Z(e).forEach(function (r) {
3411
+ return t.set(r, e[r]);
3412
+ })
3413
+ : Array.isArray(e)
3414
+ ? e.forEach(function (e) {
3415
+ var r = le(e, 2),
3416
+ n = r[0],
3417
+ o = r[1];
3418
+ return t.set(n, o);
3419
+ })
3420
+ : X(e)
3421
+ ? (e.constructor !== Map &&
3422
+ U(
3423
+ 'Cannot initialize from classes that inherit from Map: ' +
3424
+ e.constructor.name,
3425
+ ),
3426
+ e.forEach(function (e, r) {
3427
+ return t.set(r, e);
3428
+ }))
3429
+ : null != e && U('Cannot initialize map from ' + e);
3430
+ } finally {
3431
+ et(r);
3432
+ }
3433
+ }),
3434
+ this
3435
+ );
3436
+ }),
3437
+ (e.prototype.clear = function () {
3438
+ var e = this;
3439
+ Lt(function () {
3440
+ Ge(function () {
3441
+ var t, r;
3442
+ try {
3443
+ for (var n = ce(e.keys()), o = n.next(); !o.done; o = n.next()) {
3444
+ var i = o.value;
3445
+ e.delete(i);
3446
+ }
3447
+ } catch (e) {
3448
+ t = { error: e };
3449
+ } finally {
3450
+ try {
3451
+ o && !o.done && (r = n.return) && r.call(n);
3452
+ } finally {
3453
+ if (t) throw t.error;
3454
+ }
3455
+ }
3456
+ });
3457
+ });
3458
+ }),
3459
+ (e.prototype.replace = function (e) {
3460
+ var t = this;
3461
+ return (
3462
+ Lt(function () {
3463
+ var r,
3464
+ n,
3465
+ o,
3466
+ i,
3467
+ a = (function (e) {
3468
+ if (X(e) || nr(e)) return e;
3469
+ if (Array.isArray(e)) return new Map(e);
3470
+ if (J(e)) {
3471
+ var t = new Map();
3472
+ for (var r in e) t.set(r, e[r]);
3473
+ return t;
3474
+ }
3475
+ return U("Cannot convert to map from '" + e + "'");
3476
+ })(e),
3477
+ s = new Map(),
3478
+ u = !1;
3479
+ try {
3480
+ for (
3481
+ var c = ce(t._data.keys()), l = c.next();
3482
+ !l.done;
3483
+ l = c.next()
3484
+ ) {
3485
+ var p = l.value;
3486
+ if (!a.has(p))
3487
+ if (t.delete(p)) u = !0;
3488
+ else {
3489
+ var d = t._data.get(p);
3490
+ s.set(p, d);
3491
+ }
3492
+ }
3493
+ } catch (e) {
3494
+ r = { error: e };
3495
+ } finally {
3496
+ try {
3497
+ l && !l.done && (n = c.return) && n.call(c);
3498
+ } finally {
3499
+ if (r) throw r.error;
3500
+ }
3501
+ }
3502
+ try {
3503
+ for (
3504
+ var f = ce(a.entries()), h = f.next();
3505
+ !h.done;
3506
+ h = f.next()
3507
+ ) {
3508
+ var v = le(h.value, 2),
3509
+ y = ((p = v[0]), (d = v[1]), t._data.has(p));
3510
+ if ((t.set(p, d), t._data.has(p))) {
3511
+ var b = t._data.get(p);
3512
+ s.set(p, b), y || (u = !0);
3513
+ }
3514
+ }
3515
+ } catch (e) {
3516
+ o = { error: e };
3517
+ } finally {
3518
+ try {
3519
+ h && !h.done && (i = f.return) && i.call(f);
3520
+ } finally {
3521
+ if (o) throw o.error;
3522
+ }
3523
+ }
3524
+ if (!u)
3525
+ if (t._data.size !== s.size) t._keysAtom.reportChanged();
3526
+ else
3527
+ for (
3528
+ var m = t._data.keys(),
3529
+ g = s.keys(),
3530
+ O = m.next(),
3531
+ E = g.next();
3532
+ !O.done;
3533
+
3534
+ ) {
3535
+ if (O.value !== E.value) {
3536
+ t._keysAtom.reportChanged();
3537
+ break;
3538
+ }
3539
+ (O = m.next()), (E = g.next());
3540
+ }
3541
+ t._data = s;
3542
+ }),
3543
+ this
3544
+ );
3545
+ }),
3546
+ Object.defineProperty(e.prototype, 'size', {
3547
+ get: function () {
3548
+ return this._keysAtom.reportObserved(), this._data.size;
3549
+ },
3550
+ enumerable: !0,
3551
+ configurable: !0,
3552
+ }),
3553
+ (e.prototype.toPOJO = function () {
3554
+ var e,
3555
+ t,
3556
+ r = {};
3557
+ try {
3558
+ for (var n = ce(this), o = n.next(); !o.done; o = n.next()) {
3559
+ var i = le(o.value, 2),
3560
+ a = i[0],
3561
+ s = i[1];
3562
+ r['symbol' == typeof a ? a : Q(a)] = s;
3563
+ }
3564
+ } catch (t) {
3565
+ e = { error: t };
3566
+ } finally {
3567
+ try {
3568
+ o && !o.done && (t = n.return) && t.call(n);
3569
+ } finally {
3570
+ if (e) throw e.error;
3571
+ }
3572
+ }
3573
+ return r;
3574
+ }),
3575
+ (e.prototype.toJS = function () {
3576
+ return new Map(this);
3577
+ }),
3578
+ (e.prototype.toJSON = function () {
3579
+ return this.toPOJO();
3580
+ }),
3581
+ (e.prototype.toString = function () {
3582
+ var e = this;
3583
+ return (
3584
+ this.name +
3585
+ '[{ ' +
3586
+ Array.from(this.keys())
3587
+ .map(function (t) {
3588
+ return Q(t) + ': ' + e.get(t);
3589
+ })
3590
+ .join(', ') +
3591
+ ' }]'
3592
+ );
3593
+ }),
3594
+ (e.prototype.observe = function (e, t) {
3595
+ return (
3596
+ 'production' !== process.env.NODE_ENV &&
3597
+ G(
3598
+ !0 !== t,
3599
+ "`observe` doesn't support fireImmediately=true in combination with maps.",
3600
+ ),
3601
+ Jt(this, e)
3602
+ );
3603
+ }),
3604
+ (e.prototype.intercept = function (e) {
3605
+ return Ft(this, e);
3606
+ }),
3607
+ e
3608
+ );
3609
+ })(),
3610
+ nr = $('ObservableMap', rr),
3611
+ or = {},
3612
+ ir = (function () {
3613
+ function e(e, t, r) {
3614
+ if (
3615
+ (void 0 === t && (t = ge),
3616
+ void 0 === r && (r = 'ObservableSet@' + q()),
3617
+ (this.name = r),
3618
+ (this[er] = or),
3619
+ (this._data = new Set()),
3620
+ (this._atom = ie(this.name)),
3621
+ (this[Symbol.toStringTag] = 'Set'),
3622
+ 'function' != typeof Set)
3623
+ )
3624
+ throw new Error(
3625
+ 'mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js',
3626
+ );
3627
+ (this.enhancer = function (e, n) {
3628
+ return t(e, n, r);
3629
+ }),
3630
+ e && this.replace(e);
3631
+ }
3632
+ return (
3633
+ (e.prototype.dehanceValue = function (e) {
3634
+ return void 0 !== this.dehancer ? this.dehancer(e) : e;
3635
+ }),
3636
+ (e.prototype.clear = function () {
3637
+ var e = this;
3638
+ Lt(function () {
3639
+ Ge(function () {
3640
+ var t, r;
3641
+ try {
3642
+ for (
3643
+ var n = ce(e._data.values()), o = n.next();
3644
+ !o.done;
3645
+ o = n.next()
3646
+ ) {
3647
+ var i = o.value;
3648
+ e.delete(i);
3649
+ }
3650
+ } catch (e) {
3651
+ t = { error: e };
3652
+ } finally {
3653
+ try {
3654
+ o && !o.done && (r = n.return) && r.call(n);
3655
+ } finally {
3656
+ if (t) throw t.error;
3657
+ }
3658
+ }
3659
+ });
3660
+ });
3661
+ }),
3662
+ (e.prototype.forEach = function (e, t) {
3663
+ var r, n;
3664
+ try {
3665
+ for (var o = ce(this), i = o.next(); !i.done; i = o.next()) {
3666
+ var a = i.value;
3667
+ e.call(t, a, a, this);
3668
+ }
3669
+ } catch (e) {
3670
+ r = { error: e };
3671
+ } finally {
3672
+ try {
3673
+ i && !i.done && (n = o.return) && n.call(o);
3674
+ } finally {
3675
+ if (r) throw r.error;
3676
+ }
3677
+ }
3678
+ }),
3679
+ Object.defineProperty(e.prototype, 'size', {
3680
+ get: function () {
3681
+ return this._atom.reportObserved(), this._data.size;
3682
+ },
3683
+ enumerable: !0,
3684
+ configurable: !0,
3685
+ }),
3686
+ (e.prototype.add = function (e) {
3687
+ var t = this;
3688
+ if (
3689
+ (Be(this._atom), Gt(this)) &&
3690
+ !(o = Kt(this, { type: 'add', object: this, newValue: e }))
3691
+ )
3692
+ return this;
3693
+ if (!this.has(e)) {
3694
+ Lt(function () {
3695
+ t._data.add(t.enhancer(e, void 0)), t._atom.reportChanged();
3696
+ });
3697
+ var r = _t(),
3698
+ n = zt(this),
3699
+ o = n || r ? { type: 'add', object: this, newValue: e } : null;
3700
+ r && 'production' !== process.env.NODE_ENV && xt(o),
3701
+ n && Ht(this, o),
3702
+ r && 'production' !== process.env.NODE_ENV && St();
3703
+ }
3704
+ return this;
3705
+ }),
3706
+ (e.prototype.delete = function (e) {
3707
+ var t = this;
3708
+ if (
3709
+ Gt(this) &&
3710
+ !(o = Kt(this, { type: 'delete', object: this, oldValue: e }))
3711
+ )
3712
+ return !1;
3713
+ if (this.has(e)) {
3714
+ var r = _t(),
3715
+ n = zt(this),
3716
+ o = n || r ? { type: 'delete', object: this, oldValue: e } : null;
3717
+ return (
3718
+ r &&
3719
+ 'production' !== process.env.NODE_ENV &&
3720
+ xt(ue(ue({}, o), { name: this.name })),
3721
+ Lt(function () {
3722
+ t._atom.reportChanged(), t._data.delete(e);
3723
+ }),
3724
+ n && Ht(this, o),
3725
+ r && 'production' !== process.env.NODE_ENV && St(),
3726
+ !0
3727
+ );
3728
+ }
3729
+ return !1;
3730
+ }),
3731
+ (e.prototype.has = function (e) {
3732
+ return (
3733
+ this._atom.reportObserved(), this._data.has(this.dehanceValue(e))
3734
+ );
3735
+ }),
3736
+ (e.prototype.entries = function () {
3737
+ var e = 0,
3738
+ t = Array.from(this.keys()),
3739
+ r = Array.from(this.values());
3740
+ return _r({
3741
+ next: function () {
3742
+ var n = e;
3743
+ return (
3744
+ (e += 1),
3745
+ n < r.length ? { value: [t[n], r[n]], done: !1 } : { done: !0 }
3746
+ );
3747
+ },
3748
+ });
3749
+ }),
3750
+ (e.prototype.keys = function () {
3751
+ return this.values();
3752
+ }),
3753
+ (e.prototype.values = function () {
3754
+ this._atom.reportObserved();
3755
+ var e = this,
3756
+ t = 0,
3757
+ r = Array.from(this._data.values());
3758
+ return _r({
3759
+ next: function () {
3760
+ return t < r.length
3761
+ ? { value: e.dehanceValue(r[t++]), done: !1 }
3762
+ : { done: !0 };
3763
+ },
3764
+ });
3765
+ }),
3766
+ (e.prototype.replace = function (e) {
3767
+ var t = this;
3768
+ return (
3769
+ ar(e) && (e = e.toJS()),
3770
+ Lt(function () {
3771
+ var r = Qe(!0);
3772
+ try {
3773
+ Array.isArray(e) || Y(e)
3774
+ ? (t.clear(),
3775
+ e.forEach(function (e) {
3776
+ return t.add(e);
3777
+ }))
3778
+ : null != e && U('Cannot initialize set from ' + e);
3779
+ } finally {
3780
+ et(r);
3781
+ }
3782
+ }),
3783
+ this
3784
+ );
3785
+ }),
3786
+ (e.prototype.observe = function (e, t) {
3787
+ return (
3788
+ 'production' !== process.env.NODE_ENV &&
3789
+ G(
3790
+ !0 !== t,
3791
+ "`observe` doesn't support fireImmediately=true in combination with sets.",
3792
+ ),
3793
+ Jt(this, e)
3794
+ );
3795
+ }),
3796
+ (e.prototype.intercept = function (e) {
3797
+ return Ft(this, e);
3798
+ }),
3799
+ (e.prototype.toJS = function () {
3800
+ return new Set(this);
3801
+ }),
3802
+ (e.prototype.toString = function () {
3803
+ return this.name + '[ ' + Array.from(this).join(', ') + ' ]';
3804
+ }),
3805
+ (e.prototype[((er = re), Symbol.iterator)] = function () {
3806
+ return this.values();
3807
+ }),
3808
+ e
3809
+ );
3810
+ })(),
3811
+ ar = $('ObservableSet', ir),
3812
+ sr = (function () {
3813
+ function e(e, t, r, n) {
3814
+ void 0 === t && (t = new Map()),
3815
+ (this.target = e),
3816
+ (this.values = t),
3817
+ (this.name = r),
3818
+ (this.defaultEnhancer = n),
3819
+ (this.keysAtom = new ne(r + '.keys'));
3820
+ }
3821
+ return (
3822
+ (e.prototype.read = function (e) {
3823
+ return this.values.get(e).get();
3824
+ }),
3825
+ (e.prototype.write = function (e, t) {
3826
+ var r = this.target,
3827
+ n = this.values.get(e);
3828
+ if (n instanceof rt) n.set(t);
3829
+ else {
3830
+ if (Gt(this)) {
3831
+ if (
3832
+ !(a = Kt(this, {
3833
+ type: 'update',
3834
+ object: this.proxy || r,
3835
+ name: e,
3836
+ newValue: t,
3837
+ }))
3838
+ )
3839
+ return;
3840
+ t = a.newValue;
3841
+ }
3842
+ if ((t = n.prepareNewValue(t)) !== ut.UNCHANGED) {
3843
+ var o = zt(this),
3844
+ i = _t(),
3845
+ a =
3846
+ o || i
3847
+ ? {
3848
+ type: 'update',
3849
+ object: this.proxy || r,
3850
+ oldValue: n.value,
3851
+ name: e,
3852
+ newValue: t,
3853
+ }
3854
+ : null;
3855
+ i &&
3856
+ 'production' !== process.env.NODE_ENV &&
3857
+ xt(ue(ue({}, a), { name: this.name, key: e })),
3858
+ n.setNewValue(t),
3859
+ o && Ht(this, a),
3860
+ i && 'production' !== process.env.NODE_ENV && St();
3861
+ }
3862
+ }
3863
+ }),
3864
+ (e.prototype.has = function (e) {
3865
+ var t = this.pendingKeys || (this.pendingKeys = new Map()),
3866
+ r = t.get(e);
3867
+ if (r) return r.get();
3868
+ var n = !!this.values.get(e);
3869
+ return (
3870
+ (r = new tt(n, Oe, this.name + '.' + Q(e) + '?', !1)),
3871
+ t.set(e, r),
3872
+ r.get()
3873
+ );
3874
+ }),
3875
+ (e.prototype.addObservableProp = function (e, t, r) {
3876
+ void 0 === r && (r = this.defaultEnhancer);
3877
+ var n,
3878
+ o,
3879
+ i = this.target;
3880
+ if (
3881
+ ((n = i),
3882
+ (o = e),
3883
+ 'production' === process.env.NODE_ENV ||
3884
+ W(n, o) ||
3885
+ U(
3886
+ "Cannot make property '" +
3887
+ o.toString() +
3888
+ "' observable, it is not configurable and writable in the target object",
3889
+ ),
3890
+ Gt(this))
3891
+ ) {
3892
+ var a = Kt(this, {
3893
+ object: this.proxy || i,
3894
+ name: e,
3895
+ type: 'add',
3896
+ newValue: t,
3897
+ });
3898
+ if (!a) return;
3899
+ t = a.newValue;
3900
+ }
3901
+ var s = new tt(t, r, this.name + '.' + Q(e), !1);
3902
+ this.values.set(e, s),
3903
+ (t = s.value),
3904
+ Object.defineProperty(
3905
+ i,
3906
+ e,
3907
+ (function (e) {
3908
+ return (
3909
+ cr[e] ||
3910
+ (cr[e] = {
3911
+ configurable: !0,
3912
+ enumerable: !0,
3913
+ get: function () {
3914
+ return this[re].read(e);
3915
+ },
3916
+ set: function (t) {
3917
+ this[re].write(e, t);
3918
+ },
3919
+ })
3920
+ );
3921
+ })(e),
3922
+ ),
3923
+ this.notifyPropertyAddition(e, t);
3924
+ }),
3925
+ (e.prototype.addComputedProp = function (e, t, r) {
3926
+ var n = this.target;
3927
+ (r.name = r.name || this.name + '.' + Q(t)),
3928
+ this.values.set(t, new rt(r)),
3929
+ (e === n || W(e, t)) &&
3930
+ Object.defineProperty(
3931
+ e,
3932
+ t,
3933
+ (function (e) {
3934
+ return (
3935
+ lr[e] ||
3936
+ (lr[e] = {
3937
+ configurable: ut.computedConfigurable,
3938
+ enumerable: !1,
3939
+ get: function () {
3940
+ return pr(this).read(e);
3941
+ },
3942
+ set: function (t) {
3943
+ pr(this).write(e, t);
3944
+ },
3945
+ })
3946
+ );
3947
+ })(t),
3948
+ );
3949
+ }),
3950
+ (e.prototype.remove = function (e) {
3951
+ if (this.values.has(e)) {
3952
+ var t = this.target;
3953
+ if (Gt(this))
3954
+ if (
3955
+ !(s = Kt(this, {
3956
+ object: this.proxy || t,
3957
+ name: e,
3958
+ type: 'remove',
3959
+ }))
3960
+ )
3961
+ return;
3962
+ try {
3963
+ dt();
3964
+ var r = zt(this),
3965
+ n = _t(),
3966
+ o = this.values.get(e),
3967
+ i = o && o.get();
3968
+ if (
3969
+ (o && o.set(void 0),
3970
+ this.keysAtom.reportChanged(),
3971
+ this.values.delete(e),
3972
+ this.pendingKeys)
3973
+ ) {
3974
+ var a = this.pendingKeys.get(e);
3975
+ a && a.set(!1);
3976
+ }
3977
+ delete this.target[e];
3978
+ var s =
3979
+ r || n
3980
+ ? {
3981
+ type: 'remove',
3982
+ object: this.proxy || t,
3983
+ oldValue: i,
3984
+ name: e,
3985
+ }
3986
+ : null;
3987
+ n &&
3988
+ 'production' !== process.env.NODE_ENV &&
3989
+ xt(ue(ue({}, s), { name: this.name, key: e })),
3990
+ r && Ht(this, s),
3991
+ n && 'production' !== process.env.NODE_ENV && St();
3992
+ } finally {
3993
+ ft();
3994
+ }
3995
+ }
3996
+ }),
3997
+ (e.prototype.illegalAccess = function (e, t) {
3998
+ console.warn(
3999
+ "Property '" +
4000
+ t +
4001
+ "' of '" +
4002
+ e +
4003
+ "' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner",
4004
+ );
4005
+ }),
4006
+ (e.prototype.observe = function (e, t) {
4007
+ return (
4008
+ 'production' !== process.env.NODE_ENV &&
4009
+ G(
4010
+ !0 !== t,
4011
+ "`observe` doesn't support the fire immediately property for observable objects.",
4012
+ ),
4013
+ Jt(this, e)
4014
+ );
4015
+ }),
4016
+ (e.prototype.intercept = function (e) {
4017
+ return Ft(this, e);
4018
+ }),
4019
+ (e.prototype.notifyPropertyAddition = function (e, t) {
4020
+ var r = zt(this),
4021
+ n = _t(),
4022
+ o =
4023
+ r || n
4024
+ ? {
4025
+ type: 'add',
4026
+ object: this.proxy || this.target,
4027
+ name: e,
4028
+ newValue: t,
4029
+ }
4030
+ : null;
4031
+ if (
4032
+ (n &&
4033
+ 'production' !== process.env.NODE_ENV &&
4034
+ xt(ue(ue({}, o), { name: this.name, key: e })),
4035
+ r && Ht(this, o),
4036
+ n && 'production' !== process.env.NODE_ENV && St(),
4037
+ this.pendingKeys)
4038
+ ) {
4039
+ var i = this.pendingKeys.get(e);
4040
+ i && i.set(!0);
4041
+ }
4042
+ this.keysAtom.reportChanged();
4043
+ }),
4044
+ (e.prototype.getKeys = function () {
4045
+ var e, t;
4046
+ this.keysAtom.reportObserved();
4047
+ var r = [];
4048
+ try {
4049
+ for (var n = ce(this.values), o = n.next(); !o.done; o = n.next()) {
4050
+ var i = le(o.value, 2),
4051
+ a = i[0];
4052
+ i[1] instanceof tt && r.push(a);
4053
+ }
4054
+ } catch (t) {
4055
+ e = { error: t };
4056
+ } finally {
4057
+ try {
4058
+ o && !o.done && (t = n.return) && t.call(n);
4059
+ } finally {
4060
+ if (e) throw e.error;
4061
+ }
4062
+ }
4063
+ return r;
4064
+ }),
4065
+ e
4066
+ );
4067
+ })();
4068
+ function ur(e, t, r) {
4069
+ if (
4070
+ (void 0 === t && (t = ''),
4071
+ void 0 === r && (r = ge),
4072
+ Object.prototype.hasOwnProperty.call(e, re))
4073
+ )
4074
+ return e[re];
4075
+ 'production' !== process.env.NODE_ENV &&
4076
+ G(
4077
+ Object.isExtensible(e),
4078
+ 'Cannot make the designated object observable; it is not extensible',
4079
+ ),
4080
+ J(e) || (t = (e.constructor.name || 'ObservableObject') + '@' + q()),
4081
+ t || (t = 'ObservableObject@' + q());
4082
+ var n = new sr(e, new Map(), Q(t), r);
4083
+ return H(e, re, n), n;
4084
+ }
4085
+ var cr = Object.create(null),
4086
+ lr = Object.create(null);
4087
+ function pr(e) {
4088
+ var t = e[re];
4089
+ return t || (ye(e), e[re]);
4090
+ }
4091
+ var dr = $('ObservableObjectAdministration', sr);
4092
+ function fr(e) {
4093
+ return !!z(e) && (ye(e), dr(e[re]));
4094
+ }
4095
+ function hr(e, t) {
4096
+ if ('object' == typeof e && null !== e) {
4097
+ if (Qt(e))
4098
+ return (
4099
+ void 0 !== t &&
4100
+ U(
4101
+ 'production' !== process.env.NODE_ENV &&
4102
+ 'It is not possible to get index atoms from arrays',
4103
+ ),
4104
+ e[re].atom
4105
+ );
4106
+ if (ar(e)) return e[re];
4107
+ if (nr(e)) {
4108
+ var r = e;
4109
+ return void 0 === t
4110
+ ? r._keysAtom
4111
+ : ((n = r._data.get(t) || r._hasMap.get(t)) ||
4112
+ U(
4113
+ 'production' !== process.env.NODE_ENV &&
4114
+ "the entry '" +
4115
+ t +
4116
+ "' does not exist in the observable map '" +
4117
+ yr(e) +
4118
+ "'",
4119
+ ),
4120
+ n);
4121
+ }
4122
+ var n;
4123
+ if ((ye(e), t && !e[re] && e[t], fr(e)))
4124
+ return t
4125
+ ? ((n = e[re].values.get(t)) ||
4126
+ U(
4127
+ 'production' !== process.env.NODE_ENV &&
4128
+ "no observable property '" +
4129
+ t +
4130
+ "' found on the observable object '" +
4131
+ yr(e) +
4132
+ "'",
4133
+ ),
4134
+ n)
4135
+ : U(
4136
+ 'production' !== process.env.NODE_ENV &&
4137
+ 'please specify a property',
4138
+ );
4139
+ if (oe(e) || nt(e) || Nt(e)) return e;
4140
+ } else if ('function' == typeof e && Nt(e[re])) return e[re];
4141
+ return U(
4142
+ 'production' !== process.env.NODE_ENV && 'Cannot obtain atom from ' + e,
4143
+ );
4144
+ }
4145
+ function vr(e, t) {
4146
+ return (
4147
+ e || U('Expecting some object'),
4148
+ void 0 !== t
4149
+ ? vr(hr(e, t))
4150
+ : oe(e) || nt(e) || Nt(e) || nr(e) || ar(e)
4151
+ ? e
4152
+ : (ye(e),
4153
+ e[re]
4154
+ ? e[re]
4155
+ : void U(
4156
+ 'production' !== process.env.NODE_ENV &&
4157
+ 'Cannot obtain administration from ' + e,
4158
+ ))
4159
+ );
4160
+ }
4161
+ function yr(e, t) {
4162
+ return (void 0 !== t ? hr(e, t) : fr(e) || nr(e) || ar(e) ? vr(e) : hr(e))
4163
+ .name;
4164
+ }
4165
+ var br,
4166
+ mr = Object.prototype.toString;
4167
+ function gr(e, t, r) {
4168
+ return void 0 === r && (r = -1), Or(e, t, r);
4169
+ }
4170
+ function Or(e, t, r, n, o) {
4171
+ if (e === t) return 0 !== e || 1 / e == 1 / t;
4172
+ if (null == e || null == t) return !1;
4173
+ if (e != e) return t != t;
4174
+ var i = typeof e;
4175
+ if ('function' !== i && 'object' !== i && 'object' != typeof t) return !1;
4176
+ var a = mr.call(e);
4177
+ if (a !== mr.call(t)) return !1;
4178
+ switch (a) {
4179
+ case '[object RegExp]':
4180
+ case '[object String]':
4181
+ return '' + e == '' + t;
4182
+ case '[object Number]':
4183
+ return +e != +e ? +t != +t : 0 == +e ? 1 / +e == 1 / t : +e == +t;
4184
+ case '[object Date]':
4185
+ case '[object Boolean]':
4186
+ return +e == +t;
4187
+ case '[object Symbol]':
4188
+ return (
4189
+ 'undefined' != typeof Symbol &&
4190
+ Symbol.valueOf.call(e) === Symbol.valueOf.call(t)
4191
+ );
4192
+ case '[object Map]':
4193
+ case '[object Set]':
4194
+ r >= 0 && r++;
4195
+ }
4196
+ (e = Er(e)), (t = Er(t));
4197
+ var s = '[object Array]' === a;
4198
+ if (!s) {
4199
+ if ('object' != typeof e || 'object' != typeof t) return !1;
4200
+ var u = e.constructor,
4201
+ c = t.constructor;
4202
+ if (
4203
+ u !== c &&
4204
+ !(
4205
+ 'function' == typeof u &&
4206
+ u instanceof u &&
4207
+ 'function' == typeof c &&
4208
+ c instanceof c
4209
+ ) &&
4210
+ 'constructor' in e &&
4211
+ 'constructor' in t
4212
+ )
4213
+ return !1;
4214
+ }
4215
+ if (0 === r) return !1;
4216
+ r < 0 && (r = -1), (o = o || []);
4217
+ for (var l = (n = n || []).length; l--; ) if (n[l] === e) return o[l] === t;
4218
+ if ((n.push(e), o.push(t), s)) {
4219
+ if ((l = e.length) !== t.length) return !1;
4220
+ for (; l--; ) if (!Or(e[l], t[l], r - 1, n, o)) return !1;
4221
+ } else {
4222
+ var p = Object.keys(e),
4223
+ d = void 0;
4224
+ if (((l = p.length), Object.keys(t).length !== l)) return !1;
4225
+ for (; l--; )
4226
+ if (!Nr(t, (d = p[l])) || !Or(e[d], t[d], r - 1, n, o)) return !1;
4227
+ }
4228
+ return n.pop(), o.pop(), !0;
4229
+ }
4230
+ function Er(e) {
4231
+ return Qt(e)
4232
+ ? e.slice()
4233
+ : X(e) || nr(e) || Y(e) || ar(e)
4234
+ ? Array.from(e.entries())
4235
+ : e;
4236
+ }
4237
+ function Nr(e, t) {
4238
+ return Object.prototype.hasOwnProperty.call(e, t);
4239
+ }
4240
+ function _r(e) {
4241
+ return (e[Symbol.iterator] = wr), e;
4242
+ }
4243
+ function wr() {
4244
+ return this;
4245
+ }
4246
+ if ('undefined' == typeof Proxy || 'undefined' == typeof Symbol)
4247
+ throw new Error(
4248
+ "[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.",
4249
+ );
4250
+ try {
4251
+ process.env.NODE_ENV;
4252
+ } catch (e) {
4253
+ var xr = at();
4254
+ 'undefined' == typeof process && (xr.process = {}), (xr.process.env = {});
4255
+ }
4256
+ !(function () {
4257
+ if (
4258
+ 'testCodeMinification' !== function () {}.name &&
4259
+ 'production' !== process.env.NODE_ENV &&
4260
+ 'undefined' != typeof process &&
4261
+ 'true' !== process.env.IGNORE_MOBX_MINIFY_WARNING
4262
+ ) {
4263
+ var e = ['process', 'env', 'NODE_ENV'].join('.');
4264
+ console.warn(
4265
+ "[mobx] you are running a minified build, but '" +
4266
+ e +
4267
+ "' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle",
4268
+ );
4269
+ }
4270
+ })(),
4271
+ 'object' == typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ &&
4272
+ __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
4273
+ spy: function (e) {
4274
+ return 'production' === process.env.NODE_ENV
4275
+ ? (console.warn('[mobx.spy] Is a no-op in production builds'),
4276
+ function () {})
4277
+ : (ut.spyListeners.push(e),
4278
+ F(function () {
4279
+ ut.spyListeners = ut.spyListeners.filter(function (t) {
4280
+ return t !== e;
4281
+ });
4282
+ }));
4283
+ },
4284
+ extras: { getDebugName: yr },
4285
+ $mobx: re,
4286
+ });
4287
+ var jr =
4288
+ (((br = {
4289
+ array: 'array',
4290
+ boolean: 'boolean',
4291
+ 'box-style': 'object',
4292
+ codearea: 'string',
4293
+ color: 'string',
4294
+ datasource: 'object',
4295
+ date: 'string',
4296
+ 'date-time': 'string',
4297
+ 'dynamic-data': 'object',
4298
+ event: 'object',
4299
+ 'func-body': 'string',
4300
+ htmlarea: 'string',
4301
+ image: 'string',
4302
+ input: 'string',
4303
+ json: 'string',
4304
+ number: 'number',
4305
+ object: 'object',
4306
+ quantity: 'object',
4307
+ radio: 'string',
4308
+ select: 'array',
4309
+ }).select = 'string'),
4310
+ (br.textarea = 'string'),
4311
+ (br['text-editor'] = 'string'),
4312
+ (br.time = 'string'),
4313
+ (br.url = 'string'),
4314
+ (br['dynamic-config'] = 'object'),
4315
+ (br['sohu-source'] = 'object'),
4316
+ (br['sohu-event'] = 'object'),
4317
+ br);
4318
+ function Sr(e) {
4319
+ return jr[e] || e;
4320
+ }
4321
+ function Dr(e, t) {
4322
+ jr[e]
4323
+ ? console.warn('当前已经存在' + e + '(' + jr[e] + '),暂时不支持覆盖。')
4324
+ : (jr[e] = t);
4325
+ }
4326
+ function Ar(e) {
4327
+ var t = !0;
4328
+ if (!e) return t;
4329
+ var r = e.type;
4330
+ return (
4331
+ (('object' === r &&
4332
+ e.properties &&
4333
+ e.propertyOrder &&
4334
+ e.propertyOrder.length > 0) ||
4335
+ ('array' === r &&
4336
+ e.items &&
4337
+ e.items.properties &&
4338
+ e.items.propertyOrder &&
4339
+ e.items.propertyOrder.length > 0) ||
4340
+ (e.type && 'array' !== e.type && 'object' !== e.type) ||
4341
+ e.type) &&
4342
+ (t = !1),
4343
+ t
4344
+ );
4345
+ }
4346
+ function Vr(e) {
4347
+ var t = !1,
4348
+ r = e.lastUpdateTime,
4349
+ n = new Date('2024-10-05T00:01:00.691Z').getTime();
4350
+ return r && new Date(r).getTime() >= n && (t = !0), t;
4351
+ }
4352
+ function Cr(e) {
4353
+ var t = !1,
4354
+ r = Sr(e.type),
4355
+ n = void 0 === e.isContainer || e.isContainer;
4356
+ return 'object' === r && n && (t = !0), t;
4357
+ }
4358
+ function Tr(e) {
4359
+ var t = !0;
4360
+ return (
4361
+ 'object' === e.type && e.propertyOrder && e.properties
4362
+ ? e.propertyOrder.map(function (r) {
4363
+ var n = e.properties[r];
4364
+ ('object' === e.type && n.propertyOrder && n.properties) || (t = !1);
4365
+ })
4366
+ : (t = !1),
4367
+ t
4368
+ );
4369
+ }
4370
+ function kr(e, t) {
4371
+ var r = e.split('-'),
4372
+ n = t.split('-');
4373
+ return r.pop(), n.pop(), r.join('-') === n.join('-');
4374
+ }
4375
+ function Rr(e, t) {
4376
+ for (
4377
+ var r = e.split('-'),
4378
+ n = t.split('-'),
4379
+ o = 'before',
4380
+ i = 0,
4381
+ a = (r.length > n.length ? n : r).length;
4382
+ i < a;
4383
+ i += 1
4384
+ ) {
4385
+ Number(r[i]) > Number(n[i]) && (o = 'after');
4386
+ }
4387
+ return o;
4388
+ }
4389
+ function Pr(e) {
4390
+ var t = e.split('-');
4391
+ return t.pop(), t.join('-');
4392
+ }
4393
+ function Ir(e) {
4394
+ var t = e.split('-'),
4395
+ r = t.pop(),
4396
+ n = Number(r) + 1;
4397
+ return t.push('' + n), t.join('-');
4398
+ }
4399
+ function Mr(e) {
4400
+ var t = e.split('-'),
4401
+ r = t.pop();
4402
+ return [t.join('-'), r];
4403
+ }
4404
+ function Lr(e) {
4405
+ var t = e.split('-'),
4406
+ r = t.pop();
4407
+ return t.push(Number(r) - 1), t.join('-');
4408
+ }
4409
+ function Br(e) {
4410
+ var t = e.split('-'),
4411
+ r = t.pop();
4412
+ return t.push(Number(r) + 1), t.join('-');
4413
+ }
4414
+ function qr(e, t) {
4415
+ var r = '',
4416
+ n = !1;
4417
+ return (
4418
+ e.options && e.options[0] && ((r = e.options[0].value), (n = !0)),
4419
+ (t || e.multiple) && (r = n ? [r] : []),
4420
+ r
4421
+ );
4422
+ }
4423
+ function Ur(e, t) {
4424
+ var r = '',
4425
+ n = t;
4426
+ i(n) && i(e.default) && typeof n != typeof e.default && (n = void 0);
4427
+ var o = i(n) ? n : e.default;
4428
+ switch (e.type) {
4429
+ case 'select':
4430
+ case 'radio':
4431
+ r = o || qr(e);
4432
+ break;
4433
+ case 'checkboxes':
4434
+ r = o || qr(e, !0);
4435
+ break;
4436
+ case 'color':
4437
+ ('#fff' !== o && '#FFF' !== o) || (o = '#ffffff'),
4438
+ (r = i(o) ? o : '#ffffff');
4439
+ break;
4440
+ case 'boolean':
4441
+ r = !!i(o) && o;
4442
+ break;
4443
+ case 'number':
4444
+ r = i(o) ? o : 1;
4445
+ break;
4446
+ case 'json':
4447
+ var a = '';
4448
+ if (A(o) || S(o)) a = o;
4449
+ else if (T(o) || '' === o) a = {};
4450
+ else
4451
+ try {
4452
+ a = JSON.parse(o);
4453
+ } catch (e) {
4454
+ a = {};
4455
+ }
4456
+ r = a;
4457
+ break;
4458
+ default:
4459
+ r =
4460
+ 'input' === e.type && '0' === e.default
4461
+ ? o || e.default
4462
+ : i(o)
4463
+ ? o
4464
+ : '';
4465
+ }
4466
+ return r;
4467
+ }
4468
+ function Gr(e, t) {
4469
+ var r = {},
4470
+ o = e.type;
4471
+ if (A(e) && 'object' === Sr(e.type)) {
4472
+ var a = e,
4473
+ s = t;
4474
+ i(s) && i(a.default) && typeof s != typeof a.default && (s = void 0);
4475
+ var u = i(s) ? s : a.default;
4476
+ if ('dynamic-data' === o)
4477
+ (r = n(y)),
4478
+ u && A(u) && '{}' !== JSON.stringify(u) && (r = Object.assign(r, u));
4479
+ else if ('datasource' === o)
4480
+ a.properties &&
4481
+ a.properties.type &&
4482
+ a.properties.type.default &&
4483
+ 'local' === a.properties.type.default
4484
+ ? ((r = { data: '{}', filter: '() => {}' }),
4485
+ u && u.data && (r.data = u.data),
4486
+ u && u.filter && (r.filter = u.filter),
4487
+ 'http://xxx' === r.data && (r.data = '{}'))
4488
+ : ((r = { data: 'http://xxx', filter: '() => {}' }),
4489
+ u && u.data && (r.data = u.data),
4490
+ u && u.filter && (r.filter = u.filter),
4491
+ '{}' === r.data && (r.data = 'http://xxx'));
4492
+ else if ('event' === o)
4493
+ a.properties &&
4494
+ a.properties.type &&
4495
+ a.properties.type.default &&
4496
+ 'emit' === a.properties.type.default
4497
+ ? u && 'out' === u.type
4498
+ ? (r = { trigger: (u && u.filter) || 'eventName', eventData: '{}' })
4499
+ : ((r = { trigger: 'eventName', eventData: '{}' }),
4500
+ u && u.trigger && (r.trigger = u.trigger),
4501
+ u && u.eventData && (r.eventData = u.eventData))
4502
+ : u && 'in' === u.type
4503
+ ? (r = {
4504
+ register: 'eventName',
4505
+ actionFunc: (u && u.filter) || '() => {}',
4506
+ })
4507
+ : ((r = { register: 'eventName', actionFunc: '() => {}' }),
4508
+ u && u.register && (r.register = u.register),
4509
+ u && u.actionFunc && (r.actionFunc = u.actionFunc));
4510
+ else if (!1 === e.isContainer && u && A(u) && '{}' !== JSON.stringify(u))
4511
+ r = Object.assign(r, u);
4512
+ else if (e.properties) {
4513
+ (e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
4514
+ function (n) {
4515
+ var o = e.properties[n],
4516
+ i = t && t[n];
4517
+ switch (Sr(o.type)) {
4518
+ case 'array':
4519
+ r[n] = Fr(o, i);
4520
+ break;
4521
+ case 'object':
4522
+ r[n] = Gr(o, i);
4523
+ break;
4524
+ default:
4525
+ r[n] = Ur(o, i);
4526
+ }
4527
+ },
4528
+ );
4529
+ }
4530
+ }
4531
+ return r;
4532
+ }
4533
+ function Fr(e, t) {
4534
+ var r = [];
4535
+ if (e && 'array' === Sr(e.type)) {
4536
+ var n = t;
4537
+ i(n) && i(e.default) && typeof n != typeof e.default && (n = void 0);
4538
+ var o = i(n) ? n : e.default;
4539
+ if ('array' === Sr(e.type))
4540
+ if (S(o))
4541
+ o.map(function (t) {
4542
+ r.push(Gr(e.items, t));
4543
+ });
4544
+ else if (o) r = o;
4545
+ else {
4546
+ var a = Gr(e.items, o);
4547
+ r.push(a);
4548
+ }
4549
+ else r = i(o) ? o : [];
4550
+ }
4551
+ return r;
4552
+ }
4553
+ function Kr(e, t) {
4554
+ return 'object' === Sr(e.type)
4555
+ ? Gr(e, t)
4556
+ : 'array' === Sr(e.type)
4557
+ ? Fr(e, t)
4558
+ : Ur(e, t);
4559
+ }
4560
+ var zr = b;
4561
+ function Jr(e, t) {
4562
+ var r = t || [];
4563
+ if (e && '{}' !== JSON.stringify(e))
4564
+ if (A(e))
4565
+ if (
4566
+ e.type &&
4567
+ 'remote' === e.type &&
4568
+ e.config &&
4569
+ A(e.config) &&
4570
+ e.config.dataName &&
4571
+ i(e.localFilter) &&
4572
+ i(e.data)
4573
+ ) {
4574
+ var n = e.config.body;
4575
+ if (n && !A(n))
4576
+ try {
4577
+ n = JSON.parse(n);
4578
+ } catch (e) {
4579
+ n = {};
4580
+ }
4581
+ r.push({ id: e.config.id, dataName: e.config.dataName, body: n });
4582
+ } else {
4583
+ Object.keys(e).map(function (t) {
4584
+ Jr(e[t], r);
4585
+ });
4586
+ }
4587
+ else
4588
+ S(e) &&
4589
+ e.map(function (e) {
4590
+ Jr(e, r);
4591
+ });
4592
+ return r;
4593
+ }
4594
+ function Hr(e, t) {
4595
+ var r = t || 'data';
4596
+ return (
4597
+ e.split('-').map(function (e) {
4598
+ r = /^\d+$/.test(e) ? r + '[' + e + ']' : r + '.' + e;
4599
+ }),
4600
+ r
4601
+ );
4602
+ }
4603
+ function Wr(e, t) {
4604
+ var r = [];
4605
+ A(e)
4606
+ ? Object.keys(e).map(function (n) {
4607
+ var o = e[n],
4608
+ i = t ? t + '-' + n : n;
4609
+ A(o) || S(o)
4610
+ ? r.push({ title: n, value: i, key: i, children: Wr(o, i) })
4611
+ : r.push({ title: n, value: i, key: i });
4612
+ })
4613
+ : S(e) &&
4614
+ e.map(function (e, n) {
4615
+ var o = n.toString(),
4616
+ i = t ? t + '-' + n : o;
4617
+ A(e) || S(e)
4618
+ ? r.push({ title: o, value: i, key: i, children: Wr(e, i) })
4619
+ : r.push({ title: o, value: i, key: i });
4620
+ });
4621
+ return r;
4622
+ }
4623
+ function $r(e) {
4624
+ var t = e.split('-');
4625
+ return t.pop(), t.join('-');
4626
+ }
4627
+ function Xr(e) {
4628
+ var t = e.split('-'),
4629
+ r = t.pop();
4630
+ return [t.join('-'), r];
4631
+ }
4632
+ var Yr = [
4633
+ 'key',
4634
+ 'enum',
4635
+ 'enumextra',
4636
+ 'items',
4637
+ 'input',
4638
+ 'boolean',
4639
+ 'number',
4640
+ 'color',
4641
+ 'url',
4642
+ 'textarea',
4643
+ 'text-editor',
4644
+ 'radio',
4645
+ 'select',
4646
+ 'checkboxes',
4647
+ 'date',
4648
+ 'date-time',
4649
+ 'time',
4650
+ 'json',
4651
+ 'codearea',
4652
+ 'htmlarea',
4653
+ 'quantity',
4654
+ 'box-style',
4655
+ 'dynamic-data',
4656
+ 'datasource',
4657
+ 'event',
4658
+ 'array',
4659
+ 'object',
4660
+ ];
4661
+ export {
4662
+ g as DataSourceTypeList,
4663
+ m as EventTypeDataList,
4664
+ Yr as KeyWordList,
4665
+ b as TypeDataList,
4666
+ Hr as dataRoute2dataPath,
4667
+ Jr as dynamicDataAnalyzer,
4668
+ Rr as getCurPosition,
4669
+ qr as getDefaultOptionVal,
4670
+ Sr as getExpectType,
4671
+ s as getJsonDataByKeyRoute,
4672
+ Ir as getNextIndexRoute,
4673
+ Pr as getParentIndexRoute,
4674
+ Mr as getParentIndexRoute_CurIndex,
4675
+ $r as getParentKeyRoute,
4676
+ Xr as getParentKeyRoute_CurKey,
4677
+ u as getSchemaByIndexRoute,
4678
+ c as getSchemaByKeyRoute,
4679
+ i as hasProperties,
4680
+ l as indexRoute2keyRoute,
4681
+ S as isArray,
4682
+ _ as isBoolean,
4683
+ C as isColor,
4684
+ Cr as isContainerSchema,
4685
+ w as isDateStr,
4686
+ x as isDateTimeStr,
4687
+ Ar as isEmptySchema,
4688
+ o as isEqual,
4689
+ T as isFunction,
4690
+ Vr as isNewSchemaData,
4691
+ N as isNumber,
4692
+ A as isObject,
4693
+ V as isQuantity,
4694
+ kr as isSameParent,
4695
+ D as isSelect,
4696
+ E as isString,
4697
+ Tr as isStructuredSchema,
4698
+ j as isTimeStr,
4699
+ O as isURL,
4700
+ k as json2schema,
4701
+ Wr as json2treeData,
4702
+ p as keyRoute2indexRoute,
4703
+ P as metaElemAnalyzer,
4704
+ Br as moveBackward,
4705
+ Lr as moveForward,
4706
+ n as objClone,
4707
+ M as oldSchemaToNewSchema,
4708
+ I as oldSchemaToNewSchemaV1,
4709
+ Dr as registerExpectType,
4710
+ Kr as schema2json,
4711
+ zr as schemaMetaList,
4712
+ a as truncate,
4713
+ };