
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/__qc_index__.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}
require('./assets/OP15/scene/OP15');
require('./assets/OP15/script/defaultData');
require('./assets/OP15/script/state');
require('./assets/OP15/script/util');
require('./assets/OP15/script/xstate');

                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/OP15/script/state.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '6acefvFAO9O7qvqEFnz5PJj', 'state');
// OP15/script/state.js

"use strict";

exports.__esModule = true;
exports.assign = o;
exports.createMachine = s;
exports.interpret = v;
exports.InterpreterStatus = void 0;

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function t(t, n) {
  var e = "function" == typeof Symbol && t[Symbol.iterator];
  if (!e) return t;
  var r,
      o,
      i = e.call(t),
      a = [];

  try {
    for (; (void 0 === n || n-- > 0) && !(r = i.next()).done;) {
      a.push(r.value);
    }
  } catch (t) {
    o = {
      error: t
    };
  } finally {
    try {
      r && !r.done && (e = i["return"]) && e.call(i);
    } finally {
      if (o) throw o.error;
    }
  }

  return a;
}

var n;
exports.InterpreterStatus = n;
!function (t) {
  t[t.NotStarted = 0] = "NotStarted", t[t.Running = 1] = "Running", t[t.Stopped = 2] = "Stopped";
}(n || (exports.InterpreterStatus = n = {}));
var e = {
  type: "xstate.init"
};

function r(t) {
  return void 0 === t ? [] : [].concat(t);
}

function o(t) {
  return {
    type: "xstate.assign",
    assignment: t
  };
}

function i(t, n) {
  return "string" == typeof (t = "string" == typeof t && n && n[t] ? n[t] : t) ? {
    type: t
  } : "function" == typeof t ? {
    type: t.name,
    exec: t
  } : t;
}

function a(t) {
  return function (n) {
    return t === n;
  };
}

function u(t) {
  return "string" == typeof t ? {
    type: t
  } : t;
}

function c(t, n) {
  return {
    value: t,
    context: n,
    actions: [],
    changed: !1,
    matches: a(t)
  };
}

function f(t, n, e) {
  var r = n,
      o = !1;
  return [t.filter(function (t) {
    if ("xstate.assign" === t.type) {
      o = !0;
      var n = Object.assign({}, r);
      return "function" == typeof t.assignment ? n = t.assignment(r, e) : Object.keys(t.assignment).forEach(function (o) {
        n[o] = "function" == typeof t.assignment[o] ? t.assignment[o](r, e) : t.assignment[o];
      }), r = n, !1;
    }

    return !0;
  }), r, o];
}

function s(n, o) {
  void 0 === o && (o = {});
  var s = t(f(r(n.states[n.initial].entry).map(function (t) {
    return i(t, o.actions);
  }), n.context, e), 2),
      l = s[0],
      v = s[1],
      y = {
    config: n,
    _options: o,
    initialState: {
      value: n.initial,
      actions: l,
      context: v,
      matches: a(n.initial)
    },
    transition: function transition(e, o) {
      var s,
          l,
          v = "string" == typeof e ? {
        value: e,
        context: n.context
      } : e,
          p = v.value,
          g = v.context,
          d = u(o),
          x = n.states[p];

      if (x.on) {
        var m = r(x.on[d.type]);

        try {
          for (var h = function (t) {
            var n = "function" == typeof Symbol && Symbol.iterator,
                e = n && t[n],
                r = 0;
            if (e) return e.call(t);
            if (t && "number" == typeof t.length) return {
              next: function next() {
                return t && r >= t.length && (t = void 0), {
                  value: t && t[r++],
                  done: !t
                };
              }
            };
            throw new TypeError(n ? "Object is not iterable." : "Symbol.iterator is not defined.");
          }(m), b = h.next(); !b.done; b = h.next()) {
            var S = b.value;
            if (void 0 === S) return c(p, g);

            var w = "string" == typeof S ? {
              target: S
            } : S,
                j = w.target,
                E = w.actions,
                R = void 0 === E ? [] : E,
                N = w.cond,
                O = void 0 === N ? function () {
              return !0;
            } : N,
                _ = void 0 === j,
                k = null != j ? j : p,
                T = n.states[k];

            if (O(g, d)) {
              var q = t(f((_ ? r(R) : [].concat(x.exit, R, T.entry).filter(function (t) {
                return t;
              })).map(function (t) {
                return i(t, y._options.actions);
              }), g, d), 3),
                  z = q[0],
                  A = q[1],
                  B = q[2],
                  C = null != j ? j : p;
              return {
                value: C,
                context: A,
                actions: z,
                changed: j !== p || z.length > 0 || B,
                matches: a(C)
              };
            }
          }
        } catch (t) {
          s = {
            error: t
          };
        } finally {
          try {
            b && !b.done && (l = h["return"]) && l.call(h);
          } finally {
            if (s) throw s.error;
          }
        }
      }

      return c(p, g);
    }
  };
  return y;
}

var l = function l(t, n) {
  return t.actions.forEach(function (e) {
    var r = e.exec;
    return r && r(t.context, n);
  });
};

function v(t) {
  var r = t.initialState,
      o = n.NotStarted,
      i = new Set(),
      c = {
    _machine: t,
    send: function send(e) {
      o === n.Running && (r = t.transition(r, e), l(r, u(e)), i.forEach(function (t) {
        return t(r);
      }));
    },
    subscribe: function subscribe(t) {
      return i.add(t), t(r), {
        unsubscribe: function unsubscribe() {
          return i["delete"](t);
        }
      };
    },
    start: function start(i) {
      if (i) {
        var u = "object" == typeof i ? i : {
          context: t.config.context,
          value: i
        };
        r = {
          value: u.value,
          actions: [],
          context: u.context,
          matches: a(u.value)
        };
      }

      return o = n.Running, l(r, e), c;
    },
    stop: function stop() {
      return o = n.Stopped, i.clear(), c;
    },

    get state() {
      return r;
    },

    get status() {
      return o;
    }

  };
  return c;
}

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 18268 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/OP15/script/xstate.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}(function (global){
"use strict";
cc._RF.push(module, 'ccc6ebxJZFI24GNYY/uty5V', 'xstate');
// OP15/script/xstate.js

"use strict";

!function (t, e) {
  "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t = "undefined" != typeof globalThis ? globalThis : t || self).XState = {});
}(void 0, function (t) {
  "use strict";
  /*! *****************************************************************************
      Copyright (c) Microsoft Corporation.
  
      Permission to use, copy, modify, and/or distribute this software for any
      purpose with or without fee is hereby granted.
  
      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
      REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
      AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
      INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
      LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
      OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      PERFORMANCE OF THIS SOFTWARE.
      ***************************************************************************** */

  var _e = function e() {
    return (_e = Object.assign || function (t) {
      for (var e, n = 1, r = arguments.length; n < r; n++) {
        for (var i in e = arguments[n]) {
          Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
        }
      }

      return t;
    }).apply(this, arguments);
  };

  function n(t, e) {
    var n = {};

    for (var r in t) {
      Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
    }

    if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
      var i = 0;

      for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) {
        e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
      }
    }

    return n;
  }

  function r(t) {
    var e = "function" == typeof Symbol && Symbol.iterator,
        n = e && t[e],
        r = 0;
    if (n) return n.call(t);
    if (t && "number" == typeof t.length) return {
      next: function next() {
        return t && r >= t.length && (t = void 0), {
          value: t && t[r++],
          done: !t
        };
      }
    };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
  }

  function i(t, e) {
    var n = "function" == typeof Symbol && t[Symbol.iterator];
    if (!n) return t;
    var r,
        i,
        o = n.call(t),
        a = [];

    try {
      for (; (void 0 === e || e-- > 0) && !(r = o.next()).done;) {
        a.push(r.value);
      }
    } catch (t) {
      i = {
        error: t
      };
    } finally {
      try {
        r && !r.done && (n = o["return"]) && n.call(o);
      } finally {
        if (i) throw i.error;
      }
    }

    return a;
  }

  function o(t, e, n) {
    if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) {
      !r && i in e || (r || (r = Array.prototype.slice.call(e, 0, i)), r[i] = e[i]);
    }
    return t.concat(r || Array.prototype.slice.call(e));
  }

  var a = {};

  function s(t) {
    return Object.keys(t);
  }

  function c(t, e, n) {
    void 0 === n && (n = ".");
    var r = f(t, n),
        i = f(e, n);
    return A(i) ? !!A(r) && i === r : A(r) ? r in i : s(r).every(function (t) {
      return t in i && c(r[t], i[t]);
    });
  }

  function u(t) {
    try {
      return A(t) || "number" == typeof t ? "".concat(t) : t.type;
    } catch (t) {
      throw new Error("Events must be strings or objects with a string event.type property.");
    }
  }

  function h(t, e) {
    try {
      return T(t) ? t : t.toString().split(e);
    } catch (e) {
      throw new Error("'".concat(t, "' is not a valid state path."));
    }
  }

  function f(t, e) {
    return "object" == typeof (n = t) && "value" in n && "context" in n && "event" in n && "_event" in n ? t.value : T(t) ? l(t) : "string" != typeof t ? t : l(h(t, e));
    var n;
  }

  function l(t) {
    if (1 === t.length) return t[0];

    for (var e = {}, n = e, r = 0; r < t.length - 1; r++) {
      r === t.length - 2 ? n[t[r]] = t[r + 1] : (n[t[r]] = {}, n = n[t[r]]);
    }

    return e;
  }

  function d(t, e) {
    for (var n = {}, r = s(t), i = 0; i < r.length; i++) {
      var o = r[i];
      n[o] = e(t[o], o, t, i);
    }

    return n;
  }

  function p(t, e, n) {
    var i,
        o,
        a = {};

    try {
      for (var c = r(s(t)), u = c.next(); !u.done; u = c.next()) {
        var h = u.value,
            f = t[h];
        n(f) && (a[h] = e(f, h, t));
      }
    } catch (t) {
      i = {
        error: t
      };
    } finally {
      try {
        u && !u.done && (o = c["return"]) && o.call(c);
      } finally {
        if (i) throw i.error;
      }
    }

    return a;
  }

  var v = function v(t) {
    return function (e) {
      var n,
          i,
          o = e;

      try {
        for (var a = r(t), s = a.next(); !s.done; s = a.next()) {
          o = o[s.value];
        }
      } catch (t) {
        n = {
          error: t
        };
      } finally {
        try {
          s && !s.done && (i = a["return"]) && i.call(a);
        } finally {
          if (n) throw n.error;
        }
      }

      return o;
    };
  };

  function y(t) {
    return t ? A(t) ? [[t]] : g(s(t).map(function (e) {
      var n = t[e];
      return "string" == typeof n || n && Object.keys(n).length ? y(t[e]).map(function (t) {
        return [e].concat(t);
      }) : [[e]];
    })) : [[]];
  }

  function g(t) {
    var e;
    return (e = []).concat.apply(e, o([], i(t), !1));
  }

  function m(t) {
    return T(t) ? t : [t];
  }

  function S(t) {
    return void 0 === t ? [] : m(t);
  }

  function x(t, e, n) {
    var i, o;
    if (N(t)) return t(e, n.data);
    var a = {};

    try {
      for (var s = r(Object.keys(t)), c = s.next(); !c.done; c = s.next()) {
        var u = c.value,
            h = t[u];
        N(h) ? a[u] = h(e, n.data) : a[u] = h;
      }
    } catch (t) {
      i = {
        error: t
      };
    } finally {
      try {
        c && !c.done && (o = s["return"]) && o.call(s);
      } finally {
        if (i) throw i.error;
      }
    }

    return a;
  }

  function w(t) {
    return t instanceof Promise || !(null === t || !N(t) && "object" != typeof t || !N(t.then));
  }

  function b(t, e) {
    var n,
        o,
        a = i([[], []], 2),
        s = a[0],
        c = a[1];

    try {
      for (var u = r(t), h = u.next(); !h.done; h = u.next()) {
        var f = h.value;
        e(f) ? s.push(f) : c.push(f);
      }
    } catch (t) {
      n = {
        error: t
      };
    } finally {
      try {
        h && !h.done && (o = u["return"]) && o.call(u);
      } finally {
        if (n) throw n.error;
      }
    }

    return [s, c];
  }

  function _(t, e) {
    return d(t.states, function (t, n) {
      if (t) {
        var r = (A(e) ? void 0 : e[n]) || (t ? t.current : void 0);
        if (r) return {
          current: r,
          states: _(t, r)
        };
      }
    });
  }

  function E(t, e, n, i) {
    return t ? n.reduce(function (t, n) {
      var o,
          a,
          c = n.assignment,
          u = {
        state: i,
        action: n,
        _event: e
      },
          h = {};
      if (N(c)) h = c(t, e.data, u);else try {
        for (var f = r(s(c)), l = f.next(); !l.done; l = f.next()) {
          var d = l.value,
              p = c[d];
          h[d] = N(p) ? p(t, e.data, u) : p;
        }
      } catch (t) {
        o = {
          error: t
        };
      } finally {
        try {
          l && !l.done && (a = f["return"]) && a.call(f);
        } finally {
          if (o) throw o.error;
        }
      }
      return Object.assign({}, t, h);
    }, t) : t;
  }

  function T(t) {
    return Array.isArray(t);
  }

  function N(t) {
    return "function" == typeof t;
  }

  function A(t) {
    return "string" == typeof t;
  }

  function O(t, e) {
    if (t) return A(t) ? {
      type: "xstate.guard",
      name: t,
      predicate: e ? e[t] : void 0
    } : N(t) ? {
      type: "xstate.guard",
      name: t.name,
      predicate: t
    } : t;
  }

  var P = function () {
    return "function" == typeof Symbol && Symbol.observable || "@@observable";
  }();

  function k(t) {
    try {
      return "__xstatenode" in t;
    } catch (t) {
      return !1;
    }
  }

  var I,
      j,
      C = function () {
    var t = 0;
    return function () {
      return (++t).toString(16);
    };
  }();

  function V(t, n) {
    return A(t) || "number" == typeof t ? _e({
      type: t
    }, n) : t;
  }

  function L(t, n) {
    if (!A(t) && "$$type" in t && "scxml" === t.$$type) return t;
    var r = V(t);
    return _e({
      name: r.type,
      data: r,
      $$type: "scxml",
      type: "external"
    }, n);
  }

  function D(t, n) {
    return m(n).map(function (n) {
      return void 0 === n || "string" == typeof n || k(n) ? {
        target: n,
        event: t
      } : _e(_e({}, n), {
        event: t
      });
    });
  }

  function R(t, e, n, r, i) {
    var o = t.options.guards,
        a = {
      state: i,
      cond: e,
      _event: r
    };
    if ("xstate.guard" === e.type) return ((null == o ? void 0 : o[e.name]) || e.predicate)(n, r.data, a);
    var s = o[e.type];
    if (!s) throw new Error("Guard '".concat(e.type, "' is not implemented on machine '").concat(t.id, "'."));
    return s(n, r.data, a);
  }

  function M(t) {
    return "string" == typeof t ? {
      type: t
    } : t;
  }

  function z(t, e, n) {
    if ("object" == typeof t) return t;

    var r = function r() {};

    return {
      next: t,
      error: e || r,
      complete: n || r
    };
  }

  (I = t.ActionTypes || (t.ActionTypes = {})).Start = "xstate.start", I.Stop = "xstate.stop", I.Raise = "xstate.raise", I.Send = "xstate.send", I.Cancel = "xstate.cancel", I.NullEvent = "", I.Assign = "xstate.assign", I.After = "xstate.after", I.DoneState = "done.state", I.DoneInvoke = "done.invoke", I.Log = "xstate.log", I.Init = "xstate.init", I.Invoke = "xstate.invoke", I.ErrorExecution = "error.execution", I.ErrorCommunication = "error.communication", I.ErrorPlatform = "error.platform", I.ErrorCustom = "xstate.error", I.Update = "xstate.update", I.Pure = "xstate.pure", I.Choose = "xstate.choose", (j = t.SpecialTargets || (t.SpecialTargets = {})).Parent = "#_parent", j.Internal = "#_internal";

  var F = function F(t) {
    return "atomic" === t.type || "final" === t.type;
  };

  function U(t) {
    return s(t.states).map(function (e) {
      return t.states[e];
    });
  }

  function B(t) {
    var e = [t];
    return F(t) ? e : e.concat(g(U(t).map(B)));
  }

  function J(t, e) {
    var n,
        i,
        o,
        a,
        s,
        c,
        u,
        h,
        f = q(new Set(t)),
        l = new Set(e);

    try {
      for (var d = r(l), p = d.next(); !p.done; p = d.next()) {
        for (var v = (E = p.value).parent; v && !l.has(v);) {
          l.add(v), v = v.parent;
        }
      }
    } catch (t) {
      n = {
        error: t
      };
    } finally {
      try {
        p && !p.done && (i = d["return"]) && i.call(d);
      } finally {
        if (n) throw n.error;
      }
    }

    var y = q(l);

    try {
      for (var g = r(l), m = g.next(); !m.done; m = g.next()) {
        if ("compound" !== (E = m.value).type || y.get(E) && y.get(E).length) {
          if ("parallel" === E.type) try {
            for (var S = (s = void 0, r(U(E))), x = S.next(); !x.done; x = S.next()) {
              var w = x.value;
              "history" !== w.type && (l.has(w) || (l.add(w), f.get(w) ? f.get(w).forEach(function (t) {
                return l.add(t);
              }) : w.initialStateNodes.forEach(function (t) {
                return l.add(t);
              })));
            }
          } catch (t) {
            s = {
              error: t
            };
          } finally {
            try {
              x && !x.done && (c = S["return"]) && c.call(S);
            } finally {
              if (s) throw s.error;
            }
          }
        } else f.get(E) ? f.get(E).forEach(function (t) {
          return l.add(t);
        }) : E.initialStateNodes.forEach(function (t) {
          return l.add(t);
        });
      }
    } catch (t) {
      o = {
        error: t
      };
    } finally {
      try {
        m && !m.done && (a = g["return"]) && a.call(g);
      } finally {
        if (o) throw o.error;
      }
    }

    try {
      for (var b = r(l), _ = b.next(); !_.done; _ = b.next()) {
        var E;

        for (v = (E = _.value).parent; v && !l.has(v);) {
          l.add(v), v = v.parent;
        }
      }
    } catch (t) {
      u = {
        error: t
      };
    } finally {
      try {
        _ && !_.done && (h = b["return"]) && h.call(b);
      } finally {
        if (u) throw u.error;
      }
    }

    return l;
  }

  function q(t) {
    var e,
        n,
        i = new Map();

    try {
      for (var o = r(t), a = o.next(); !a.done; a = o.next()) {
        var s = a.value;
        i.has(s) || i.set(s, []), s.parent && (i.has(s.parent) || i.set(s.parent, []), i.get(s.parent).push(s));
      }
    } catch (t) {
      e = {
        error: t
      };
    } finally {
      try {
        a && !a.done && (n = o["return"]) && n.call(o);
      } finally {
        if (e) throw e.error;
      }
    }

    return i;
  }

  function $(t, e) {
    return function t(e, n) {
      var r = n.get(e);
      if (!r) return {};

      if ("compound" === e.type) {
        var i = r[0];
        if (!i) return {};
        if (F(i)) return i.key;
      }

      var o = {};
      return r.forEach(function (e) {
        o[e.key] = t(e, n);
      }), o;
    }(t, q(J([t], e)));
  }

  function X(t, e) {
    return Array.isArray(t) ? t.some(function (t) {
      return t === e;
    }) : t instanceof Set && t.has(e);
  }

  function H(t, e) {
    return "compound" === e.type ? U(e).some(function (e) {
      return "final" === e.type && X(t, e);
    }) : "parallel" === e.type && U(e).every(function (e) {
      return H(t, e);
    });
  }

  function G(t) {
    return new Set(g(t.map(function (t) {
      return t.tags;
    })));
  }

  var K = t.ActionTypes.Start,
      Q = t.ActionTypes.Stop,
      W = t.ActionTypes.Raise,
      Y = t.ActionTypes.Send,
      Z = t.ActionTypes.Cancel,
      tt = t.ActionTypes.NullEvent,
      et = t.ActionTypes.Assign,
      nt = (t.ActionTypes.After, t.ActionTypes.DoneState, t.ActionTypes.Log),
      rt = t.ActionTypes.Init,
      it = t.ActionTypes.Invoke,
      ot = (t.ActionTypes.ErrorExecution, t.ActionTypes.ErrorPlatform),
      at = t.ActionTypes.ErrorCustom,
      st = t.ActionTypes.Update,
      ct = t.ActionTypes.Choose,
      ut = t.ActionTypes.Pure,
      ht = L({
    type: rt
  });

  function ft(t, e) {
    return e && e[t] || void 0;
  }

  function lt(t, n) {
    var r;
    if (A(t) || "number" == typeof t) r = N(i = ft(t, n)) ? {
      type: t,
      exec: i
    } : i || {
      type: t,
      exec: void 0
    };else if (N(t)) r = {
      type: t.name || t.toString(),
      exec: t
    };else {
      var i;
      if (N(i = ft(t.type, n))) r = _e(_e({}, t), {
        exec: i
      });else if (i) {
        var o = i.type || t.type;
        r = _e(_e(_e({}, i), t), {
          type: o
        });
      } else r = t;
    }
    return r;
  }

  var dt = function dt(t, e) {
    return t ? (T(t) ? t : [t]).map(function (t) {
      return lt(t, e);
    }) : [];
  };

  function pt(t) {
    var n = lt(t);
    return _e(_e({
      id: A(t) ? t : n.id
    }, n), {
      type: n.type
    });
  }

  function vt(e) {
    return A(e) ? {
      type: W,
      event: e
    } : yt(e, {
      to: t.SpecialTargets.Internal
    });
  }

  function yt(t, e) {
    return {
      to: e ? e.to : void 0,
      type: Y,
      event: N(t) ? t : V(t),
      delay: e ? e.delay : void 0,
      id: e && void 0 !== e.id ? e.id : N(t) ? t.name : u(t)
    };
  }

  function gt(n, r) {
    return yt(n, _e(_e({}, r), {
      to: t.SpecialTargets.Parent
    }));
  }

  function mt() {
    return gt(st);
  }

  var St = function St(t, e) {
    return {
      context: t,
      event: e
    };
  };

  var xt = function xt(t) {
    return {
      type: Z,
      sendId: t
    };
  };

  function wt(e) {
    var n = pt(e);
    return {
      type: t.ActionTypes.Start,
      activity: n,
      exec: void 0
    };
  }

  function bt(e) {
    var n = N(e) ? e : pt(e);
    return {
      type: t.ActionTypes.Stop,
      activity: n,
      exec: void 0
    };
  }

  var _t = function _t(t) {
    return {
      type: et,
      assignment: t
    };
  };

  function Et(e, n) {
    var r = n ? "#".concat(n) : "";
    return "".concat(t.ActionTypes.After, "(").concat(e, ")").concat(r);
  }

  function Tt(e, n) {
    var r = "".concat(t.ActionTypes.DoneState, ".").concat(e),
        i = {
      type: r,
      data: n,
      toString: function toString() {
        return r;
      }
    };
    return i;
  }

  function Nt(e, n) {
    var r = "".concat(t.ActionTypes.DoneInvoke, ".").concat(e),
        i = {
      type: r,
      data: n,
      toString: function toString() {
        return r;
      }
    };
    return i;
  }

  function At(e, n) {
    var r = "".concat(t.ActionTypes.ErrorPlatform, ".").concat(e),
        i = {
      type: r,
      data: n,
      toString: function toString() {
        return r;
      }
    };
    return i;
  }

  function Ot(t, n) {
    return yt(function (t, e) {
      return e;
    }, _e(_e({}, n), {
      to: t
    }));
  }

  function Pt(n, r, a, s, c, u) {
    void 0 === u && (u = !1);
    var h = i(u ? [[], c] : b(c, function (t) {
      return t.type === et;
    }), 2),
        f = h[0],
        l = h[1],
        d = f.length ? E(a, s, f, r) : a,
        p = u ? [a] : void 0;
    return [g(l.map(function (a) {
      var c;

      switch (a.type) {
        case W:
          return {
            type: W,
            _event: L(a.event)
          };

        case Y:
          return function (t, n, r, i) {
            var o,
                a = {
              _event: r
            },
                s = L(N(t.event) ? t.event(n, r.data, a) : t.event);

            if (A(t.delay)) {
              var c = i && i[t.delay];
              o = N(c) ? c(n, r.data, a) : c;
            } else o = N(t.delay) ? t.delay(n, r.data, a) : t.delay;

            var u = N(t.to) ? t.to(n, r.data, a) : t.to;
            return _e(_e({}, t), {
              to: u,
              _event: s,
              event: s.data,
              delay: o
            });
          }(a, d, s, n.options.delays);

        case nt:
          return function (t, n, r) {
            return _e(_e({}, t), {
              value: A(t.expr) ? t.expr : t.expr(n, r.data, {
                _event: r
              })
            });
          }(a, d, s);

        case ct:
          if (!(v = null === (c = a.conds.find(function (t) {
            var e = O(t.cond, n.options.guards);
            return !e || R(n, e, d, s, r);
          })) || void 0 === c ? void 0 : c.actions)) return [];
          var h = i(Pt(n, r, d, s, dt(S(v), n.options.actions), u), 2),
              f = h[0],
              l = h[1];
          return d = l, null == p || p.push(d), f;

        case ut:
          var v;
          if (!(v = a.get(d, s.data))) return [];
          var y = i(Pt(n, r, d, s, dt(S(v), n.options.actions), u), 2),
              g = y[0],
              m = y[1];
          return d = m, null == p || p.push(d), g;

        case Q:
          return function (e, n, r) {
            var i = N(e.activity) ? e.activity(n, r.data) : e.activity,
                o = "string" == typeof i ? {
              id: i
            } : i;
            return {
              type: t.ActionTypes.Stop,
              activity: o
            };
          }(a, d, s);

        case et:
          d = E(d, s, [a], r), null == p || p.push(d);
          break;

        default:
          var x = lt(a, n.options.actions),
              w = x.exec;

          if (w && p) {
            var b = p.length - 1;
            x = _e(_e({}, x), {
              exec: function exec(t) {
                for (var e = [], n = 1; n < arguments.length; n++) {
                  e[n - 1] = arguments[n];
                }

                w.apply(void 0, o([p[b]], i(e), !1));
              }
            });
          }

          return x;
      }
    }).filter(function (t) {
      return !!t;
    })), d];
  }

  var kt = function () {
    function t(t) {
      var e,
          n,
          r = this;
      this.actions = [], this.activities = a, this.meta = {}, this.events = [], this.value = t.value, this.context = t.context, this._event = t._event, this._sessionid = t._sessionid, this.event = this._event.data, this.historyValue = t.historyValue, this.history = t.history, this.actions = t.actions || [], this.activities = t.activities || a, this.meta = (void 0 === (n = t.configuration) && (n = []), n.reduce(function (t, e) {
        return void 0 !== e.meta && (t[e.id] = e.meta), t;
      }, {})), this.events = t.events || [], this.matches = this.matches.bind(this), this.toStrings = this.toStrings.bind(this), this.configuration = t.configuration, this.transitions = t.transitions, this.children = t.children, this.done = !!t.done, this.tags = null !== (e = Array.isArray(t.tags) ? new Set(t.tags) : t.tags) && void 0 !== e ? e : new Set(), this.machine = t.machine, Object.defineProperty(this, "nextEvents", {
        get: function get() {
          return function (t) {
            return o([], i(new Set(g(o([], i(t.map(function (t) {
              return t.ownEvents;
            })), !1)))), !1);
          }(r.configuration);
        }
      });
    }

    return t.from = function (e, n) {
      return e instanceof t ? e.context !== n ? new t({
        value: e.value,
        context: n,
        _event: e._event,
        _sessionid: null,
        historyValue: e.historyValue,
        history: e.history,
        actions: [],
        activities: e.activities,
        meta: {},
        events: [],
        configuration: [],
        transitions: [],
        children: {}
      }) : e : new t({
        value: e,
        context: n,
        _event: ht,
        _sessionid: null,
        historyValue: void 0,
        history: void 0,
        actions: [],
        activities: void 0,
        meta: void 0,
        events: [],
        configuration: [],
        transitions: [],
        children: {}
      });
    }, t.create = function (e) {
      return new t(e);
    }, t.inert = function (e, n) {
      if (e instanceof t) {
        if (!e.actions.length) return e;
        var r = ht;
        return new t({
          value: e.value,
          context: n,
          _event: r,
          _sessionid: null,
          historyValue: e.historyValue,
          history: e.history,
          activities: e.activities,
          configuration: e.configuration,
          transitions: [],
          children: {}
        });
      }

      return t.from(e, n);
    }, t.prototype.toStrings = function (t, e) {
      var n = this;
      if (void 0 === t && (t = this.value), void 0 === e && (e = "."), A(t)) return [t];
      var r = s(t);
      return r.concat.apply(r, o([], i(r.map(function (r) {
        return n.toStrings(t[r], e).map(function (t) {
          return r + e + t;
        });
      })), !1));
    }, t.prototype.toJSON = function () {
      var t = this,
          r = (t.configuration, t.transitions, t.tags),
          i = (t.machine, n(t, ["configuration", "transitions", "tags", "machine"]));
      return _e(_e({}, i), {
        tags: Array.from(r)
      });
    }, t.prototype.matches = function (t) {
      return c(t, this.value);
    }, t.prototype.hasTag = function (t) {
      return this.tags.has(t);
    }, t.prototype.can = function (t) {
      var e;
      return this.machine, !!(null === (e = this.machine) || void 0 === e ? void 0 : e.transition(this, t).changed);
    }, t;
  }(),
      It = [],
      jt = function jt(t, e) {
    It.push(t);
    var n = e(t);
    return It.pop(), n;
  };

  function Ct(t) {
    return {
      id: t,
      send: function send() {},
      subscribe: function subscribe() {
        return {
          unsubscribe: function unsubscribe() {}
        };
      },
      getSnapshot: function getSnapshot() {},
      toJSON: function toJSON() {
        return {
          id: t
        };
      }
    };
  }

  function Vt(t, e, n) {
    var r = Ct(e);

    if (r.deferred = !0, k(t)) {
      var i = r.state = jt(void 0, function () {
        return (n ? t.withContext(n) : t).initialState;
      });

      r.getSnapshot = function () {
        return i;
      };
    }

    return r;
  }

  function Lt(t) {
    if ("string" == typeof t) {
      var e = {
        type: t,
        toString: function toString() {
          return t;
        }
      };
      return e;
    }

    return t;
  }

  function Dt(t) {
    return _e(_e({
      type: it
    }, t), {
      toJSON: function toJSON() {
        t.onDone, t.onError;
        var r = n(t, ["onDone", "onError"]);
        return _e(_e({}, r), {
          type: it,
          src: Lt(t.src)
        });
      }
    });
  }

  var Rt = {},
      Mt = function Mt(t) {
    return "#" === t[0];
  },
      zt = function () {
    function a(t, n, c) {
      var u,
          h = this;
      void 0 === c && (c = "context" in t ? t.context : void 0), this.config = t, this._context = c, this.order = -1, this.__xstatenode = !0, this.__cache = {
        events: void 0,
        relativeValue: new Map(),
        initialStateValue: void 0,
        initialState: void 0,
        on: void 0,
        transitions: void 0,
        candidates: {},
        delayedTransitions: void 0
      }, this.idMap = {}, this.tags = [], this.options = Object.assign({
        actions: {},
        guards: {},
        services: {},
        activities: {},
        delays: {}
      }, n), this.parent = this.options._parent, this.key = this.config.key || this.options._key || this.config.id || "(machine)", this.machine = this.parent ? this.parent.machine : this, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : "."), this.id = this.config.id || o([this.machine.key], i(this.path), !1).join(this.delimiter), this.version = this.parent ? this.parent.version : this.config.version, this.type = this.config.type || (this.config.parallel ? "parallel" : this.config.states && s(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.schema = this.parent ? this.machine.schema : null !== (u = this.config.schema) && void 0 !== u ? u : {}, this.description = this.config.description, this.initial = this.config.initial, this.states = this.config.states ? d(this.config.states, function (t, n) {
        var r,
            i = new a(t, {
          _parent: h,
          _key: n
        });
        return Object.assign(h.idMap, _e(((r = {})[i.id] = i, r), i.idMap)), i;
      }) : Rt;
      var f = 0;
      !function t(e) {
        var n, i;
        e.order = f++;

        try {
          for (var o = r(U(e)), a = o.next(); !a.done; a = o.next()) {
            t(a.value);
          }
        } catch (t) {
          n = {
            error: t
          };
        } finally {
          try {
            a && !a.done && (i = o["return"]) && i.call(o);
          } finally {
            if (n) throw n.error;
          }
        }
      }(this), this.history = !0 === this.config.history ? "shallow" : this.config.history || !1, this._transient = !!this.config.always || !!this.config.on && (Array.isArray(this.config.on) ? this.config.on.some(function (t) {
        return "" === t.event;
      }) : "" in this.config.on), this.strict = !!this.config.strict, this.onEntry = S(this.config.entry || this.config.onEntry).map(function (t) {
        return lt(t);
      }), this.onExit = S(this.config.exit || this.config.onExit).map(function (t) {
        return lt(t);
      }), this.meta = this.config.meta, this.doneData = "final" === this.type ? this.config.data : void 0, this.invoke = S(this.config.invoke).map(function (t, n) {
        var r, i;
        if (k(t)) return h.machine.options.services = _e(((r = {})[t.id] = t, r), h.machine.options.services), Dt({
          src: t.id,
          id: t.id
        });
        if (A(t.src)) return Dt(_e(_e({}, t), {
          id: t.id || t.src,
          src: t.src
        }));

        if (k(t.src) || N(t.src)) {
          var o = "".concat(h.id, ":invocation[").concat(n, "]");
          return h.machine.options.services = _e(((i = {})[o] = t.src, i), h.machine.options.services), Dt(_e(_e({
            id: o
          }, t), {
            src: o
          }));
        }

        var a = t.src;
        return Dt(_e(_e({
          id: a.type
        }, t), {
          src: a
        }));
      }), this.activities = S(this.config.activities).concat(this.invoke).map(function (t) {
        return pt(t);
      }), this.transition = this.transition.bind(this), this.tags = S(this.config.tags);
    }

    return a.prototype._init = function () {
      this.__cache.transitions || B(this).forEach(function (t) {
        return t.on;
      });
    }, a.prototype.withConfig = function (t, n) {
      var r = this.options,
          i = r.actions,
          o = r.activities,
          s = r.guards,
          c = r.services,
          u = r.delays;
      return new a(this.config, {
        actions: _e(_e({}, i), t.actions),
        activities: _e(_e({}, o), t.activities),
        guards: _e(_e({}, s), t.guards),
        services: _e(_e({}, c), t.services),
        delays: _e(_e({}, u), t.delays)
      }, null != n ? n : this.context);
    }, a.prototype.withContext = function (t) {
      return new a(this.config, this.options, t);
    }, Object.defineProperty(a.prototype, "context", {
      get: function get() {
        return N(this._context) ? this._context() : this._context;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "definition", {
      get: function get() {
        return {
          id: this.id,
          key: this.key,
          version: this.version,
          context: this.context,
          type: this.type,
          initial: this.initial,
          history: this.history,
          states: d(this.states, function (t) {
            return t.definition;
          }),
          on: this.on,
          transitions: this.transitions,
          entry: this.onEntry,
          exit: this.onExit,
          activities: this.activities || [],
          meta: this.meta,
          order: this.order || -1,
          data: this.doneData,
          invoke: this.invoke,
          description: this.description,
          tags: this.tags
        };
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.toJSON = function () {
      return this.definition;
    }, Object.defineProperty(a.prototype, "on", {
      get: function get() {
        if (this.__cache.on) return this.__cache.on;
        var t = this.transitions;
        return this.__cache.on = t.reduce(function (t, e) {
          return t[e.eventType] = t[e.eventType] || [], t[e.eventType].push(e), t;
        }, {});
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "after", {
      get: function get() {
        return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "transitions", {
      get: function get() {
        return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.getCandidates = function (t) {
      if (this.__cache.candidates[t]) return this.__cache.candidates[t];
      var e = "" === t,
          n = this.transitions.filter(function (n) {
        var r = n.eventType === t;
        return e ? r : r || "*" === n.eventType;
      });
      return this.__cache.candidates[t] = n, n;
    }, a.prototype.getDelayedTransitions = function () {
      var t = this,
          n = this.config.after;
      if (!n) return [];

      var r = function r(e, n) {
        var r = Et(N(e) ? "".concat(t.id, ":delay[").concat(n, "]") : e, t.id);
        return t.onEntry.push(yt(r, {
          delay: e
        })), t.onExit.push(xt(r)), r;
      };

      return (T(n) ? n.map(function (t, n) {
        var i = r(t.delay, n);
        return _e(_e({}, t), {
          event: i
        });
      }) : g(s(n).map(function (t, i) {
        var o = n[t],
            a = A(o) ? {
          target: o
        } : o,
            s = isNaN(+t) ? t : +t,
            c = r(s, i);
        return S(a).map(function (t) {
          return _e(_e({}, t), {
            event: c,
            delay: s
          });
        });
      }))).map(function (n) {
        var r = n.delay;
        return _e(_e({}, t.formatTransition(n)), {
          delay: r
        });
      });
    }, a.prototype.getStateNodes = function (t) {
      var e,
          n = this;
      if (!t) return [];
      var r = t instanceof kt ? t.value : f(t, this.delimiter);

      if (A(r)) {
        var i = this.getStateNode(r).initial;
        return void 0 !== i ? this.getStateNodes(((e = {})[r] = i, e)) : [this, this.states[r]];
      }

      var o = s(r),
          a = o.map(function (t) {
        return n.getStateNode(t);
      });
      return a.push(this), a.concat(o.reduce(function (t, e) {
        var i = n.getStateNode(e).getStateNodes(r[e]);
        return t.concat(i);
      }, []));
    }, a.prototype.handles = function (t) {
      var e = u(t);
      return this.events.includes(e);
    }, a.prototype.resolveState = function (t) {
      var n = Array.from(J([], this.getStateNodes(t.value)));
      return new kt(_e(_e({}, t), {
        value: this.resolve(t.value),
        configuration: n,
        done: H(n, this),
        tags: G(n)
      }));
    }, a.prototype.transitionLeafNode = function (t, e, n) {
      var r = this.getStateNode(t).next(e, n);
      return r && r.transitions.length ? r : this.next(e, n);
    }, a.prototype.transitionCompoundNode = function (t, e, n) {
      var r = s(t),
          i = this.getStateNode(r[0])._transition(t[r[0]], e, n);

      return i && i.transitions.length ? i : this.next(e, n);
    }, a.prototype.transitionParallelNode = function (t, e, n) {
      var i,
          o,
          a = {};

      try {
        for (var c = r(s(t)), u = c.next(); !u.done; u = c.next()) {
          var h = u.value,
              f = t[h];

          if (f) {
            var l = this.getStateNode(h)._transition(f, e, n);

            l && (a[h] = l);
          }
        }
      } catch (t) {
        i = {
          error: t
        };
      } finally {
        try {
          u && !u.done && (o = c["return"]) && o.call(c);
        } finally {
          if (i) throw i.error;
        }
      }

      var d = s(a).map(function (t) {
        return a[t];
      }),
          p = g(d.map(function (t) {
        return t.transitions;
      }));
      if (!d.some(function (t) {
        return t.transitions.length > 0;
      })) return this.next(e, n);
      var v = g(d.map(function (t) {
        return t.entrySet;
      })),
          y = g(s(a).map(function (t) {
        return a[t].configuration;
      }));
      return {
        transitions: p,
        entrySet: v,
        exitSet: g(d.map(function (t) {
          return t.exitSet;
        })),
        configuration: y,
        source: e,
        actions: g(s(a).map(function (t) {
          return a[t].actions;
        }))
      };
    }, a.prototype._transition = function (t, e, n) {
      return A(t) ? this.transitionLeafNode(t, e, n) : 1 === s(t).length ? this.transitionCompoundNode(t, e, n) : this.transitionParallelNode(t, e, n);
    }, a.prototype.next = function (t, e) {
      var n,
          a,
          s,
          u = this,
          h = e.name,
          l = [],
          d = [];

      try {
        for (var p = r(this.getCandidates(h)), y = p.next(); !y.done; y = p.next()) {
          var m = y.value,
              S = m.cond,
              x = m["in"],
              w = t.context,
              b = !x || (A(x) && Mt(x) ? t.matches(f(this.getStateNodeById(x).path, this.delimiter)) : c(f(x, this.delimiter), v(this.path.slice(0, -2))(t.value))),
              _ = !1;

          try {
            _ = !S || R(this.machine, S, w, e, t);
          } catch (t) {
            throw new Error("Unable to evaluate guard '".concat(S.name || S.type, "' in transition for event '").concat(h, "' in state node '").concat(this.id, "':\n").concat(t.message));
          }

          if (_ && b) {
            void 0 !== m.target && (d = m.target), l.push.apply(l, o([], i(m.actions), !1)), s = m;
            break;
          }
        }
      } catch (t) {
        n = {
          error: t
        };
      } finally {
        try {
          y && !y.done && (a = p["return"]) && a.call(p);
        } finally {
          if (n) throw n.error;
        }
      }

      if (s) {
        if (!d.length) return {
          transitions: [s],
          entrySet: [],
          exitSet: [],
          configuration: t.value ? [this] : [],
          source: t,
          actions: l
        };
        var E = g(d.map(function (e) {
          return u.getRelativeStateNodes(e, t.historyValue);
        })),
            T = !!s.internal;
        return {
          transitions: [s],
          entrySet: T ? [] : g(E.map(function (t) {
            return u.nodesFromChild(t);
          })),
          exitSet: T ? [] : [this],
          configuration: E,
          source: t,
          actions: l
        };
      }
    }, a.prototype.nodesFromChild = function (t) {
      if (t.escapes(this)) return [];

      for (var e = [], n = t; n && n !== this;) {
        e.push(n), n = n.parent;
      }

      return e.push(this), e;
    }, a.prototype.escapes = function (t) {
      if (this === t) return !1;

      for (var e = this.parent; e;) {
        if (e === t) return !1;
        e = e.parent;
      }

      return !0;
    }, a.prototype.getActions = function (t, e, n, a) {
      var s,
          c,
          u,
          h,
          f = J([], a ? this.getStateNodes(a.value) : [this]),
          l = t.configuration.length ? J(f, t.configuration) : f;

      try {
        for (var d = r(l), p = d.next(); !p.done; p = d.next()) {
          X(f, m = p.value) || t.entrySet.push(m);
        }
      } catch (t) {
        s = {
          error: t
        };
      } finally {
        try {
          p && !p.done && (c = d["return"]) && c.call(d);
        } finally {
          if (s) throw s.error;
        }
      }

      try {
        for (var v = r(f), y = v.next(); !y.done; y = v.next()) {
          var m;
          X(l, m = y.value) && !X(t.exitSet, m.parent) || t.exitSet.push(m);
        }
      } catch (t) {
        u = {
          error: t
        };
      } finally {
        try {
          y && !y.done && (h = v["return"]) && h.call(v);
        } finally {
          if (u) throw u.error;
        }
      }

      t.source || (t.exitSet = [], t.entrySet.push(this));
      var S = g(t.entrySet.map(function (r) {
        var i = [];
        if ("final" !== r.type) return i;
        var o = r.parent;
        if (!o.parent) return i;
        i.push(Tt(r.id, r.doneData), Tt(o.id, r.doneData ? x(r.doneData, e, n) : void 0));
        var a = o.parent;
        return "parallel" === a.type && U(a).every(function (e) {
          return H(t.configuration, e);
        }) && i.push(Tt(a.id)), i;
      }));
      t.exitSet.sort(function (t, e) {
        return e.order - t.order;
      }), t.entrySet.sort(function (t, e) {
        return t.order - e.order;
      });

      var w = new Set(t.entrySet),
          b = new Set(t.exitSet),
          _ = i([g(Array.from(w).map(function (t) {
        return o(o([], i(t.activities.map(function (t) {
          return wt(t);
        })), !1), i(t.onEntry), !1);
      })).concat(S.map(vt)), g(Array.from(b).map(function (t) {
        return o(o([], i(t.onExit), !1), i(t.activities.map(function (t) {
          return bt(t);
        })), !1);
      }))], 2),
          E = _[0],
          T = _[1];

      return dt(T.concat(t.actions).concat(E), this.machine.options.actions);
    }, a.prototype.transition = function (t, e, n) {
      void 0 === t && (t = this.initialState);
      var r,
          a,
          s = L(e);
      if (t instanceof kt) r = void 0 === n ? t : this.resolveState(kt.from(t, n));else {
        var c = A(t) ? this.resolve(l(this.getResolvedPath(t))) : this.resolve(t),
            u = null != n ? n : this.machine.context;
        r = this.resolveState(kt.from(c, u));
      }
      if (this.strict && !this.events.includes(s.name) && (a = s.name, !/^(done|error)\./.test(a))) throw new Error("Machine '".concat(this.id, "' does not accept event '").concat(s.name, "'"));
      var h = this._transition(r.value, r, s) || {
        transitions: [],
        configuration: [],
        entrySet: [],
        exitSet: [],
        source: r,
        actions: []
      },
          f = J([], this.getStateNodes(r.value)),
          d = h.configuration.length ? J(f, h.configuration) : f;
      return h.configuration = o([], i(d), !1), this.resolveTransition(h, r, s);
    }, a.prototype.resolveRaisedTransition = function (t, e, n) {
      var r,
          a = t.actions;
      return (t = this.transition(t, e))._event = n, t.event = n.data, (r = t.actions).unshift.apply(r, o([], i(a), !1)), t;
    }, a.prototype.resolveTransition = function (n, o, a, c) {
      var u,
          h,
          f = this;
      void 0 === a && (a = ht), void 0 === c && (c = this.machine.context);
      var l = n.configuration,
          d = !o || n.transitions.length > 0,
          p = d ? $(this.machine, l) : void 0,
          v = o ? o.historyValue ? o.historyValue : n.source ? this.machine.historyValue(o.value) : void 0 : void 0,
          y = o ? o.context : c,
          g = this.getActions(n, y, a, o),
          m = o ? _e({}, o.activities) : {};

      try {
        for (var S = r(g), w = S.next(); !w.done; w = S.next()) {
          var E = w.value;
          E.type === K ? m[E.activity.id || E.activity.type] = E : E.type === Q && (m[E.activity.id || E.activity.type] = !1);
        }
      } catch (t) {
        u = {
          error: t
        };
      } finally {
        try {
          w && !w.done && (h = S["return"]) && h.call(S);
        } finally {
          if (u) throw u.error;
        }
      }

      var T,
          N,
          O = i(Pt(this, o, y, a, g, this.machine.config.preserveActionOrder), 2),
          P = O[0],
          k = O[1],
          I = i(b(P, function (e) {
        return e.type === W || e.type === Y && e.to === t.SpecialTargets.Internal;
      }), 2),
          j = I[0],
          C = I[1],
          V = P.filter(function (t) {
        var e;
        return t.type === K && (null === (e = t.activity) || void 0 === e ? void 0 : e.type) === it;
      }).reduce(function (t, e) {
        return t[e.activity.id] = function (t, e, n, r) {
          var i,
              o = M(t.src),
              a = null === (i = null == e ? void 0 : e.options.services) || void 0 === i ? void 0 : i[o.type],
              s = t.data ? x(t.data, n, r) : void 0,
              c = a ? Vt(a, t.id, s) : Ct(t.id);
          return c.meta = t, c;
        }(e.activity, f.machine, k, a), t;
      }, o ? _e({}, o.children) : {}),
          L = p ? n.configuration : o ? o.configuration : [],
          D = H(L, this),
          R = new kt({
        value: p || o.value,
        context: k,
        _event: a,
        _sessionid: o ? o._sessionid : null,
        historyValue: p ? v ? (T = v, N = p, {
          current: N,
          states: _(T, N)
        }) : void 0 : o ? o.historyValue : void 0,
        history: !p || n.source ? o : void 0,
        actions: p ? C : [],
        activities: p ? m : o ? o.activities : {},
        events: [],
        configuration: L,
        transitions: n.transitions,
        children: V,
        done: D,
        tags: null == o ? void 0 : o.tags,
        machine: this
      }),
          z = y !== k;
      R.changed = a.name === st || z;
      var F = R.history;
      F && delete F.history;
      var U = !D && (this._transient || l.some(function (t) {
        return t._transient;
      }));
      if (!(d || U && "" !== a.name)) return R;
      var B = R;
      if (!D) for (U && (B = this.resolveRaisedTransition(B, {
        type: tt
      }, a)); j.length;) {
        var J = j.shift();
        B = this.resolveRaisedTransition(B, J._event, a);
      }
      var q = B.changed || (F ? !!B.actions.length || z || typeof F.value != typeof B.value || !function t(e, n) {
        if (e === n) return !0;
        if (void 0 === e || void 0 === n) return !1;
        if (A(e) || A(n)) return e === n;
        var r = s(e),
            i = s(n);
        return r.length === i.length && r.every(function (r) {
          return t(e[r], n[r]);
        });
      }(B.value, F.value) : void 0);
      return B.changed = q, B.history = F, B.tags = G(B.configuration), B;
    }, a.prototype.getStateNode = function (t) {
      if (Mt(t)) return this.machine.getStateNodeById(t);
      if (!this.states) throw new Error("Unable to retrieve child state '".concat(t, "' from '").concat(this.id, "'; no child states exist."));
      var e = this.states[t];
      if (!e) throw new Error("Child state '".concat(t, "' does not exist on '").concat(this.id, "'"));
      return e;
    }, a.prototype.getStateNodeById = function (t) {
      var e = Mt(t) ? t.slice("#".length) : t;
      if (e === this.id) return this;
      var n = this.machine.idMap[e];
      if (!n) throw new Error("Child state node '#".concat(e, "' does not exist on machine '").concat(this.id, "'"));
      return n;
    }, a.prototype.getStateNodeByPath = function (t) {
      if ("string" == typeof t && Mt(t)) try {
        return this.getStateNodeById(t.slice(1));
      } catch (t) {}

      for (var e = h(t, this.delimiter).slice(), n = this; e.length;) {
        var r = e.shift();
        if (!r.length) break;
        n = n.getStateNode(r);
      }

      return n;
    }, a.prototype.resolve = function (t) {
      var e,
          n = this;
      if (!t) return this.initialStateValue || Rt;

      switch (this.type) {
        case "parallel":
          return d(this.initialStateValue, function (e, r) {
            return e ? n.getStateNode(r).resolve(t[r] || e) : Rt;
          });

        case "compound":
          if (A(t)) {
            var r = this.getStateNode(t);
            return "parallel" === r.type || "compound" === r.type ? ((e = {})[t] = r.initialStateValue, e) : t;
          }

          return s(t).length ? d(t, function (t, e) {
            return t ? n.getStateNode(e).resolve(t) : Rt;
          }) : this.initialStateValue || {};

        default:
          return t || Rt;
      }
    }, a.prototype.getResolvedPath = function (t) {
      if (Mt(t)) {
        var e = this.machine.idMap[t.slice("#".length)];
        if (!e) throw new Error("Unable to find state node '".concat(t, "'"));
        return e.path;
      }

      return h(t, this.delimiter);
    }, Object.defineProperty(a.prototype, "initialStateValue", {
      get: function get() {
        var t, e;
        if (this.__cache.initialStateValue) return this.__cache.initialStateValue;
        if ("parallel" === this.type) e = p(this.states, function (t) {
          return t.initialStateValue || Rt;
        }, function (t) {
          return !("history" === t.type);
        });else if (void 0 !== this.initial) {
          if (!this.states[this.initial]) throw new Error("Initial state '".concat(this.initial, "' not found on '").concat(this.key, "'"));
          e = F(this.states[this.initial]) ? this.initial : ((t = {})[this.initial] = this.states[this.initial].initialStateValue, t);
        } else e = {};
        return this.__cache.initialStateValue = e, this.__cache.initialStateValue;
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.getInitialState = function (t, e) {
      var n = this.getStateNodes(t);
      return this.resolveTransition({
        configuration: n,
        entrySet: n,
        exitSet: [],
        transitions: [],
        source: void 0,
        actions: []
      }, void 0, void 0, e);
    }, Object.defineProperty(a.prototype, "initialState", {
      get: function get() {
        this._init();

        var t = this.initialStateValue;
        if (!t) throw new Error("Cannot retrieve initial state from simple state '".concat(this.id, "'."));
        return this.getInitialState(t);
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "target", {
      get: function get() {
        var t;

        if ("history" === this.type) {
          var e = this.config;
          t = A(e.target) && Mt(e.target) ? l(this.machine.getStateNodeById(e.target).path.slice(this.path.length - 1)) : e.target;
        }

        return t;
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.getRelativeStateNodes = function (t, e, n) {
      return void 0 === n && (n = !0), n ? "history" === t.type ? t.resolveHistory(e) : t.initialStateNodes : [t];
    }, Object.defineProperty(a.prototype, "initialStateNodes", {
      get: function get() {
        var t = this;
        return F(this) ? [this] : "compound" !== this.type || this.initial ? g(y(this.initialStateValue).map(function (e) {
          return t.getFromRelativePath(e);
        })) : [this];
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.getFromRelativePath = function (t) {
      if (!t.length) return [this];
      var e = i(t),
          n = e[0],
          r = e.slice(1);
      if (!this.states) throw new Error("Cannot retrieve subPath '".concat(n, "' from node with no states"));
      var o = this.getStateNode(n);
      if ("history" === o.type) return o.resolveHistory();
      if (!this.states[n]) throw new Error("Child state '".concat(n, "' does not exist on '").concat(this.id, "'"));
      return this.states[n].getFromRelativePath(r);
    }, a.prototype.historyValue = function (t) {
      if (s(this.states).length) return {
        current: t || this.initialStateValue,
        states: p(this.states, function (e, n) {
          if (!t) return e.historyValue();
          var r = A(t) ? void 0 : t[n];
          return e.historyValue(r || e.initialStateValue);
        }, function (t) {
          return !t.history;
        })
      };
    }, a.prototype.resolveHistory = function (t) {
      var e = this;
      if ("history" !== this.type) return [this];
      var n = this.parent;

      if (!t) {
        var i = this.target;
        return i ? g(y(i).map(function (t) {
          return n.getFromRelativePath(t);
        })) : n.initialStateNodes;
      }

      var o,
          a,
          s = (o = n.path, a = "states", function (t) {
        var e,
            n,
            i = t;

        try {
          for (var s = r(o), c = s.next(); !c.done; c = s.next()) {
            var u = c.value;
            i = i[a][u];
          }
        } catch (t) {
          e = {
            error: t
          };
        } finally {
          try {
            c && !c.done && (n = s["return"]) && n.call(s);
          } finally {
            if (e) throw e.error;
          }
        }

        return i;
      })(t).current;
      return A(s) ? [n.getStateNode(s)] : g(y(s).map(function (t) {
        return "deep" === e.history ? n.getFromRelativePath(t) : [n.states[t[0]]];
      }));
    }, Object.defineProperty(a.prototype, "stateIds", {
      get: function get() {
        var t = this,
            e = g(s(this.states).map(function (e) {
          return t.states[e].stateIds;
        }));
        return [this.id].concat(e);
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "events", {
      get: function get() {
        var t, e, n, i;
        if (this.__cache.events) return this.__cache.events;
        var o = this.states,
            a = new Set(this.ownEvents);
        if (o) try {
          for (var c = r(s(o)), u = c.next(); !u.done; u = c.next()) {
            var h = o[u.value];
            if (h.states) try {
              for (var f = (n = void 0, r(h.events)), l = f.next(); !l.done; l = f.next()) {
                var d = l.value;
                a.add("".concat(d));
              }
            } catch (t) {
              n = {
                error: t
              };
            } finally {
              try {
                l && !l.done && (i = f["return"]) && i.call(f);
              } finally {
                if (n) throw n.error;
              }
            }
          }
        } catch (e) {
          t = {
            error: e
          };
        } finally {
          try {
            u && !u.done && (e = c["return"]) && e.call(c);
          } finally {
            if (t) throw t.error;
          }
        }
        return this.__cache.events = Array.from(a);
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(a.prototype, "ownEvents", {
      get: function get() {
        var t = new Set(this.transitions.filter(function (t) {
          return !(!t.target && !t.actions.length && t.internal);
        }).map(function (t) {
          return t.eventType;
        }));
        return Array.from(t);
      },
      enumerable: !1,
      configurable: !0
    }), a.prototype.resolveTarget = function (t) {
      var e = this;
      if (void 0 !== t) return t.map(function (t) {
        if (!A(t)) return t;
        var n = t[0] === e.delimiter;
        if (n && !e.parent) return e.getStateNodeByPath(t.slice(1));
        var r = n ? e.key + t : t;
        if (!e.parent) return e.getStateNodeByPath(r);

        try {
          return e.parent.getStateNodeByPath(r);
        } catch (t) {
          throw new Error("Invalid transition definition for state node '".concat(e.id, "':\n").concat(t.message));
        }
      });
    }, a.prototype.formatTransition = function (t) {
      var n = this,
          r = function (t) {
        if (void 0 !== t && "" !== t) return S(t);
      }(t.target),
          i = "internal" in t ? t.internal : !r || r.some(function (t) {
        return A(t) && t[0] === n.delimiter;
      }),
          o = this.machine.options.guards,
          a = this.resolveTarget(r),
          s = _e(_e({}, t), {
        actions: dt(S(t.actions)),
        cond: O(t.cond, o),
        target: a,
        source: this,
        internal: i,
        eventType: t.event,
        toJSON: function toJSON() {
          return _e(_e({}, s), {
            target: s.target ? s.target.map(function (t) {
              return "#".concat(t.id);
            }) : void 0,
            source: "#".concat(n.id)
          });
        }
      });

      return s;
    }, a.prototype.formatTransitions = function () {
      var t,
          e,
          a,
          c = this;
      if (this.config.on) {
        if (Array.isArray(this.config.on)) a = this.config.on;else {
          var u = this.config.on,
              h = u["*"],
              f = void 0 === h ? [] : h,
              l = n(u, ["*"]);
          a = g(s(l).map(function (t) {
            return D(t, l[t]);
          }).concat(D("*", f)));
        }
      } else a = [];
      var d = this.config.always ? D("", this.config.always) : [],
          p = this.config.onDone ? D(String(Tt(this.id)), this.config.onDone) : [],
          v = g(this.invoke.map(function (t) {
        var e = [];
        return t.onDone && e.push.apply(e, o([], i(D(String(Nt(t.id)), t.onDone)), !1)), t.onError && e.push.apply(e, o([], i(D(String(At(t.id)), t.onError)), !1)), e;
      })),
          y = this.after,
          m = g(o(o(o(o([], i(p), !1), i(v), !1), i(a), !1), i(d), !1).map(function (t) {
        return S(t).map(function (t) {
          return c.formatTransition(t);
        });
      }));

      try {
        for (var x = r(y), w = x.next(); !w.done; w = x.next()) {
          var b = w.value;
          m.push(b);
        }
      } catch (e) {
        t = {
          error: e
        };
      } finally {
        try {
          w && !w.done && (e = x["return"]) && e.call(x);
        } finally {
          if (t) throw t.error;
        }
      }

      return m;
    }, a;
  }();

  var Ft = {
    deferEvents: !1
  },
      Ut = function () {
    function t(t) {
      this.processingEvent = !1, this.queue = [], this.initialized = !1, this.options = _e(_e({}, Ft), t);
    }

    return t.prototype.initialize = function (t) {
      if (this.initialized = !0, t) {
        if (!this.options.deferEvents) return void this.schedule(t);
        this.process(t);
      }

      this.flushEvents();
    }, t.prototype.schedule = function (t) {
      if (this.initialized && !this.processingEvent) {
        if (0 !== this.queue.length) throw new Error("Event queue should be empty when it is not processing events");
        this.process(t), this.flushEvents();
      } else this.queue.push(t);
    }, t.prototype.clear = function () {
      this.queue = [];
    }, t.prototype.flushEvents = function () {
      for (var t = this.queue.shift(); t;) {
        this.process(t), t = this.queue.shift();
      }
    }, t.prototype.process = function (t) {
      this.processingEvent = !0;

      try {
        t();
      } catch (t) {
        throw this.clear(), t;
      } finally {
        this.processingEvent = !1;
      }
    }, t;
  }(),
      Bt = new Map(),
      Jt = 0,
      qt = function qt() {
    return "x:".concat(Jt++);
  },
      $t = function $t(t, e) {
    return Bt.set(t, e), t;
  },
      Xt = function Xt(t) {
    return Bt.get(t);
  },
      Ht = function Ht(t) {
    Bt["delete"](t);
  };

  function Gt() {
    return "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0;
  }

  function Kt(t) {
    if (Gt()) {
      var e = function () {
        var t = Gt();
        if (t && "__xstate__" in t) return t.__xstate__;
      }();

      e && e.register(t);
    }
  }

  function Qt(t, n) {
    void 0 === n && (n = {});
    var r,
        i = t.initialState,
        o = new Set(),
        a = [],
        s = !1,
        c = (r = {
      id: n.id,
      send: function send(e) {
        a.push(e), function () {
          if (!s) {
            for (s = !0; a.length > 0;) {
              var e = a.shift();
              i = t.transition(i, e, u), o.forEach(function (t) {
                return t.next(i);
              });
            }

            s = !1;
          }
        }();
      },
      getSnapshot: function getSnapshot() {
        return i;
      },
      subscribe: function subscribe(t, e, n) {
        var r = z(t, e, n);
        return o.add(r), r.next(i), {
          unsubscribe: function unsubscribe() {
            o["delete"](r);
          }
        };
      }
    }, _e({
      subscribe: function subscribe() {
        return {
          unsubscribe: function unsubscribe() {}
        };
      },
      id: "anonymous",
      getSnapshot: function getSnapshot() {}
    }, r)),
        u = {
      parent: n.parent,
      self: c,
      id: n.id || "anonymous",
      observers: o
    };
    return i = t.start ? t.start(u) : i, c;
  }

  var Wt,
      Yt = {
    sync: !1,
    autoForward: !1
  };
  (Wt = t.InterpreterStatus || (t.InterpreterStatus = {}))[Wt.NotStarted = 0] = "NotStarted", Wt[Wt.Running = 1] = "Running", Wt[Wt.Stopped = 2] = "Stopped";

  var Zt = function () {
    function n(r, i) {
      var o = this;
      void 0 === i && (i = n.defaultOptions), this.machine = r, this.scheduler = new Ut(), this.delayedEventsMap = {}, this.listeners = new Set(), this.contextListeners = new Set(), this.stopListeners = new Set(), this.doneListeners = new Set(), this.eventListeners = new Set(), this.sendListeners = new Set(), this.initialized = !1, this.status = t.InterpreterStatus.NotStarted, this.children = new Map(), this.forwardTo = new Set(), this.init = this.start, this.send = function (e, n) {
        if (T(e)) return o.batch(e), o.state;
        var r = L(V(e, n));
        if (o.status === t.InterpreterStatus.Stopped) return o.state;
        if (o.status !== t.InterpreterStatus.Running && !o.options.deferEvents) throw new Error('Event "'.concat(r.name, '" was sent to uninitialized service "').concat(o.machine.id, '". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(r.data)));
        return o.scheduler.schedule(function () {
          o.forward(r);
          var t = o.nextState(r);
          o.update(t, r);
        }), o._state;
      }, this.sendTo = function (n, r) {
        var i,
            a = o.parent && (r === t.SpecialTargets.Parent || o.parent.id === r),
            s = a ? o.parent : A(r) ? o.children.get(r) || Xt(r) : (i = r) && "function" == typeof i.send ? r : void 0;
        if (s) "machine" in s ? s.send(_e(_e({}, n), {
          name: n.name === at ? "".concat(At(o.id)) : n.name,
          origin: o.sessionId
        })) : s.send(n.data);else if (!a) throw new Error("Unable to send event to child '".concat(r, "' from service '").concat(o.id, "'."));
      };

      var a = _e(_e({}, n.defaultOptions), i),
          s = a.clock,
          c = a.logger,
          u = a.parent,
          h = a.id,
          f = void 0 !== h ? h : r.id;

      this.id = f, this.logger = c, this.clock = s, this.parent = u, this.options = a, this.scheduler = new Ut({
        deferEvents: this.options.deferEvents
      }), this.sessionId = qt();
    }

    return Object.defineProperty(n.prototype, "initialState", {
      get: function get() {
        var t = this;
        return this._initialState ? this._initialState : jt(this, function () {
          return t._initialState = t.machine.initialState, t._initialState;
        });
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(n.prototype, "state", {
      get: function get() {
        return this._state;
      },
      enumerable: !1,
      configurable: !0
    }), n.prototype.execute = function (t, e) {
      var n, i;

      try {
        for (var o = r(t.actions), a = o.next(); !a.done; a = o.next()) {
          var s = a.value;
          this.exec(s, t, e);
        }
      } catch (t) {
        n = {
          error: t
        };
      } finally {
        try {
          a && !a.done && (i = o["return"]) && i.call(o);
        } finally {
          if (n) throw n.error;
        }
      }
    }, n.prototype.update = function (t, e) {
      var n,
          i,
          o,
          a,
          s,
          c,
          u,
          h,
          f = this;
      if (t._sessionid = this.sessionId, this._state = t, this.options.execute && this.execute(this.state), this.children.forEach(function (t) {
        f.state.children[t.id] = t;
      }), this.devTools && this.devTools.send(e.data, t), t.event) try {
        for (var l = r(this.eventListeners), d = l.next(); !d.done; d = l.next()) {
          (0, d.value)(t.event);
        }
      } catch (t) {
        n = {
          error: t
        };
      } finally {
        try {
          d && !d.done && (i = l["return"]) && i.call(l);
        } finally {
          if (n) throw n.error;
        }
      }

      try {
        for (var p = r(this.listeners), v = p.next(); !v.done; v = p.next()) {
          (0, v.value)(t, t.event);
        }
      } catch (t) {
        o = {
          error: t
        };
      } finally {
        try {
          v && !v.done && (a = p["return"]) && a.call(p);
        } finally {
          if (o) throw o.error;
        }
      }

      try {
        for (var y = r(this.contextListeners), g = y.next(); !g.done; g = y.next()) {
          (0, g.value)(this.state.context, this.state.history ? this.state.history.context : void 0);
        }
      } catch (t) {
        s = {
          error: t
        };
      } finally {
        try {
          g && !g.done && (c = y["return"]) && c.call(y);
        } finally {
          if (s) throw s.error;
        }
      }

      var m = H(t.configuration || [], this.machine);

      if (this.state.configuration && m) {
        var S = t.configuration.find(function (t) {
          return "final" === t.type && t.parent === f.machine;
        }),
            w = S && S.doneData ? x(S.doneData, t.context, e) : void 0;

        try {
          for (var b = r(this.doneListeners), _ = b.next(); !_.done; _ = b.next()) {
            (0, _.value)(Nt(this.id, w));
          }
        } catch (t) {
          u = {
            error: t
          };
        } finally {
          try {
            _ && !_.done && (h = b["return"]) && h.call(b);
          } finally {
            if (u) throw u.error;
          }
        }

        this.stop();
      }
    }, n.prototype.onTransition = function (e) {
      return this.listeners.add(e), this.status === t.InterpreterStatus.Running && e(this.state, this.state.event), this;
    }, n.prototype.subscribe = function (e, n, r) {
      var i,
          o = this;
      if (!e) return {
        unsubscribe: function unsubscribe() {}
      };
      var a = r;
      return "function" == typeof e ? i = e : (i = e.next.bind(e), a = e.complete.bind(e)), this.listeners.add(i), this.status === t.InterpreterStatus.Running && i(this.state), a && this.onDone(a), {
        unsubscribe: function unsubscribe() {
          i && o.listeners["delete"](i), a && o.doneListeners["delete"](a);
        }
      };
    }, n.prototype.onEvent = function (t) {
      return this.eventListeners.add(t), this;
    }, n.prototype.onSend = function (t) {
      return this.sendListeners.add(t), this;
    }, n.prototype.onChange = function (t) {
      return this.contextListeners.add(t), this;
    }, n.prototype.onStop = function (t) {
      return this.stopListeners.add(t), this;
    }, n.prototype.onDone = function (t) {
      return this.doneListeners.add(t), this;
    }, n.prototype.off = function (t) {
      return this.listeners["delete"](t), this.eventListeners["delete"](t), this.sendListeners["delete"](t), this.stopListeners["delete"](t), this.doneListeners["delete"](t), this.contextListeners["delete"](t), this;
    }, n.prototype.start = function (e) {
      var n = this;
      if (this.status === t.InterpreterStatus.Running) return this;
      $t(this.sessionId, this), this.initialized = !0, this.status = t.InterpreterStatus.Running;
      var r = void 0 === e ? this.initialState : jt(this, function () {
        return !A(t = e) && "value" in t && "history" in t ? n.machine.resolveState(e) : n.machine.resolveState(kt.from(e, n.machine.context));
        var t;
      });
      return this.options.devTools && this.attachDev(), this.scheduler.initialize(function () {
        n.update(r, ht);
      }), this;
    }, n.prototype.stop = function () {
      var e,
          n,
          i,
          o,
          a,
          c,
          u,
          h,
          f,
          l,
          d = this;

      try {
        for (var p = r(this.listeners), v = p.next(); !v.done; v = p.next()) {
          var y = v.value;
          this.listeners["delete"](y);
        }
      } catch (t) {
        e = {
          error: t
        };
      } finally {
        try {
          v && !v.done && (n = p["return"]) && n.call(p);
        } finally {
          if (e) throw e.error;
        }
      }

      try {
        for (var g = r(this.stopListeners), m = g.next(); !m.done; m = g.next()) {
          (y = m.value)(), this.stopListeners["delete"](y);
        }
      } catch (t) {
        i = {
          error: t
        };
      } finally {
        try {
          m && !m.done && (o = g["return"]) && o.call(g);
        } finally {
          if (i) throw i.error;
        }
      }

      try {
        for (var S = r(this.contextListeners), x = S.next(); !x.done; x = S.next()) {
          y = x.value;
          this.contextListeners["delete"](y);
        }
      } catch (t) {
        a = {
          error: t
        };
      } finally {
        try {
          x && !x.done && (c = S["return"]) && c.call(S);
        } finally {
          if (a) throw a.error;
        }
      }

      try {
        for (var w = r(this.doneListeners), b = w.next(); !b.done; b = w.next()) {
          y = b.value;
          this.doneListeners["delete"](y);
        }
      } catch (t) {
        u = {
          error: t
        };
      } finally {
        try {
          b && !b.done && (h = w["return"]) && h.call(w);
        } finally {
          if (u) throw u.error;
        }
      }

      if (!this.initialized) return this;
      this.state.configuration.forEach(function (t) {
        var e, n;

        try {
          for (var i = r(t.definition.exit), o = i.next(); !o.done; o = i.next()) {
            var a = o.value;
            d.exec(a, d.state);
          }
        } catch (t) {
          e = {
            error: t
          };
        } finally {
          try {
            o && !o.done && (n = i["return"]) && n.call(i);
          } finally {
            if (e) throw e.error;
          }
        }
      }), this.children.forEach(function (t) {
        N(t.stop) && t.stop();
      });

      try {
        for (var _ = r(s(this.delayedEventsMap)), E = _.next(); !E.done; E = _.next()) {
          var T = E.value;
          this.clock.clearTimeout(this.delayedEventsMap[T]);
        }
      } catch (t) {
        f = {
          error: t
        };
      } finally {
        try {
          E && !E.done && (l = _["return"]) && l.call(_);
        } finally {
          if (f) throw f.error;
        }
      }

      return this.scheduler.clear(), this.initialized = !1, this.status = t.InterpreterStatus.Stopped, Ht(this.sessionId), this;
    }, n.prototype.batch = function (n) {
      var a = this;
      if (this.status === t.InterpreterStatus.NotStarted && this.options.deferEvents) ;else if (this.status !== t.InterpreterStatus.Running) throw new Error("".concat(n.length, ' event(s) were sent to uninitialized service "').concat(this.machine.id, '". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));
      this.scheduler.schedule(function () {
        var t,
            s,
            c = a.state,
            u = !1,
            h = [],
            f = function f(t) {
          var n = L(t);
          a.forward(n), c = jt(a, function () {
            return a.machine.transition(c, n);
          }), h.push.apply(h, o([], i(c.actions.map(function (t) {
            return r = c, i = (n = t).exec, _e(_e({}, n), {
              exec: void 0 !== i ? function () {
                return i(r.context, r.event, {
                  action: n,
                  state: r,
                  _event: r._event
                });
              } : void 0
            });
            var n, r, i;
          })), !1)), u = u || !!c.changed;
        };

        try {
          for (var l = r(n), d = l.next(); !d.done; d = l.next()) {
            f(d.value);
          }
        } catch (e) {
          t = {
            error: e
          };
        } finally {
          try {
            d && !d.done && (s = l["return"]) && s.call(l);
          } finally {
            if (t) throw t.error;
          }
        }

        c.changed = u, c.actions = h, a.update(c, L(n[n.length - 1]));
      });
    }, n.prototype.sender = function (t) {
      return this.send.bind(this, t);
    }, n.prototype.nextState = function (t) {
      var e = this,
          n = L(t);
      if (0 === n.name.indexOf(ot) && !this.state.nextEvents.some(function (t) {
        return 0 === t.indexOf(ot);
      })) throw n.data.data;
      return jt(this, function () {
        return e.machine.transition(e.state, n);
      });
    }, n.prototype.forward = function (t) {
      var e, n;

      try {
        for (var i = r(this.forwardTo), o = i.next(); !o.done; o = i.next()) {
          var a = o.value,
              s = this.children.get(a);
          if (!s) throw new Error("Unable to forward event '".concat(t, "' from interpreter '").concat(this.id, "' to nonexistant child '").concat(a, "'."));
          s.send(t);
        }
      } catch (t) {
        e = {
          error: t
        };
      } finally {
        try {
          o && !o.done && (n = i["return"]) && n.call(i);
        } finally {
          if (e) throw e.error;
        }
      }
    }, n.prototype.defer = function (t) {
      var e = this;
      this.delayedEventsMap[t.id] = this.clock.setTimeout(function () {
        t.to ? e.sendTo(t._event, t.to) : e.send(t._event);
      }, t.delay);
    }, n.prototype.cancel = function (t) {
      this.clock.clearTimeout(this.delayedEventsMap[t]), delete this.delayedEventsMap[t];
    }, n.prototype.exec = function (e, n, r) {
      void 0 === r && (r = this.machine.options.actions);
      var i = n.context,
          o = n._event,
          a = e.exec || ft(e.type, r),
          s = N(a) ? a : a ? a.exec : e.exec;
      if (s) try {
        return s(i, o.data, {
          action: e,
          state: this.state,
          _event: o
        });
      } catch (t) {
        throw this.parent && this.parent.send({
          type: "xstate.error",
          data: t
        }), t;
      }

      switch (e.type) {
        case Y:
          var c = e;
          if ("number" == typeof c.delay) return void this.defer(c);
          c.to ? this.sendTo(c._event, c.to) : this.send(c._event);
          break;

        case Z:
          this.cancel(e.sendId);
          break;

        case K:
          var u = e.activity;
          if (!this.state.activities[u.id || u.type]) break;

          if (u.type === t.ActionTypes.Invoke) {
            var h = M(u.src),
                f = this.machine.options.services ? this.machine.options.services[h.type] : void 0,
                l = u.id,
                d = u.data,
                p = "autoForward" in u ? u.autoForward : !!u.forward;
            if (!f) return;
            var v = d ? x(d, i, o) : void 0;
            if ("string" == typeof f) return;
            var y = N(f) ? f(i, o.data, {
              data: v,
              src: h,
              meta: u.meta
            }) : f;
            if (!y) return;
            var g = void 0;
            k(y) && (y = v ? y.withContext(v) : y, g = {
              autoForward: p
            }), this.spawn(y, l, g);
          } else this.spawnActivity(u);

          break;

        case Q:
          this.stopChild(e.activity.id);
          break;

        case nt:
          var m = e.label,
              S = e.value;
          m ? this.logger(m, S) : this.logger(S);
      }
    }, n.prototype.removeChild = function (t) {
      var e;
      this.children["delete"](t), this.forwardTo["delete"](t), null === (e = this.state) || void 0 === e || delete e.children[t];
    }, n.prototype.stopChild = function (t) {
      var e = this.children.get(t);
      e && (this.removeChild(t), N(e.stop) && e.stop());
    }, n.prototype.spawn = function (t, n, r) {
      if (w(t)) return this.spawnPromise(Promise.resolve(t), n);
      if (N(t)) return this.spawnCallback(t, n);
      if (function (t) {
        try {
          return "function" == typeof t.send;
        } catch (t) {
          return !1;
        }
      }(o = t) && "id" in o) return this.spawnActor(t, n);
      if (function (t) {
        try {
          return "subscribe" in t && N(t.subscribe);
        } catch (t) {
          return !1;
        }
      }(t)) return this.spawnObservable(t, n);
      if (k(t)) return this.spawnMachine(t, _e(_e({}, r), {
        id: n
      }));
      if (null !== (i = t) && "object" == typeof i && "transition" in i && "function" == typeof i.transition) return this.spawnBehavior(t, n);
      throw new Error('Unable to spawn entity "'.concat(n, '" of type "').concat(typeof t, '".'));
      var i, o;
    }, n.prototype.spawnMachine = function (t, r) {
      var i = this;
      void 0 === r && (r = {});

      var o = new n(t, _e(_e({}, this.options), {
        parent: this,
        id: r.id || t.id
      })),
          a = _e(_e({}, Yt), r);

      a.sync && o.onTransition(function (t) {
        i.send(st, {
          state: t,
          id: o.id
        });
      });
      var s = o;
      return this.children.set(o.id, s), a.autoForward && this.forwardTo.add(o.id), o.onDone(function (t) {
        i.removeChild(o.id), i.send(L(t, {
          origin: o.id
        }));
      }).start(), s;
    }, n.prototype.spawnBehavior = function (t, e) {
      var n = Qt(t, {
        id: e,
        parent: this
      });
      return this.children.set(e, n), n;
    }, n.prototype.spawnPromise = function (t, e) {
      var n,
          r = this,
          i = !1;
      t.then(function (t) {
        i || (n = t, r.removeChild(e), r.send(L(Nt(e, t), {
          origin: e
        })));
      }, function (t) {
        if (!i) {
          r.removeChild(e);
          var n = At(e, t);

          try {
            r.send(L(n, {
              origin: e
            }));
          } catch (t) {
            r.devTools && r.devTools.send(n, r.state), r.machine.strict && r.stop();
          }
        }
      });
      var o = {
        id: e,
        send: function send() {},
        subscribe: function subscribe(e, n, r) {
          var i = z(e, n, r),
              o = !1;
          return t.then(function (t) {
            o || (i.next(t), o || i.complete());
          }, function (t) {
            o || i.error(t);
          }), {
            unsubscribe: function unsubscribe() {
              return o = !0;
            }
          };
        },
        stop: function stop() {
          i = !0;
        },
        toJSON: function toJSON() {
          return {
            id: e
          };
        },
        getSnapshot: function getSnapshot() {
          return n;
        }
      };
      return this.children.set(e, o), o;
    }, n.prototype.spawnCallback = function (t, e) {
      var n,
          r,
          i = this,
          o = !1,
          a = new Set(),
          s = new Set();

      try {
        r = t(function (t) {
          n = t, s.forEach(function (e) {
            return e(t);
          }), o || i.send(L(t, {
            origin: e
          }));
        }, function (t) {
          a.add(t);
        });
      } catch (t) {
        this.send(At(e, t));
      }

      if (w(r)) return this.spawnPromise(r, e);
      var c = {
        id: e,
        send: function send(t) {
          return a.forEach(function (e) {
            return e(t);
          });
        },
        subscribe: function subscribe(t) {
          return s.add(t), {
            unsubscribe: function unsubscribe() {
              s["delete"](t);
            }
          };
        },
        stop: function stop() {
          o = !0, N(r) && r();
        },
        toJSON: function toJSON() {
          return {
            id: e
          };
        },
        getSnapshot: function getSnapshot() {
          return n;
        }
      };
      return this.children.set(e, c), c;
    }, n.prototype.spawnObservable = function (t, e) {
      var n,
          r = this,
          i = t.subscribe(function (t) {
        n = t, r.send(L(t, {
          origin: e
        }));
      }, function (t) {
        r.removeChild(e), r.send(L(At(e, t), {
          origin: e
        }));
      }, function () {
        r.removeChild(e), r.send(L(Nt(e), {
          origin: e
        }));
      }),
          o = {
        id: e,
        send: function send() {},
        subscribe: function subscribe(e, n, r) {
          return t.subscribe(e, n, r);
        },
        stop: function stop() {
          return i.unsubscribe();
        },
        getSnapshot: function getSnapshot() {
          return n;
        },
        toJSON: function toJSON() {
          return {
            id: e
          };
        }
      };
      return this.children.set(e, o), o;
    }, n.prototype.spawnActor = function (t, e) {
      return this.children.set(e, t), t;
    }, n.prototype.spawnActivity = function (t) {
      var e = this.machine.options && this.machine.options.activities ? this.machine.options.activities[t.type] : void 0;

      if (e) {
        var n = e(this.state.context, t);
        this.spawnEffect(t.id, n);
      }
    }, n.prototype.spawnEffect = function (t, e) {
      this.children.set(t, {
        id: t,
        send: function send() {},
        subscribe: function subscribe() {
          return {
            unsubscribe: function unsubscribe() {}
          };
        },
        stop: e || void 0,
        getSnapshot: function getSnapshot() {},
        toJSON: function toJSON() {
          return {
            id: t
          };
        }
      });
    }, n.prototype.attachDev = function () {
      var t = Gt();

      if (this.options.devTools && t) {
        if (t.__REDUX_DEVTOOLS_EXTENSION__) {
          var n = "object" == typeof this.options.devTools ? this.options.devTools : void 0;
          this.devTools = t.__REDUX_DEVTOOLS_EXTENSION__.connect(_e(_e({
            name: this.id,
            autoPause: !0,
            stateSanitizer: function stateSanitizer(t) {
              return {
                value: t.value,
                context: t.context,
                actions: t.actions
              };
            }
          }, n), {
            features: _e({
              jump: !1,
              skip: !1
            }, n ? n.features : void 0)
          }), this.machine), this.devTools.init(this.state);
        }

        Kt(this);
      }
    }, n.prototype.toJSON = function () {
      return {
        id: this.id
      };
    }, n.prototype[P] = function () {
      return this;
    }, n.prototype.getSnapshot = function () {
      return this.status === t.InterpreterStatus.NotStarted ? this.initialState : this._state;
    }, n.defaultOptions = function (t) {
      return {
        execute: !0,
        deferEvents: !0,
        clock: {
          setTimeout: function (_setTimeout) {
            function setTimeout(_x, _x2) {
              return _setTimeout.apply(this, arguments);
            }

            setTimeout.toString = function () {
              return _setTimeout.toString();
            };

            return setTimeout;
          }(function (t, e) {
            return setTimeout(t, e);
          }),
          clearTimeout: function (_clearTimeout) {
            function clearTimeout(_x3) {
              return _clearTimeout.apply(this, arguments);
            }

            clearTimeout.toString = function () {
              return _clearTimeout.toString();
            };

            return clearTimeout;
          }(function (t) {
            return clearTimeout(t);
          })
        },
        logger: t.console.log.bind(console),
        devTools: !1
      };
    }("undefined" != typeof self ? self : global), n.interpret = te, n;
  }();

  function te(t, e) {
    return new Zt(t, e);
  }

  var ee = {
    raise: vt,
    send: yt,
    sendParent: gt,
    sendUpdate: mt,
    log: function log(t, e) {
      return void 0 === t && (t = St), {
        type: nt,
        label: e,
        expr: t
      };
    },
    cancel: xt,
    start: wt,
    stop: bt,
    assign: _t,
    after: Et,
    done: Tt,
    respond: function respond(t, n) {
      return yt(t, _e(_e({}, n), {
        to: function to(t, e, n) {
          return n._event.origin;
        }
      }));
    },
    forwardTo: Ot,
    escalate: function escalate(n, r) {
      return gt(function (t, e, r) {
        return {
          type: at,
          data: N(n) ? n(t, e, r) : n
        };
      }, _e(_e({}, r), {
        to: t.SpecialTargets.Parent
      }));
    },
    choose: function choose(e) {
      return {
        type: t.ActionTypes.Choose,
        conds: e
      };
    },
    pure: function pure(e) {
      return {
        type: t.ActionTypes.Pure,
        get: e
      };
    }
  };
  t.Interpreter = Zt, t.Machine = function (t, e, n) {
    return void 0 === n && (n = t.context), new zt(t, e, n);
  }, t.State = kt, t.StateNode = zt, t.actions = ee, t.assign = _t, t.createMachine = function (t, e) {
    return new zt(t, e);
  }, t.createSchema = function (t) {
    return t;
  }, t.doneInvoke = Nt, t.forwardTo = Ot, t.interpret = te, t.mapState = function (t, e) {
    var n, i, o;

    try {
      for (var a = r(s(t)), u = a.next(); !u.done; u = a.next()) {
        var h = u.value;
        c(h, e) && (!o || e.length > o.length) && (o = h);
      }
    } catch (t) {
      n = {
        error: t
      };
    } finally {
      try {
        u && !u.done && (i = a["return"]) && i.call(a);
      } finally {
        if (n) throw n.error;
      }
    }

    return t[o];
  }, t.matchState = function (t, e, n) {
    var o,
        a,
        s = kt.from(t, t instanceof kt ? t.context : void 0);

    try {
      for (var c = r(e), u = c.next(); !u.done; u = c.next()) {
        var h = i(u.value, 2),
            f = h[0],
            l = h[1];
        if (s.matches(f)) return l(s);
      }
    } catch (t) {
      o = {
        error: t
      };
    } finally {
      try {
        u && !u.done && (a = c["return"]) && a.call(c);
      } finally {
        if (o) throw o.error;
      }
    }

    return n(s);
  }, t.matchesState = c, t.send = yt, t.sendParent = gt, t.sendUpdate = mt, t.spawn = function (t, n) {
    var r = function (t) {
      return A(t) ? _e(_e({}, Yt), {
        name: t
      }) : _e(_e(_e({}, Yt), {
        name: C()
      }), t);
    }(n);

    return function (e) {
      return e ? e.spawn(t, r.name, r) : Vt(t, r.name);
    }(It[It.length - 1]);
  }, Object.defineProperty(t, "__esModule", {
    value: !0
  });
});

cc._RF.pop();

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 237696 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/OP15/scene/OP15.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ddbf4iIJnhHIImfp+SKRF1C', 'OP15');
// OP15/scene/OP15.js

"use strict";

var _util = require("../script/util");

var _defaultData = require("../script/defaultData");

var _xstate = require("../script/xstate");

function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var pure = _xstate.actions.pure,
    send = _xstate.actions.send,
    raise = _xstate.actions.raise,
    sendParent = _xstate.actions.sendParent;
cc.Class({
  "extends": cc.Component,
  properties: {
    /*ant: {
    	default: null,
    	type: cc.Node,
    },
    apple: {
    	default: null,
    	type: cc.Node,
    },
    bird: {
    	default: null,
    	type: cc.Node,
    },
    car: {
    	default: null,
    	type: cc.Node,
    },
    cat: {
    	default: null,
    	type: cc.Node,
    },
    cow: {
    	default: null,
    	type: cc.Node,
    },
    duck: {
    	default: null,
    	type: cc.Node,
    },
    egg: {
    	default: null,
    	type: cc.Node,
    },
    farmer: {
    	default: null,
    	type: cc.Node,
    },
    fish: {
    	default: null,
    	type: cc.Node,
    },
    girl: {
    	default: null,
    	type: cc.Node,
    },
    hen: {
    	default: null,
    	type: cc.Node,
    },
    house: {
    	default: null,
    	type: cc.Node,
    },*/
    rightAudio: {
      "default": null,
      type: cc.AudioClip
    },
    wrongAudio: {
      "default": null,
      type: cc.AudioClip
    },
    logoCat: {
      "default": null,
      type: cc.Node
    }
  },
  playAni: function playAni(idx, name, options) {
    var times = options && options.times || 1;
    var cb = options && options.callback || null; // const cat = cc.find(`Canvas/frame-border/ground/${node}`);

    var node = this._figurePointRectArray[idx].node;
    var dragonDisplay = node.getComponent(dragonBones.ArmatureDisplay);
    var state = dragonDisplay.playAnimation(name, times); // dragonDisplay.addEventListener(dragonBones.EventObject.COMPLETE, (event) => {
    // 	//TODO 这里写触发事件
    // 	//event.name为事件名称
    // 	console.log(event.name)
    // }, this);
    // animationDisplay.addEventListener(dragonBones.EventObject.COMPLETE, completeCallback);

    return state;
  },
  // 生命周期 onLoad
  onLoad: function onLoad() {
    this._timeoutIds = [];
    this._intervalIds = [];
    this.initSceneData();
    this.initSize();
    window.ccc = this;
  },
  _imageResList: null,
  _audioResList: null,
  _animaResList: null,
  _lastFingerPosition: null,
  _hintsNodeList: null,
  _figurePointRectArray: null,
  _allAnimationNodes: null,
  initSceneData: function initSceneData() {
    this._imageResList = [];
    this._audioResList = [];
    this._animaResList = [];
    this._allAnimationNodes = [];
    this._hintsNodeList = [];
    this._lastFingerPosition = {
      pos: null,
      dirty: false
    };
    this._figurePointRectArray = [];
  },
  _designSize: null,
  // 设计分辨率
  _frameSize: null,
  // 屏幕分辨率
  _mapScaleMin: null,
  // 场景中常用缩放（取大值）
  _mapScaleMax: null,
  // 场景中常用缩放（取小值）
  _cocosScale: null,
  // cocos 自缩放 （较少用到）
  initSize: function initSize() {
    // 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
    var screen_size = cc.view.getFrameSize().width / cc.view.getFrameSize().height;
    var design_size = cc.Canvas.instance.designResolution.width / cc.Canvas.instance.designResolution.height;
    var f = screen_size >= design_size;
    cc.Canvas.instance.fitHeight = f;
    cc.Canvas.instance.fitWidth = !f;
    var frameSize = cc.view.getFrameSize();
    this._frameSize = frameSize;
    this._designSize = cc.view.getDesignResolutionSize();
    var sx = cc.winSize.width / frameSize.width;
    var sy = cc.winSize.height / frameSize.height;
    this._cocosScale = Math.min(sx, sy);
    sx = frameSize.width / this._designSize.width;
    sy = frameSize.height / this._designSize.height;
    this._mapScaleMin = Math.min(sx, sy) * this._cocosScale;
    this._mapScaleMax = Math.max(sx, sy) * this._cocosScale;
  },
  createStateMachine: function createStateMachine() {
    var _this = this;

    var check = [{
      target: '#game.end',
      cond: function cond(ctx, evt) {
        console.log('[answer NEXT] check if end', ctx.questionIndex >= ctx.questionsCount - 1);
        return ctx.questionIndex >= ctx.questionsCount - 1;
      }
    }, {
      target: 'hint'
    } // reenter 'hint' state
    ];
    var QuestionState = {
      id: 'question',
      initial: 'hint',
      states: {
        hint: {
          invoke: {
            src: function src(ctx, event) {
              console.log("[hint] play question " + ctx.questionIndex + ": " + ctx.questionPlayTimes + " audio");
              ctx.questionPlayTimes += 1;
              return new Promise(function (resolve, reject) {
                (0, _util.playAudioByUrl)(ctx.questions[ctx.questionIndex].audio_url, function () {
                  console.log('hint finish');
                  resolve();
                });
              });
            },
            onDone: 'answer',
            onError: 'answer'
          }
        },
        answer: {
          after: {
            8000: [{
              target: 'wrong'
            } // reenter 'hint' state
            ]
          },
          invoke: {
            src: function src(context, event) {
              return function (callback, onReceive) {
                console.log('[answer] thinking and playing'); // check every second

                var id = setInterval(function () {
                  if (!_this._lastFingerPosition.dirty) {
                    return;
                  }

                  var region = context.questions[context.questionIndex];

                  var result = _this.checkInRegion(region.rect);

                  if (result === null) {
                    return;
                  }

                  console.log('[Genise JS] checkInRegion' + result);

                  if (result) {
                    callback('RIGHT');
                  } else {
                    callback('WRONG');
                  }
                }, 100);

                _this._intervalIds.push(id); // Perform cleanup


                return function () {
                  return clearInterval(id);
                };
              };
            }
          },
          on: {
            RIGHT: {
              target: 'right'
            },
            WRONG: {
              target: 'wrong'
            }
          }
        },
        right: {
          invoke: {
            src: function src(context, event) {
              _this._lastFingerPosition.pos = null;
              _this._lastFingerPosition.dirty = false;
              return new Promise(function (resolve, reject) {
                console.log('answer right'); // this.playAni(context.questionIndex, 'normal')

                var an = context.questions[context.questionIndex].node;
                console.log('in right ' + typeof an);
                an.active = true;

                if (an.isSpine) {
                  var skeleton = an.getComponent(sp.Skeleton);
                  skeleton.setToSetupPose();
                  setTimeout(function () {
                    skeleton.setAnimation(0, 'normal', true);
                  }, 1);
                } else {
                  var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
                  dragonDisplay.playAnimation('normal', 0);
                }

                var ddLogoCat = _this.logoCat.getComponent(dragonBones.ArmatureDisplay);

                ddLogoCat.playAnimation('right', 1);
                ddLogoCat.once(dragonBones.EventObject.COMPLETE, function () {
                  this.logoCat.getComponent(dragonBones.ArmatureDisplay).playAnimation('normal', 0);
                }, _this);
                (0, _util.playAudioByUrl)(_this.rightAudio, function () {
                  resolve();
                });
              });
            },
            onDone: {
              target: '#QuestionsArray.next',
              actions: raise('CHECK')
            },
            onError: {
              target: '#QuestionsArray.next',
              actions: raise('CHECK')
            }
          }
        },
        wrong: {
          invoke: {
            src: function src(context, event) {
              _this._lastFingerPosition.pos = null;
              _this._lastFingerPosition.dirty = false;
              return new Promise(function (resolve, reject) {
                console.log('answer wrong', context.questionIndex, context.questionPlayTimes, context.maxQuestionTryTimes);

                var ddLogoCat = _this.logoCat.getComponent(dragonBones.ArmatureDisplay);

                ddLogoCat.playAnimation('wrong', 1);
                ddLogoCat.once(dragonBones.EventObject.COMPLETE, function () {
                  this.logoCat.getComponent(dragonBones.ArmatureDisplay).playAnimation('normal', 0);
                }, _this);
                var wrongEffect = _this.wrongAudio; // 第一和第二题的提示音

                if ([0, 1].includes(context.questionIndex)) {
                  wrongEffect = _this.data["wrong_audio" + context.questionPlayTimes];
                } else {
                  // 非第一和第二题，并且做第二遍的提示音
                  if (context.questionPlayTimes == 2) {
                    wrongEffect = _this.data["wrong_audio" + context.questionPlayTimes];
                  }
                }

                if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
                  var an = context.questions[context.questionIndex].node;
                  an.active = true;

                  if (an.isSpine) {
                    var skeleton = an.getComponent(sp.Skeleton);
                    skeleton.setToSetupPose();
                    setTimeout(function () {
                      skeleton.setAnimation(0, 'normal', true);
                    }, 1);
                  } else {
                    var dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
                    dragonDisplay.playAnimation('normal', 0);
                    console.log('show animation', an.active);
                  }
                }

                (0, _util.playAudioByUrl)(wrongEffect, function () {
                  if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
                    // const an = context.questions[context.questionIndex].node;
                    // an.active = true;
                    // const dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
                    // dragonDisplay.playAnimation('normal', 0);
                    // console.log('show animation', an.active);
                    reject();
                  } else {
                    resolve();
                  }
                });
              });
            },
            onDone: {
              target: 'hint' // actions: raise('CHECK')

            },
            onError: {
              target: '#QuestionsArray.next',
              actions: raise('CHECK')
            }
          }
        }
      }
    };
    var QuestionsArrayStatus = {
      id: 'QuestionsArray',
      initial: 'play',
      states: {
        play: _extends({}, QuestionState),
        next: {
          on: {
            CHECK: [{
              target: '#game.end',
              cond: function cond(ctx, evt) {
                ctx.questionIndex += 1;
                ctx.questionPlayTimes = 0;
                console.log('#game.end', ctx.questionIndex >= ctx.questionsCount);
                return ctx.questionIndex >= ctx.questionsCount;
              }
            }, {
              target: 'play'
            }]
          }
        }
      }
    };
    var state = {
      id: 'game',
      initial: 'begin',
      context: {
        questionIndex: 0,
        questionPlayTimes: 0,
        maxQuestionTryTimes: 2,
        questionsCount: this._figurePointRectArray.length,
        questions: this._figurePointRectArray
      },
      states: {
        begin: {
          invoke: {
            src: function src(ctx) {
              console.log('game begin 1');

              if (window.courseware && window.courseware.openOsmoFingerRead) {
                _this.isOpenedOsmoFingerRead = true;
                window.courseware.openOsmoFingerRead({
                  "page_id": 27,
                  "book_id": "opw1"
                });
              }

              var dragonDisplay = _this.logoCat.getComponent(dragonBones.ArmatureDisplay);

              var state = dragonDisplay.playAnimation('begin', 0);
              return new Promise(function (resolve, reject) {
                (0, _util.playAudioByUrl)(_this.data.begin_audio, function () {
                  console.log('game begin audio finish');
                  resolve();
                });
              });
            },
            onDone: 'guide',
            onError: 'guide'
          }
        },
        guide: {
          invoke: {
            src: function src(ctx) {
              return new Promise(function (resolve, reject) {
                (0, _util.playAudioByUrl)(_this.data.guide_audio, function () {
                  console.log('game guide audio finish');
                  reject();
                });
              });
            },
            onDone: 'playing',
            onError: 'playing'
          }
        },
        playing: _extends({
          entry: function entry(ctx) {
            console.log('entry play stage');

            var dragonDisplay = _this.logoCat.getComponent(dragonBones.ArmatureDisplay);

            var state = dragonDisplay.playAnimation('normal', 0);
            cc.assetManager.loadRemote(_this.data.playing_audio, function (err, audioClip) {
              cc.audioEngine.playMusic(audioClip, true, 0.8);
            });
            ctx.questions.forEach(function (block) {
              block.node.active = false;
            });
          },
          exit: function exit() {
            console.log('exit play stage');
            cc.audioEngine.stopMusic();
          },
          on: {
            NEXT: 'end'
          }
        }, QuestionsArrayStatus),
        end: {
          entry: function entry(ctx, event) {
            console.log('game end');

            var dragonDisplay = _this.logoCat.getComponent(dragonBones.ArmatureDisplay);

            var state = dragonDisplay.playAnimation('finish', 0);

            if (window.courseware && window.courseware.closeOsmoFingerRead) {
              _this.isOpenedOsmoFingerRead = false;
              window.courseware.closeOsmoFingerRead();
            }

            (0, _util.playAudioByUrl)(_this.data.end_audio, function () {
              console.log('game finish');
              (0, _util.onHomeworkFinish)();
            }); // return new Promise((resolve,reject) => {
            // 	setTimeout(() => {
            // 		console.log('hint finish');
            // 		resolve()
            // 	}, 2000)
            // })
          }
        }
      }
    };
    var after = {};

    var _loop = function _loop(i) {
      var t = _this._hintsNodeList[i].node;
      var k = _this._hintsNodeList[i].after;
      after[k] = {
        actions: function actions() {
          if (t.isSpine) {
            var skeleton = t.getComponent(sp.Skeleton);
            skeleton.setToSetupPose();
            setTimeout(function () {
              skeleton.setAnimation(0, 'enlarge', false);
            }, 1); // skeleton.animation = skeleton.animationNames[0];
          } else {
            var dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay);
            dragonDisplay.playAnimation('enlarge', 1);
            console.log(dragonDisplay._armatureKey, 'enlarge');
            dragonDisplay.addEventListener(dragonBones.EventObject.COMPLETE, function (event) {// TODO 这里写触发事件
              // event.name为事件名称
              // event.armature.animation.play('normal', 0);
              // console.log(event.animationState.name, dragonDisplay._armatureKey, 'end')
            }, _this);
          } // const dragonDisplay = t.getComponent(dragonBones.ArmatureDisplay);
          // dragonDisplay.playAnimation('enlarge', 1);
          // console.log(dragonDisplay._armatureKey, 'enlarge')
          // dragonDisplay.addEventListener(dragonBones.EventObject.COMPLETE, (event) => {
          // 	//TODO 这里写触发事件
          // 	//event.name为事件名称
          // 	event.armature.animation.play('normal', 0);
          // 	console.log(event.animationState.name, dragonDisplay._armatureKey, 'end')
          // }, this);

        }
      };
    };

    for (var i = 0; i < this._hintsNodeList.length; i++) {
      _loop(i);
    }

    if (this.data.begin_sep_time) {
      var t = +this.data.begin_sep_time * 1000;
      after[t] = {
        actions: function actions() {
          console.log('game begin 2');

          for (var _i = 0; _i < _this._allAnimationNodes.length; _i++) {
            var _t = _this._allAnimationNodes[_i];

            if (_t.isSpine) {
              (function () {
                var skeleton = _t.getComponent(sp.Skeleton);

                console.log('skeleton: ', skeleton);
                skeleton.setToSetupPose();
                setTimeout(function () {
                  skeleton.setAnimation(0, 'normal', true);
                }, 1);
                console.log('skeleton 22: ', skeleton); // skeleton.animation = skeleton.animationNames[0];
              })();
            } else {
              var dragonDisplay = _t.getComponent(dragonBones.ArmatureDisplay);

              dragonDisplay.playAnimation('normal', 0);
            }
          }
        }
      };
    }

    state.states.begin.after = after;
    var gameMachine = (0, _xstate.createMachine)(state);
    window.gameMachine = gameMachine;
    this.gameMachineService = (0, _xstate.interpret)(gameMachine).onTransition(function (state) {// console.log(1, state.value, state.context);
    });
    this.gameMachineService.start();

    if (window.gameMachineService) {
      window.gameMachineService = gameMachineService;
    }
  },
  // 生命周期 start
  start: function start() {
    var _this2 = this;

    var getData = this.getData.bind(this);

    if (window && window.courseware) {
      getData = window.courseware.getData;
    }

    getData(function (data) {
      // console.log('data:', data);
      _this2.data = data || _this2.getDefaultData();
      _this2.data = JSON.parse(JSON.stringify(_this2.data));

      _this2.preloadItem();
    });
    window.air = window.air || {};

    if (window.air) {
      window.air.osmoFingerReadCallback = function (result) {
        if (!_this2.gameMachineService) {
          return;
        } // const st = this.gameMachineService.state.value.constructor.name == 'Object' 
        // && this.gameMachineService.state.value['playing']
        // && this.gameMachineService.state.value['playing'].constructor.name == 'Object'
        // && this.gameMachineService.state.value['playing']['play']
        // && this.gameMachineService.state.value['playing']['play'] == 'answer'
        // if (st) {
        // }


        var resultObj = JSON.parse(result);
        console.log('[Genise JS] ' + JSON.stringify(resultObj.finger_pos_in_page));
        var p = resultObj.finger_pos_in_page;

        if (p.x == -1 || p.y == -1) {
          _this2._lastFingerPosition.pos = null;
          _this2._lastFingerPosition.dirty = false;
          return;
        }

        _this2._lastFingerPosition = {
          pos: {
            x: p.x,
            y: p.y
          },
          dirty: true
        };

        _this2.debugPointer(p.x, p.y);
      };
    }

    this.isDebug = false;
  },
  checkInRegion: function checkInRegion(r) {
    if (!this._lastFingerPosition && !this._lastFingerPosition.pos) {
      return null;
    }

    var p = this._lastFingerPosition ? this._lastFingerPosition.pos || {
      x: 0,
      y: 0
    } : {
      x: 0,
      y: 0
    };
    console.log('~p: ', p);
    console.log('~r: ', r);
    var w = p.x > r.x && p.x < r.x + r.width;
    var h = p.y > r.y && p.y < r.y + r.height;
    return w && h;
  },
  getData: function getData(func) {
    if (window && window.courseware) {
      window.courseware.getData(func, 'scene');
      return;
    }

    var middleLayer = cc.find('middleLayer');

    if (middleLayer) {
      var middleLayerComponent = middleLayer.getComponent('middleLayer');
      middleLayerComponent.getData(func);
      return;
    }

    func(this.getDefaultData());
  },
  getDefaultData: function getDefaultData() {
    return {
      "begin_audio": "https://teach.cdn.ireadabc.com/9be46c9adb540ed8a60763f1e657ccb7.mp3",
      "begin_sep_time": 66,
      "guide_audio": "https://teach.cdn.ireadabc.com/9523c8ed45faee686363dd157b0d7426.mp3",
      "playing_audio": "https://teach.cdn.ireadabc.com/d6a953052a6f80549730cb4307c55719.mp3",
      "right_audio": "https://teach.cdn.ireadabc.com/43791fc418e666df5e9ec1b7bf936409.mp3",
      "wrong_audio": "https://teach.cdn.ireadabc.com/7dd85f025a132c2eef8daee38d900287.mp3",
      "wrong_audio1": "https://teach.cdn.ireadabc.com/a76afb06af0799bf538e38f9f80a2261.mp3",
      "wrong_audio2": "https://teach.cdn.ireadabc.com/daee88b6f2eadd78b60436eedffcae08.mp3",
      "end_audio": "https://teach.cdn.ireadabc.com/9c1e87b3c184b06e14e44bb058b9804e.mp3",
      "bgItem": {
        "url": "https://teach.cdn.ireadabc.com/16b6dacd8e6c1ce6da16f500a66b366b.jpg",
        "rect": {
          "x": 319.68,
          "y": 0,
          "width": 257.64,
          "height": 342
        }
      },
      "hotZoneItemArr": [{
        "id": "1650544807877",
        "index": 0,
        "itemType": "pic",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 176.65207877461702
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/66c7c0847c33f7f95cb0035fe14c4405.json",
          "name": "monkey_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/98a8272cd2d97047b090ff10e948b978.json",
          "name": "monkey_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/c35ced408ad68a52c4ec5375373d3627.png",
          "name": "monkey_tex.png"
        },
        "rect": {
          "x": 128.83,
          "y": 171,
          "width": 0,
          "height": 0
        }
      }, {
        "id": "1650546079000",
        "index": 1,
        "audio_url": "https://teach.cdn.ireadabc.com/f9edc84a669688c5abddd55e2aab015d.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "21.3",
        "posX": 692.4127500193598,
        "posY": 218.14695959185556,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/e3c67a25dd3bb34fe113e126e6e1cc81.json",
          "name": "ox_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/81d487bf31d3a4d0f25f44c184ba9233.json",
          "name": "ox_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/e199392b52a735f6e37a6815ec3bb10e.png",
          "name": "ox_tex.png"
        },
        "rect": {
          "x": 159.34,
          "y": 138.66,
          "width": 38.83,
          "height": 38.83
        }
      }, {
        "id": "1650546232189",
        "index": 2,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/0a3ea93c62ff4087859ed587020c53b5.json",
          "name": "car_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/6000e4fbbb95f545afa5456c64d8c7d1.json",
          "name": "car_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/75e9972c15d2a67deedf60d448fd4e69.png",
          "name": "car_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650546321127",
        "index": 3,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/d4c1e1abcf3d8f5415747fd2599b8a8c.json",
          "name": "Chair_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/1d7254eb7fa3008e8178347bb944cdcb.json",
          "name": "Chair_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/48e85e8ff384eed72dfe865fc981e18c.png",
          "name": "Chair_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650546335240",
        "index": 4,
        "audio_url": "https://teach.cdn.ireadabc.com/6182d46bad09fccb8934217d33557204.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "53",
        "posX": 452.5,
        "posY": 129,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/b462d80c21aa75995dd99f0f43ccf1e6.json",
          "name": "quilt_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/866c9e2987870947fc63bce108ef157a.json",
          "name": "quilt_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/d952c37f40c3cf07e024edfd4416423e.png",
          "name": "quilt_tex.png"
        },
        "rect": {
          "x": 71.99,
          "y": 100.75,
          "width": 50.83,
          "height": 36.97
        }
      }, {
        "id": "1650546644333",
        "index": 5,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/6b8a1a7b0fd23686ea60465279cd4da0.json",
          "name": "robot_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/31a74ed95fe48adab00702675811c3a8.json",
          "name": "robot_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/e57052537d89356b0a79d8cb77980219.png",
          "name": "robot_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650546658697",
        "index": 6,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/bf3616060460439eeb3fd5227370e15a.json",
          "name": "panda_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/2dafeb25c973c910035ff7ed1a6a6334.json",
          "name": "panda_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/75d90b05345fa470285ac488cb205cfd.png",
          "name": "panda_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650546672448",
        "index": 7,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/5feff811b0117dd8e67973072e60d310.json",
          "name": "queen_1_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/bb5856b92b09c5fe7a1da00bb68134ca.json",
          "name": "queen_1_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/f4e5a138b086ef3dcfa57432543b66e9.png",
          "name": "queen_1_tex.png"
        },
        "animType": "dragonBone",
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650546687069",
        "index": 8,
        "audio_url": "https://teach.cdn.ireadabc.com/301858df7b07e661426a006acb26059c.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "42.5",
        "posX": 512.3883524629834,
        "posY": 259.83617125849,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/f3a8efcd1850ee8a6cee89a18e86dc4a.json",
          "name": "milk_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/73b05f19d419bd3ac17c2b92dab88423.json",
          "name": "milk_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/e38375da46f85a23202d5cbc812d62e4.png",
          "name": "milk_tex.png"
        },
        "rect": {
          "x": 37.72,
          "y": 168.1,
          "width": 21.17,
          "height": 40.34
        }
      }, {
        "id": "1650547060490",
        "index": 9,
        "audio_url": "https://teach.cdn.ireadabc.com/05e5b29aeffa4ef94bcc5b23167aec90.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "47.7",
        "posX": 483.22135734006736,
        "posY": 245.38039407076505,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/99a6e6d9361eca7e51ed34ca2e0fd017.json",
          "name": "bird_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/6a379ddbe6df1806368c43c8ee82332d.json",
          "name": "bird_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/cf04c63104d89511902578944061f980.png",
          "name": "bird_tex.png"
        },
        "rect": {
          "x": 17.91,
          "y": 140.83,
          "width": 18.52,
          "height": 73.95
        }
      }, {
        "id": "1650547373869",
        "index": 10,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "labelText": "60",
        "posX": 420.5,
        "posY": 295,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/7ebc28f3f339b16ca48d20f2a3eb44c1.json",
          "name": "alligator_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/b04e8206fd217bd22dcdac1008393317.json",
          "name": "alligator_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/b3990d94612bd3d6e25cf200f85e4334.png",
          "name": "alligator_tex.png"
        },
        "rect": {
          "x": 16.06,
          "y": 229.24,
          "width": 103.52,
          "height": 86.89
        }
      }, {
        "id": "1650547482398",
        "index": 11,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/a19f2ed7c297c70c639e54e969d64593.json",
          "name": "rabbit_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/4b4f8189cf79fadd7e6533ad84db96be.json",
          "name": "rabbit_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/8f953c861eac94e4e22a8e4ec3eb56b5.png",
          "name": "rabbit_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650547496232",
        "index": 12,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/89e0fc6085c294866142803b4ff267ba.json",
          "name": "King_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/d6cfd2d9cd2cd9aff09ab7f03e287421.json",
          "name": "King_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/8c02c3561a2eea0423cb1102200e76f9.png",
          "name": "King_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650547510648",
        "index": 13,
        "audio_url": "https://teach.cdn.ireadabc.com/717ee9713b18d32d38ee089c0abc85ea.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "10.2",
        "posX": 641.6680134951944,
        "posY": 288.93672702541255,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/3b7113ebdedcae54be6d0b9633875b88.json",
          "name": "net_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/fc810762f1f2025585e722e43e94137b.json",
          "name": "net_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/5c90820da4f559280fee4579e8db2dbc.png",
          "name": "net_tex.png"
        },
        "rect": {
          "x": 123.03,
          "y": 183.02,
          "width": 37.9,
          "height": 52.68
        }
      }, {
        "id": "1650547555018",
        "index": 14,
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "1",
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/0a5c8df5a23aca7a7540b87340c7608f.json",
          "name": "ostrich_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/2478573c91d1a83fa038e7f6a9db8a85.json",
          "name": "ostrich_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/4619ace67e5770e1fd7fc3ff76e7263e.png",
          "name": "ostrich_tex.png"
        },
        "rect": {
          "x": 36.4,
          "y": 78.56,
          "width": 184.87,
          "height": 184.87
        }
      }, {
        "id": "1650547573305",
        "index": 15,
        "audio_url": "https://teach.cdn.ireadabc.com/b7bc161c3a3ee143a53058691abf4fa9.mp3",
        "itemType": "rect",
        "fontScale": 0.70078125,
        "imgScale": 1,
        "imgSizeW": 0,
        "imgSizeH": 0,
        "mapScale": 0.70078125,
        "dragDot": {
          "x": 448.5,
          "y": 170.54984583761566
        },
        "gIdx": "0",
        "labelText": "15.9",
        "posX": 670.8119839772754,
        "posY": 137.87940870201697,
        "skeJsonData": {
          "url": "https://teach.cdn.ireadabc.com/91e8ca03d1df89e4ec2404421d4c692f.json",
          "name": "durazno_ske.json"
        },
        "texJsonData": {
          "url": "https://teach.cdn.ireadabc.com/32d259b0194370625f8fe94b1ddc0a85.json",
          "name": "durazno_tex.json"
        },
        "texPngData": {
          "url": "https://teach.cdn.ireadabc.com/8eef56b20e221a36fce1d672199859ff.png",
          "name": "durazno_tex.png"
        },
        "rect": {
          "x": 146.92,
          "y": 83.73,
          "width": 32.34,
          "height": 32.34
        }
      }]
    }; // return  {"begin_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","begin_sep_time":1,"guide_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","playing_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","right_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio1":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","wrong_audio2":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","end_audio":"http://staging-teach.cdn.ireadabc.com/3d307a02663e1cd667b7c951340ec98b.mp3","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/84ec6edc20bceaaa9dbe824092b6860d.png","rect":{"x":736.95,"y":0,"width":599.09,"height":775}},"hotZoneItemArr":[{"id":"1659333645573","index":0,"audio_url":"http://staging-teach.cdn.ireadabc.com/5a1a2670845bfe76662e86d9a3a69f81.mp3","itemType":"rect","fontScale":1.61953125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.61953125,"dragDot":{"x":1036.5,"y":387.5},"gIdx":"1","labelText":"1","posX":887.5,"posY":165.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/133a1f60719ed26247e35dc022d82862.json","name":"spineboy-pro.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/e0945b8265ea3b8053afb814c6b849d3.atlas","name":"spineboy-pro.atlas"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/517553f50224915148f9efc5b7556798.png","name":"spineboy-pro.png"},"animType":"spine","rect":{"x":48.05,"y":65.5,"width":205,"height":200}},{"id":"1659334098930","index":1,"audio_url":"http://staging-teach.cdn.ireadabc.com/16eb06a6beb9e4fa77c9b5d2d643ab29.mp3","itemType":"rect","fontScale":1.61953125,"imgScale":1,"imgSizeW":0,"imgSizeH":0,"mapScale":1.61953125,"dragDot":{"x":1036.5,"y":387.5},"gIdx":"0","labelText":"1","posX":1212.5,"posY":643.5,"skeJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/679fed26daa464819d553de6331b3552.json","name":"alien-pro.json"},"texJsonData":{"url":"http://staging-teach.cdn.ireadabc.com/65d8214c6b5c5d0496e17adb0408276a.atlas","name":"alien-pro.atlas"},"texPngData":{"url":"http://staging-teach.cdn.ireadabc.com/a319b372899239325b90bb4ec07b4970.png","name":"alien-pro.png"},"animType":"spine","rect":{"x":375.56,"y":543.5,"width":200,"height":200}}]}
    // return defaultData;
  },
  preloadItem: function preloadItem() {
    this.addPreloadImage();
    this.addPreloadAudio();
    this.addPreloadAnima();
    this.preload();
  },
  addPreloadImage: function addPreloadImage() {
    this._imageResList.push({
      url: this.data.bgItem.url
    });

    for (var _iterator = _createForOfIteratorHelperLoose(this.data.hotZoneItemArr), _step; !(_step = _iterator()).done;) {
      var q = _step.value;

      if (q.gIdx == '0') {
        this._imageResList.push({
          url: q.texPngData.url
        });
      }

      if (q.gIdx == '1') {
        this._imageResList.push({
          url: q.texPngData.url
        });
      }

      if (q.gIdx == '2') {
        this._imageResList.push({
          url: q.pic_url
        });
      }
    }
  },
  prepareAudioClip: function prepareAudioClip(url, key) {
    var _this3 = this;

    if (url) {
      cc.assetManager.loadRemote(url, function (err, audioClip) {
        if (audioClip) {
          _this3[key] = audioClip;
        }
      });
    }
  },
  addPreloadAudio: function addPreloadAudio() {
    this._audioResList.push({
      url: this.data.begin_audio
    }); // this.prepareAudioClip(this.data.begin_audio1, 'begin_audio1')
    // this._audioResList.push({ url: this.data.begin_audio2 });
    // this.prepareAudioClip(this.data.begin_audio2, 'begin_audio2')


    this._audioResList.push({
      url: this.data.guide_audio
    });

    this._audioResList.push({
      url: this.data.playing_audio
    });

    if (this.data.wrong_audio) {
      this._audioResList.push({
        url: this.data.wrong_audio
      });

      this.wrongAudio = this.data.wrong_audio;
    }

    if (this.data.right_audio) {
      this._audioResList.push({
        url: this.data.right_audio
      });

      this.rightAudio = this.data.right_audio;
    }

    this._audioResList.push({
      url: this.data.wrong_audio1
    });

    this._audioResList.push({
      url: this.data.wrong_audio2
    });

    this._audioResList.push({
      url: this.data.end_audio
    });

    for (var _iterator2 = _createForOfIteratorHelperLoose(this.data.hotZoneItemArr), _step2; !(_step2 = _iterator2()).done;) {
      var q = _step2.value;

      if (q.gIdx == '0') {
        this._audioResList.push({
          url: q.audio_url
        });
      }
    }
  },
  debugPointer: function debugPointer() {
    var boxDebugger = cc.find('Canvas/box-debugger');

    if (!this.isDebug) {
      boxDebugger.active = false;
      return;
    }

    if (!this.POINTER_NODE) {
      this.POINTER_NODE = new cc.Node();
      this.POINTER_NODE.parent = boxDebugger;
      this.POINTER_NODE.name = 'POINTER_NODE';
      this.POINTER_NODE.addComponent(cc.Graphics);
    }

    var grap = this.POINTER_NODE.getComponent(cc.Graphics);
    grap.clear();
    var ground = cc.find('Canvas/frame-border/ground');
    var baseW = ground.width,
        baseH = ground.height;
    var _this$_lastFingerPosi = this._lastFingerPosition.pos,
        px = _this$_lastFingerPosi.x,
        py = _this$_lastFingerPosi.y;
    var x = baseW * px - baseW / 2;
    var y = baseH - baseH * py - baseH / 2 - 16;
    var pn = new cc.Node();
    grap.fillColor = cc.color(255, 0, 0);
    grap.circle(x, y, 32);
    grap.fill();
    grap.stroke();
  },
  debugGraphics: function debugGraphics() {
    var boxDebugger = cc.find('Canvas/box-debugger');

    if (!this.isDebug) {
      boxDebugger.active = false;
      return;
    }

    boxDebugger.active = true;
    console.log('show debug graphics');
    var ground = cc.find('Canvas/frame-border/ground');
    var canvas = cc.find('Canvas');
    var baseW = ground.width,
        baseH = ground.height;
    var _this$data$bgItem$rec = this.data.bgItem.rect,
        bgW = _this$data$bgItem$rec.width,
        bgH = _this$data$bgItem$rec.height;
    var scaleX = bgW / baseW;
    var scaleY = bgH / baseH;
    var added = false;
    this.data.hotZoneItemArr.forEach(function (area) {
      if (added) {// return
      }

      if (area.gIdx != '0') {
        return;
      }

      added = true;
      var dn = new cc.Node();
      var lblNode = new cc.Node();
      lblNode.parent = dn;
      var lbl = lblNode.addComponent(cc.Label);
      lblNode.color = cc.color(0, 0, 0);
      lbl.string = area.skeJsonData.name.substring(0, area.skeJsonData.name.length - 9);
      dn.name = lbl.string;
      dn.parent = boxDebugger;
      dn.width = baseW;
      dn.height = baseH;
      var grap = dn.addComponent(cc.Graphics);
      var r = (0, _util.RandomInt)(1, 255);
      var g = (0, _util.RandomInt)(1, 255);
      var b = (0, _util.RandomInt)(1, 255);
      grap.fillColor = cc.color(r, g, b, 127);
      var _area$rect = area.rect,
          rx = _area$rect.x,
          ry = _area$rect.y,
          rw = _area$rect.width,
          rh = _area$rect.height;
      var w = rw / bgW * baseW;
      var h = rh / bgH * baseH;
      var x = rx / bgW * baseW - baseW / 2;
      var y = baseH - ry / bgH * baseH - h - baseH / 2; // w *= scaleX
      // h *= scaleY
      // x *= scaleX
      // y *= scaleY
      // const p = boxDebugger.convertToNodeSpaceAR(cc.v2(x,y));
      // x = p.x;
      // y = p.y;

      lblNode.x = x;
      lblNode.y = y + h; // dn.scaleX = scaleX;
      // dn.scaleY = scaleY;
      // dn.scale = area.mapScale; // minScale; // this._mapScaleMax * area.mapScale; // ;

      console.log('[debug]', area.skeJsonData.name, x, y, w, h);
      grap.fillRect(x, y, w, h);
      grap.stroke();
    });
  },
  addPreloadAnima: function addPreloadAnima() {},
  preload: function preload() {
    var _this4 = this;

    var preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList); // console.log(preloadArr);


    cc.assetManager.loadAny(preloadArr, null, function (f, t, item) {// console.log(f, t, item)
    }, function (err, data) {
      // console.log(err, data);
      var ground = cc.find("Canvas/frame-border/ground");
      var groundBg = cc.find("Canvas/frame-border/ground/bg");
      groundBg.active = false;
      var baseRect = _this4.data.bgItem.rect;
      (0, _util.getSpriteFrimeByUrl)(_this4.data.bgItem.url, function (sf) {
        var gs = groundBg.getComponent(cc.Sprite);
        gs.spriteFrame = sf;
        groundBg.active = true;
        var dbCount = 0;
        var finishDbCount = 0;

        for (var _iterator3 = _createForOfIteratorHelperLoose(_this4.data.hotZoneItemArr), _step3; !(_step3 = _iterator3()).done;) {
          var block = _step3.value;

          if (block.gIdx == '0' || block.gIdx == '1') {
            dbCount++;
          }
        }

        for (var _iterator4 = _createForOfIteratorHelperLoose(_this4.data.hotZoneItemArr), _step4; !(_step4 = _iterator4()).done;) {
          var _block = _step4.value;

          if (_block.gIdx == '2') {
            (function () {
              var s1 = (ground.width / _block.imgSizeW + ground.height / _block.imgSizeH) / 2;
              var node = new cc.Node();
              node.parent = ground;
              var spr = node.addComponent(cc.Sprite);
              (0, _util.getSpriteFrimeByUrl)(_block.pic_url, function (sf) {
                spr.spriteFrame = sf;
                node.scale = s1;
              });
            })();
          }

          if (_block.gIdx == '0' || _block.gIdx == '1') {
            (function () {
              var n = new cc.Node(); // n.scale = 0.25;

              n.scale = ground.width / groundBg.width;
              n.parent = ground;
              n.active = false;

              if (_block.animType == 'spine') {
                var skeleton = n.addComponent(sp.Skeleton);
                n.isSpine = true;
                (0, _util.loadSpine)(skeleton, _block.texPngData.name, {
                  tex: _block.texPngData.url,
                  atlas: _block.texJsonData.url,
                  ske: _block.skeJsonData.url
                }).then(function (_ref) {
                  var width = _ref.width,
                      height = _ref.height;
                  n.width = width;
                  n.height = height;
                  n.active = true; // db.playAnimation('null', 0);
                  // skeleton.setToSetupPose();
                  // skeleton.setAnimation(0, 'enlarge', true);				

                  _this4._allAnimationNodes.push(n);

                  finishDbCount++;
                  console.log(finishDbCount, dbCount);

                  if (finishDbCount == dbCount) {
                    _this4.loadEnd();
                  }
                })["catch"](function () {
                  finishDbCount++;
                  console.log(finishDbCount, dbCount);

                  if (finishDbCount == dbCount) {
                    _this4.loadEnd();
                  }
                });
              } else {
                var db = n.addComponent(dragonBones.ArmatureDisplay);
                (0, _util.loadDragonBones)(db, {
                  tex: _block.texPngData.url,
                  atlas: _block.texJsonData.url,
                  ske: _block.skeJsonData.url
                }).then(function (_ref2) {
                  var width = _ref2.width,
                      height = _ref2.height;
                  n.width = width;
                  n.height = height;
                  n.active = true;
                  db.playAnimation('null', 0);

                  _this4._allAnimationNodes.push(n);

                  finishDbCount++;
                  console.log(finishDbCount, dbCount);

                  if (finishDbCount == dbCount) {
                    _this4.loadEnd();
                  }
                })["catch"](function () {
                  finishDbCount++;
                  console.log(finishDbCount, dbCount);

                  if (finishDbCount == dbCount) {
                    _this4.loadEnd();
                  }
                });
              }

              if (_block.gIdx == '0') {
                var rectInfo = {
                  node: n,
                  audio_url: _block.audio_url,
                  rect: {
                    x: _block.rect.x / baseRect.width,
                    y: _block.rect.y / baseRect.height,
                    width: _block.rect.width / baseRect.width,
                    height: _block.rect.height / baseRect.height
                  }
                };

                _this4._figurePointRectArray.push(rectInfo); // this.addRectNodeListener(block);


                if (_block.labelText) {
                  var k = +_block.labelText * 1000;

                  if (!isNaN(k)) {
                    _this4._hintsNodeList.push({
                      node: n,
                      after: k
                    });
                  }
                }
              }
            })();
          }
        }
      }); // console.log(this.data);

      console.log('resource perload finish'); // <<<<<<< HEAD
      // =======
      // 			if (window && window["air"]) {
      // 				// cc.find('Canvas').opacity = 0;
      // 				window.air.onCourseInScreen = (next) => {
      // 					// cc.find('Canvas').opacity = 255;
      // 					this.loadEnd();
      // 					next();
      // 				}
      // 				window.air.hideAirClassLoading();
      // 			} else {
      // 				this.loadEnd();
      // 			}
      // >>>>>>> 2d461e1910571bcfc6ad4dc93c2cedafc20923ea

      cc.debug.setDisplayStats(false);
    });
  },
  loadEnd: function loadEnd() {
    if (window && window["air"] && window["air"].hideAirClassLoading) {
      window["air"].hideAirClassLoading();
    }

    this.initData(); // this.initAudio();
    // this.initView();

    this.initBg(); // this.initListener();

    this.debugGraphics();
    this.createStateMachine();
  },
  _cantouch: null,
  initData: function initData() {
    // 所有全局变量 默认都是null 
    this._cantouch = true;
  },
  // audioBtn: null,
  // initAudio() {
  // 	const audioNode = cc.find('Canvas/res/audio');
  // 	const getAudioByResName = (resName) => {
  // 		return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
  // 	}
  // 	this.audioBtn = getAudioByResName('btn');
  // },
  // initView() {
  // 	// this.initBg();
  // 	// this.initPic();
  // 	// this.initBtn();
  // 	this.initIcon();
  // },
  addRectNodeListener: function addRectNodeListener(data) {
    var _this5 = this;

    var bg = cc.find("Canvas/frame-border/ground/bg").parent;
    var rate = bg.scale * bg.width / this.data.bgItem.rect.width;
    var rectNode = new cc.Node();
    rectNode.name = 'rect' + data.index;
    bg.addChild(rectNode, 20);
    var ctx = rectNode.addComponent(cc.Graphics); // 红色矩形

    ctx.lineWidth = 4;
    ctx.strokeColor = cc.Color.BLACK;
    ctx.fillColor = cc.Color.WHITE.setA(100);
    var scale = rate / bg.scaleY;
    console.log('scale~ : ', scale);
    rectNode.width = data.rect.width * scale;
    rectNode.height = data.rect.height * scale;
    rectNode.x = -bg.width / 2 + data.rect.x * scale + bg.x;
    rectNode.y = bg.height / 2 - data.rect.height * scale - data.rect.y * scale + bg.y;
    rectNode.anchorX = rectNode.anchorY = 0;
    console.log('data: ', data);
    console.log('rectNode: ', rectNode); // if (pageData.bgItem.isShowDebugLine) {

    ctx.rect(0, 0, rectNode.width, rectNode.height); // ctx.fillRect(0, 0, 200, 200);
    // }

    ctx.stroke();
    ctx.fill();
    rectNode.addComponent(cc.Button);
    rectNode.on("click", function () {
      console.log(" in rectNode click");

      var _x = rectNode.x / bg.width;

      var _y = rectNode.y / bg.height;

      var _w = rectNode.width / bg.width;

      var _h = rectNode.height / bg.height;

      var pos = {
        x: _x + _w / 2 + 0.5,
        y: -(_y + _h / 2 - 0.5)
      };
      _this5._lastFingerPosition = {
        pos: pos,
        dirty: true
      };
    });
  },
  initBg: function initBg() {
    var bgNode = cc.find('Canvas/bg');
    bgNode.scale = this._mapScaleMax;
    console.log('this._mapScaleMax', this._mapScaleMax);
  },

  /*initBtn() {
  		this.curPage = 0;
  	const bottomPart = cc.find('Canvas/bottomPart');
  	bottomPart.zIndex = 5; // 提高层级
  		bottomPart.x = bottomPart.parent.width / 2;
  	bottomPart.y = -bottomPart.parent.height / 2;
  		const leftBtnNode = bottomPart.getChildByName('btn_left');
  	//节点中添加了button组件 则可以添加click事件监听
  	leftBtnNode.on('click', () => {
  		if (!this._cantouch) {
  			return;
  		}
  		if (this.curPage == 0) {
  			return;
  		}
  		this.curPage = 0
  		this.leftMove();
  			// 游戏结束时需要调用这个方法通知系统作业完成
  		onHomeworkFinish();
  			cc.audioEngine.play(this.audioBtn.clip, false, 0.8)
  	})
  		const rightBtnNode = bottomPart.getChildByName('btn_right');
  	//节点中添加了button组件 则可以添加click事件监听
  	rightBtnNode.on('click', () => {
  		if (!this._cantouch) {
  			return;
  		}
  		if (this.curPage == 1) {
  			return;
  		}
  			this.curPage = 1
  		this.rightMove();
  			cc.audioEngine.play(this.audioBtn.clip, false, 0.5)
  	})
  },*/
  // update (dt) {},
  _timeoutIds: null,
  _intervalIds: null,
  // 生命周期
  onDestroy: function onDestroy() {
    console.log('op15 onDestroy');

    this._timeoutIds.forEach(function (id) {
      clearTimeout(id);
    });

    this._intervalIds.forEach(function (id) {
      clearInterval(id);
    });

    this.gameMachineService.stopChild();
    this.gameMachineService.stop();

    if (window.courseware && window.courseware.closeOsmoFingerRead) {
      if (this.isOpenedOsmoFingerRead) {
        window.courseware.closeOsmoFingerRead();
      }
    }
  }
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 126516 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/OP15/script/util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ade7a9A1W1Ah7vGKIj+9VNT', 'util');
// OP15/script/util.js

"use strict";

exports.__esModule = true;
exports.getPosByAngle = getPosByAngle;
exports.getAngleByPos = getAngleByPos;
exports.exchangeNodePos = exchangeNodePos;
exports.RandomInt = RandomInt;
exports.randomSortByArr = randomSortByArr;
exports.setSprNodeMaxLen = setSprNodeMaxLen;
exports.localPosTolocalPos = localPosTolocalPos;
exports.worldPosToLocalPos = worldPosToLocalPos;
exports.getScaleRateBy2Node = getScaleRateBy2Node;
exports.getDistance = getDistance;
exports.playAudioByUrl = playAudioByUrl;
exports.btnClickAnima = btnClickAnima;
exports.getSpriteFrimeByUrl = getSpriteFrimeByUrl;
exports.getSprNode = getSprNode;
exports.getSprNodeByUrl = getSprNodeByUrl;
exports.playAudio = playAudio;
exports.asyncDelay = asyncDelay;
exports.showFireworks = showFireworks;
exports.asyncTweenTo = asyncTweenTo;
exports.asyncTweenBy = asyncTweenBy;
exports.showTrebleFirework = showTrebleFirework;
exports.onHomeworkFinish = onHomeworkFinish;
exports.loadDragonBones = loadDragonBones;
exports.loadSpine = loadSpine;
exports.FireworkSettings = void 0;

function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

function getPosByAngle(angle, len) {
  var radian = angle * Math.PI / 180;
  var x = Math.sin(radian) * len;
  var y = Math.cos(radian) * len;
  return {
    x: x,
    y: y
  };
}

function getAngleByPos(px, py, mx, my) {
  var x = Math.abs(px - mx);
  var y = Math.abs(py - my);
  var z = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
  var cos = y / z;
  var radina = Math.acos(cos); // 用反三角函数求弧度

  var angle = Math.floor(180 / (Math.PI / radina) * 100) / 100; // 将弧度转换成角度

  if (mx > px && my > py) {
    // 鼠标在第四象限
    angle = 180 - angle;
  }

  if (mx === px && my > py) {
    // 鼠标在y轴负方向上
    angle = 180;
  }

  if (mx > px && my === py) {
    // 鼠标在x轴正方向上
    angle = 90;
  }

  if (mx < px && my > py) {
    // 鼠标在第三象限
    angle = 180 + angle;
  }

  if (mx < px && my === py) {
    // 鼠标在x轴负方向
    angle = 270;
  }

  if (mx < px && my < py) {
    // 鼠标在第二象限
    angle = 360 - angle;
  } // console.log('angle: ', angle);


  return angle;
}

function exchangeNodePos(baseNode, targetNode) {
  return baseNode.convertToNodeSpaceAR(targetNode._parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y)));
}

function RandomInt(a, b) {
  if (b === void 0) {
    b = 0;
  }

  var max = Math.max(a, b);
  var min = Math.min(a, b);
  return Math.floor(Math.random() * (max - min) + min);
}

function randomSortByArr(arr) {
  var newArr = [];
  var tmpArr = arr.concat();

  while (tmpArr.length > 0) {
    var randomIndex = Math.floor(tmpArr.length * Math.random());
    newArr.push(tmpArr[randomIndex]);
    tmpArr.splice(randomIndex, 1);
  }

  return newArr;
}

function setSprNodeMaxLen(sprNode, maxW, maxH) {
  var sx = maxW / sprNode.width;
  var sy = maxH / sprNode.height;
  var s = Math.min(sx, sy);
  sprNode.scale = Math.round(s * 1000) / 1000;
}

function localPosTolocalPos(baseNode, targetNode) {
  var worldPos = targetNode.parent.convertToWorldSpaceAR(cc.v2(targetNode.x, targetNode.y));
  var localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
  return localPos;
}

function worldPosToLocalPos(worldPos, baseNode) {
  var localPos = baseNode.parent.convertToNodeSpaceAR(cc.v2(worldPos.x, worldPos.y));
  return localPos;
}

function getScaleRateBy2Node(baseNode, targetNode, maxFlag) {
  if (maxFlag === void 0) {
    maxFlag = true;
  }

  var worldRect1 = targetNode.getBoundingBoxToWorld();
  var worldRect2 = baseNode.getBoundingBoxToWorld();
  var sx = worldRect1.width / worldRect2.width;
  var sy = worldRect1.height / worldRect2.height;

  if (maxFlag) {
    return Math.max(sx, sy);
  } else {
    return Math.min(sx, sy);
  }
}

function getDistance(start, end) {
  var pos = cc.v2(start.x - end.x, start.y - end.y);
  var dis = Math.sqrt(pos.x * pos.x + pos.y * pos.y);
  return dis;
}

function playAudioByUrl(audio_url, cb) {
  if (cb === void 0) {
    cb = null;
  }

  if (audio_url) {
    if (audio_url instanceof cc.AudioClip && audio_url.constructor.name == 'cc_AudioClip') {
      var audioId = cc.audioEngine.play(audio_url, false, 0.8);

      if (cb) {
        cc.audioEngine.setFinishCallback(audioId, function () {
          cb();
        });
      }
    } else {
      cc.assetManager.loadRemote(audio_url, function (err, audioClip) {
        var audioId = cc.audioEngine.play(audioClip, false, 0.8);

        if (cb) {
          cc.audioEngine.setFinishCallback(audioId, function () {
            cb();
          });
        }
      });
    }
  }
}

function btnClickAnima(btn, time, rate) {
  if (time === void 0) {
    time = 0.15;
  }

  if (rate === void 0) {
    rate = 1.05;
  }

  btn.tmpScale = btn.scale;
  btn.on(cc.Node.EventType.TOUCH_START, function () {
    cc.tween(btn).to(time / 2, {
      scale: btn.scale * rate
    }).start();
  });
  btn.on(cc.Node.EventType.TOUCH_CANCEL, function () {
    cc.tween(btn).to(time / 2, {
      scale: btn.tmpScale
    }).start();
  });
  btn.on(cc.Node.EventType.TOUCH_END, function () {
    cc.tween(btn).to(time / 2, {
      scale: btn.tmpScale
    }).start();
  });
}

function getSpriteFrimeByUrl(url, cb) {
  cc.loader.load({
    url: url
  }, function (err, img) {
    var spriteFrame = new cc.SpriteFrame(img);

    if (cb) {
      cb(spriteFrame);
    }
  });
}

function getSprNode(resName) {
  var sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
  var node = new cc.Node();
  node.addComponent(cc.Sprite).spriteFrame = sf;
  return node;
}

function getSprNodeByUrl(url, cb) {
  var node = new cc.Node();
  var spr = node.addComponent(cc.Sprite);
  getSpriteFrimeByUrl(url, function (sf) {
    spr.spriteFrame = sf;

    if (cb) {
      cb(spr);
    }
  });
}

function playAudio(audioClip, cb) {
  if (cb === void 0) {
    cb = null;
  }

  if (audioClip) {
    var audioId = cc.audioEngine.playEffect(audioClip, false, 0.8);

    if (cb) {
      cc.audioEngine.setFinishCallback(audioId, function () {
        cb();
      });
    }
  }
}

function asyncDelay(_x) {
  return _asyncDelay.apply(this, arguments);
}

function _asyncDelay() {
  _asyncDelay = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(time) {
    return regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            return _context.abrupt("return", new Promise(function (resolve, reject) {
              try {
                setTimeout(function () {
                  resolve();
                }, time * 1000);
              } catch (e) {
                reject(e);
              }
            }));

          case 1:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _asyncDelay.apply(this, arguments);
}

var FireworkSettings = /*#__PURE__*/function () {
  // 父节点
  // 火花节点的array
  // 发射点
  // 发射方向
  // 扩散范围
  // 发射数量
  // 缩放范围
  function FireworkSettings(baseNode, nodeList, pos, side, range, number, scalseRange) {
    if (pos === void 0) {
      pos = cc.v2(0, 0);
    }

    if (side === void 0) {
      side = cc.v2(0, 100);
    }

    if (range === void 0) {
      range = 50;
    }

    if (number === void 0) {
      number = 100;
    }

    if (scalseRange === void 0) {
      scalseRange = 0;
    }

    this.baseNode = void 0;
    this.nodeList = void 0;
    this.pos = void 0;
    this.side = void 0;
    this.range = void 0;
    this.number = void 0;
    this.scalseRange = void 0;
    this.baseNode = baseNode;
    this.nodeList = nodeList;
    this.pos = pos;
    this.side = side;
    this.range = range;
    this.number = number;
    this.scalseRange = scalseRange;
  }

  FireworkSettings.copy = function copy(firework) {
    return new FireworkSettings(firework.baseNode, firework.nodeList, firework.pos, firework.side, firework.range, firework.number);
  };

  return FireworkSettings;
}();

exports.FireworkSettings = FireworkSettings;

function showFireworks(_x2) {
  return _showFireworks.apply(this, arguments);
}

function _showFireworks() {
  _showFireworks = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(fireworkSettings) {
    var baseNode, nodeList, pos, side, range, number, scalseRange;
    return regeneratorRuntime.wrap(function _callee3$(_context3) {
      while (1) {
        switch (_context3.prev = _context3.next) {
          case 0:
            baseNode = fireworkSettings.baseNode, nodeList = fireworkSettings.nodeList, pos = fireworkSettings.pos, side = fireworkSettings.side, range = fireworkSettings.range, number = fireworkSettings.number, scalseRange = fireworkSettings.scalseRange;
            new Array(number).fill(' ').forEach( /*#__PURE__*/function () {
              var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_, i) {
                var rabbonNode, node, rate, angle;
                return regeneratorRuntime.wrap(function _callee2$(_context2) {
                  while (1) {
                    switch (_context2.prev = _context2.next) {
                      case 0:
                        rabbonNode = new cc.Node();
                        rabbonNode.parent = baseNode;
                        rabbonNode.x = pos.x;
                        rabbonNode.y = pos.y;
                        rabbonNode.angle = 60 * Math.random() - 30;
                        node = cc.instantiate(nodeList[RandomInt(nodeList.length)]);
                        node.parent = rabbonNode;
                        node.active = true;
                        node.x = 0;
                        node.y = 0;
                        node.angle = 0;
                        node.scale = (Math.random() - 0.5) * scalseRange + 1;
                        rate = Math.random();
                        angle = Math.PI * (Math.random() * 2 - 1);
                        _context2.next = 16;
                        return asyncTweenBy(rabbonNode, 0.3, {
                          x: side.x * rate + Math.cos(angle) * range * rate,
                          y: side.y * rate + Math.sin(angle) * range * rate
                        }, {
                          easing: 'quadIn'
                        });

                      case 16:
                        cc.tween(rabbonNode).by(8, {
                          y: -2000
                        }).start();
                        cc.tween(rabbonNode).to(5, {
                          scale: (Math.random() - 0.5) * scalseRange + 1
                        }).start();
                        rabbonFall(rabbonNode);
                        _context2.next = 21;
                        return asyncDelay(Math.random());

                      case 21:
                        cc.tween(node).by(0.15, {
                          x: -10,
                          angle: -10
                        }).by(0.3, {
                          x: 20,
                          angle: 20
                        }).by(0.15, {
                          x: -10,
                          angle: -10
                        }).union().repeatForever().start();
                        cc.tween(rabbonNode).delay(5).to(0.3, {
                          opacity: 0
                        }).call(function () {
                          node.stopAllActions();
                          node.active = false;
                          node.parent = null;
                          node = null;
                        }).start();

                      case 23:
                      case "end":
                        return _context2.stop();
                    }
                  }
                }, _callee2);
              }));

              return function (_x12, _x13) {
                return _ref3.apply(this, arguments);
              };
            }());

          case 2:
          case "end":
            return _context3.stop();
        }
      }
    }, _callee3);
  }));
  return _showFireworks.apply(this, arguments);
}

function rabbonFall(_x3) {
  return _rabbonFall.apply(this, arguments);
}

function _rabbonFall() {
  _rabbonFall = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(node) {
    var time, offsetX;
    return regeneratorRuntime.wrap(function _callee4$(_context4) {
      while (1) {
        switch (_context4.prev = _context4.next) {
          case 0:
            time = 1 + Math.random();
            offsetX = RandomInt(-200, 200) * time;
            _context4.next = 4;
            return asyncTweenBy(node, time, {
              x: offsetX,
              angle: offsetX * 60 / 200
            });

          case 4:
            rabbonFall(node);

          case 5:
          case "end":
            return _context4.stop();
        }
      }
    }, _callee4);
  }));
  return _rabbonFall.apply(this, arguments);
}

function asyncTweenTo(_x4, _x5, _x6, _x7) {
  return _asyncTweenTo.apply(this, arguments);
}

function _asyncTweenTo() {
  _asyncTweenTo = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(node, duration, obj, ease) {
    return regeneratorRuntime.wrap(function _callee5$(_context5) {
      while (1) {
        switch (_context5.prev = _context5.next) {
          case 0:
            if (ease === void 0) {
              ease = undefined;
            }

            return _context5.abrupt("return", new Promise(function (resolve, reject) {
              try {
                cc.tween(node).to(duration, obj, ease).call(function () {
                  resolve();
                }).start();
              } catch (e) {
                reject(e);
              }
            }));

          case 2:
          case "end":
            return _context5.stop();
        }
      }
    }, _callee5);
  }));
  return _asyncTweenTo.apply(this, arguments);
}

function asyncTweenBy(_x8, _x9, _x10, _x11) {
  return _asyncTweenBy.apply(this, arguments);
}

function _asyncTweenBy() {
  _asyncTweenBy = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(node, duration, obj, ease) {
    return regeneratorRuntime.wrap(function _callee6$(_context6) {
      while (1) {
        switch (_context6.prev = _context6.next) {
          case 0:
            if (ease === void 0) {
              ease = undefined;
            }

            return _context6.abrupt("return", new Promise(function (resolve, reject) {
              try {
                cc.tween(node).by(duration, obj, ease).call(function () {
                  resolve();
                }).start();
              } catch (e) {
                reject(e);
              }
            }));

          case 2:
          case "end":
            return _context6.stop();
        }
      }
    }, _callee6);
  }));
  return _asyncTweenBy.apply(this, arguments);
}

function showTrebleFirework(baseNode, rabbonList) {
  var middle = new FireworkSettings(baseNode, rabbonList);
  middle.pos = cc.v2(0, -400);
  middle.side = cc.v2(0, 1000);
  middle.range = 200;
  middle.number = 100;
  middle.scalseRange = 0.4;
  var left = FireworkSettings.copy(middle);
  left.pos = cc.v2(-600, -400);
  left.side = cc.v2(200, 1000);
  var right = FireworkSettings.copy(middle);
  right.pos = cc.v2(600, -400);
  right.side = cc.v2(-200, 1000);
  showFireworks(middle);
  showFireworks(left);
  showFireworks(right);
}

function onHomeworkFinish() {
  var middleLayer = cc.find('middleLayer');

  if (middleLayer) {
    var middleLayerComponent = middleLayer.getComponent('middleLayer');

    if (middleLayerComponent.role == 'student') {
      middleLayerComponent.onHomeworkFinish(function () {});
    }
  } else {
    console.log('onHomeworkFinish');
  }
}

function loadDragonBones(dragonDisplay, _ref) {
  var tex = _ref.tex,
      atlas = _ref.atlas,
      ske = _ref.ske;
  return new Promise(function (resolve, reject) {
    cc.loader.load({
      url: tex,
      type: 'png'
    }, function (error, texture) {
      if (error) {
        reject();
        return;
      }

      cc.loader.load({
        url: atlas,
        type: 'txt'
      }, function (error, atlasJson) {
        if (error) {
          reject();
          return;
        }

        cc.loader.load({
          url: ske,
          type: 'txt'
        }, function (error, dragonBonesJson) {
          if (error) {
            reject();
            return;
          }

          var atlasObj = new dragonBones.DragonBonesAtlasAsset();
          atlasObj.uuid = atlas;
          atlasObj.atlasJson = atlasJson;
          atlasObj.texture = texture;
          var asset = new dragonBones.DragonBonesAsset();
          asset.uuid = ske;
          asset.dragonBonesJson = dragonBonesJson;
          var armatureName = asset._dragonBonesJsonData.armature[0].name || 'default';
          dragonDisplay.armatureName = armatureName;
          dragonDisplay.dragonAtlasAsset = atlasObj;
          dragonDisplay.dragonAsset = asset;
          resolve(asset._dragonBonesJsonData.armature[0].aabb);
        });
      });
    });
  });
}

function loadSpine(skeleton, picName, _ref2) {
  var tex = _ref2.tex,
      atlas = _ref2.atlas,
      ske = _ref2.ske;
  return new Promise(function (resolve, reject) {
    // cc.loader.load({ url: tex, type: 'png' }, (error, texture) => {
    cc.assetManager.loadRemote(tex, function (error, texture) {
      if (error) {
        reject();
        return;
      } // cc.loader.load({ url: atlas, type: 'txt' }, (error, atlasJson) => {


      cc.assetManager.loadAny({
        url: atlas
      }, function (error, atlasJson) {
        if (error) {
          reject();
          return;
        } // cc.loader.load({ url: ske, type: 'txt' }, (error, dragonBonesJson) => {


        cc.assetManager.loadAny({
          url: ske
        }, function (error, dragonBonesJson) {
          if (error) {
            reject();
            return;
          }

          var asset = new sp.SkeletonData();
          asset._uuid = ske;
          asset.skeletonJson = JSON.stringify(dragonBonesJson);
          asset.atlasText = atlasJson;
          asset.textures = [texture];
          asset.textureNames = [picName];
          console.log('picName: ', picName);
          skeleton.skeletonData = asset;
          var jsonObj = dragonBonesJson; //JSON.parse( assets[1]);

          var animationNameObj = jsonObj.animations;
          var animationNames = [];

          for (var name in animationNameObj) {
            console.log('name~~:  ', name);
            animationNames.push(name);
          }

          console.log("skeleton.animation: ", skeleton.animation);
          skeleton.animationNames = animationNames;
          skeleton.loop = false;
          console.log("jsonObj['skeleton'] : ", jsonObj['skeleton']);
          resolve(jsonObj['skeleton']); // const atlasObj = new dragonBones.DragonBonesAtlasAsset()
          // atlasObj.uuid = atlas
          // atlasObj.atlasJson = atlasJson
          // atlasObj.texture = texture
          // const asset = new dragonBones.DragonBonesAsset()
          // asset.uuid = ske
          // asset.dragonBonesJson = dragonBonesJson;
          // const armatureName = asset._dragonBonesJsonData.armature[0].name || 'default';
          // dragonDisplay.armatureName = armatureName;
          // dragonDisplay.dragonAtlasAsset = atlasObj
          // dragonDisplay.dragonAsset = asset;
          // resolve(asset._dragonBonesJsonData.armature[0].aabb);
        });
      });
    });
  });
}

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 44012 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/OP15/script/defaultData.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c41b05RVddEPK86siw92bnl', 'defaultData');
// OP15/script/defaultData.js

"use strict";

exports.__esModule = true;
exports.defaultData = void 0;
var defaultData = {
  // "begin_audio": "http://staging-teach.cdn.ireadabc.com/b1e5378083adac9950839772c7b67f34.mp3",
  "begin_audio": "http://staging-teach.cdn.ireadabc.com/81e7a94e1420a4cbcaa583d4188ab145.mp3",
  "playing_audio": "http://teach.cdn.ireadabc.com/549347d1be620d9d91b7420d45b3cb7a.mp3",
  "end_audio": "http://staging-teach.cdn.ireadabc.com/81e7a94e1420a4cbcaa583d4188ab145.mp3",
  "bgItem": {
    "url": "http://teach.cdn.ireadabc.com/adcccbd26e2cfa259920e24df01d4b92.png",
    "rect": {
      "x": 374.6,
      "y": 0,
      "width": 293.8,
      "height": 390
    }
  },
  "hotZoneItemArr": [{
    "id": "1638090450402",
    "index": 0,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/c5c6cd890660a3c22fde393a3770458f.json",
      "name": "小汽车_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/cea107517406463474d907e306163226.json",
      "name": "小汽车_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/84bce64cd4259e604a458d08ddd75bec.png",
      "name": "小汽车_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 195
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090465133",
    "index": 1,
    "pic_url": "http://teach.cdn.ireadabc.com/70d02ee3788e373f707a45530cd2f9c0.png",
    "itemType": "pic",
    "fontScale": 0.81484375,
    "imgScale": 0.23579201934703747,
    "imgSizeW": 1246,
    "imgSizeH": 1654,
    "mapScale": 0.81484375,
    "dragDot": {
      "x": 521.5,
      "y": 195
    },
    "gIdx": "2",
    "rect": {
      "x": 0,
      "y": 1,
      "width": 293.8,
      "height": 390
    }
  }, {
    "id": "1638090485031",
    "index": 2,
    "audio_url": "http://teach.cdn.ireadabc.com/e31c3b1914837a611d4d3bb1ceb00773.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/d2d7de9f8079f36e8354d16e4ca26476.json",
      "name": "房子_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/204ea18018a352a30fd233a46f9a0a1a.json",
      "name": "房子_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/cf8da0ab00a7d9f34bdf8f490c29dcbf.png",
      "name": "房子_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 195
    },
    "gIdx": "0",
    "labelText": "14",
    "posX": 578,
    "posY": 160.99791334496155,
    "rect": {
      "x": 124.9,
      "y": 108,
      "width": 170,
      "height": 106
    }
  }, {
    "id": "1638090539787",
    "index": 3,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/ed2ac4931a9c00ff6c4298381722676e.json",
      "name": "牛_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/0e153093ee7265b6a843847543d6110b.json",
      "name": "牛_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/631661e13616eea6cde9f9e6610f5008.png",
      "name": "牛_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090562867",
    "index": 4,
    "audio_url": "http://teach.cdn.ireadabc.com/bf1924c502ca1a4ac928a31e7c8aa70e.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/bd3c2cc93b1593433a58d8482972ff66.json",
      "name": "苹果_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/1f54df317a8c86271e29d6db3ffb55ce.json",
      "name": "苹果_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/734ac06a7ef018b457e7ac7692789ffa.png",
      "name": "苹果_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "0",
    "labelText": "6",
    "posX": 429,
    "posY": 146,
    "rect": {
      "x": -0.1,
      "y": 70,
      "width": 122,
      "height": 152
    }
  }, {
    "id": "1638090594247",
    "index": 5,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/1d4b251caf0c0b8245fb17cd8445672c.json",
      "name": "农夫_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/1fdd04cacb6d543cf05ce64e8124a6ff.json",
      "name": "农夫_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/8f582cb39eb349da08e06289b0ce6c16.png",
      "name": "农夫_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090663056",
    "index": 6,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/4503721901880d0b6c3ad6d4261e958b.json",
      "name": "小女孩_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/fc4fd0b2f672dff7c7b2148830164090.json",
      "name": "小女孩_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/4be41c15972caf99eef956ba48759c91.png",
      "name": "小女孩_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090685571",
    "index": 7,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/55951c794b414ab58cca023642819e37.json",
      "name": "母鸡_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/47b93323b1d1e1e6020704c537f46820.json",
      "name": "母鸡_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/dd66021ff860b02a559d59817c71e27f.png",
      "name": "母鸡_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090695652",
    "index": 8,
    "audio_url": "http://teach.cdn.ireadabc.com/323feb19d153069702ffd21097f18f79.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/cd7c7a756c0f79d28f419576e3b85b0c.json",
      "name": "鸭子_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/7613f30893a5f64773a77723c1d67f0d.json",
      "name": "鸭子_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/59b2293ef4eea9d64ff9821bc5d69a6d.png",
      "name": "鸭子_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "0",
    "labelText": "11",
    "posX": 564.4993151491155,
    "posY": 247.99735690361797,
    "rect": {
      "x": 127.9,
      "y": 216,
      "width": 124,
      "height": 64
    }
  }, {
    "id": "1638090758159",
    "index": 9,
    "audio_url": "http://teach.cdn.ireadabc.com/b903b174f09107517b5d6f8934b73447.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/b9fa85c227daa6539f12cab5a5058052.json",
      "name": "鸡蛋_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/99aa8de7b69000ac6c5e0fb6a508b692.json",
      "name": "鸡蛋_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/09bd0a34a4508613fd7c167724e4a969.png",
      "name": "鸡蛋_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "0",
    "labelText": "7",
    "posX": 471.50036382703234,
    "posY": 291.99683256465954,
    "rect": {
      "x": 67.4,
      "y": 223,
      "width": 59,
      "height": 138
    }
  }, {
    "id": "1638090812155",
    "index": 10,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/357fef8204228afb43d0ce73746228e5.json",
      "name": "鱼_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/f694e5442095a317fc7d8b1390e630c7.json",
      "name": "鱼_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/f566cca10fd83f62a465b144ac73d483.png",
      "name": "鱼_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }, {
    "id": "1638090824244",
    "index": 11,
    "audio_url": "http://teach.cdn.ireadabc.com/2656b72aec7f6def07713fbc99309168.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/20cbf3d186a197baaed38204dd017f51.json",
      "name": "猫_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/d7de5a32de3ee1ad660dc509ba8adf1d.json",
      "name": "猫_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/af86e967aab8632cd0b26d60a62f0675.png",
      "name": "猫_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "0",
    "labelText": "10",
    "posX": 408.50114498507236,
    "posY": 288.99689676943,
    "rect": {
      "x": 1.4,
      "y": 222,
      "width": 65,
      "height": 134
    }
  }, {
    "id": "1638090897644",
    "index": 12,
    "audio_url": "http://teach.cdn.ireadabc.com/9bbf8ba2fa7f96ea5a95c27a384414a2.mp3",
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/d8506ebddb29c8d08b4b93376b45f5c9.json",
      "name": "鸟_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/9fad47c99025b7b229df52afb797ec5c.json",
      "name": "鸟_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/e86b136b9706768c5ca0dba3dc0aab21.png",
      "name": "鸟_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "0",
    "labelText": "9",
    "posX": 573,
    "posY": 74,
    "rect": {
      "x": 127.9,
      "y": 41,
      "width": 154,
      "height": 66
    }
  }, {
    "id": "1638090948950",
    "index": 13,
    "itemType": "rect",
    "fontScale": 0.81484375,
    "imgScale": 1,
    "imgSizeW": 0,
    "imgSizeH": 0,
    "mapScale": 0.81484375,
    "skeJsonData": {
      "url": "http://teach.cdn.ireadabc.com/3d1d49e583d97cd5097d08102265b1c6.json",
      "name": "蚂蚁_ske.json"
    },
    "texJsonData": {
      "url": "http://teach.cdn.ireadabc.com/9a3a5c871b288aebb1e6920f1e9709f8.json",
      "name": "蚂蚁_tex.json"
    },
    "texPngData": {
      "url": "http://teach.cdn.ireadabc.com/1fad62f313b6ff72a642cb4b15aeaf04.png",
      "name": "蚂蚁_tex.png"
    },
    "dragDot": {
      "x": 521.5,
      "y": 197.46116504854368
    },
    "gIdx": "1",
    "rect": {
      "x": 46.9,
      "y": 95,
      "width": 200,
      "height": 200
    }
  }],
  "guide_audio": "http://staging-teach.cdn.ireadabc.com/d6c1d3b84a4774a0fc183a14abbb6c09.mp3",
  "wrong_audio1": "http://staging-teach.cdn.ireadabc.com/b77ef2a6cdcb6504520484a9b197b2fd.mp3",
  "wrong_audio2": "http://staging-teach.cdn.ireadabc.com/8dacb2445816e1f068ea116752c21173.mp3",
  "begin_audio1": "http://staging-teach.cdn.ireadabc.com/e45ad0823ae2c8e04246d76c7f57030d.mp3",
  "begin_audio2": "http://staging-teach.cdn.ireadabc.com/05232ad51f8d9e1af6dd1273147bc58f.mp3",
  "right_audio": "http://staging-teach.cdn.ireadabc.com/330eff8d5e8cc429965da82652207ff2.mp3",
  "wrong_audio": "http://staging-teach.cdn.ireadabc.com/1664170e569d974279bcec626be176d9.mp3",
  "begin_sep_time": 15
};
exports.defaultData = defaultData;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 31488 characters]
//------QC-SOURCE-SPLIT------
