@alisaitteke/seatmap-canvas 2.0.3 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/.opencommitignore +2 -1
  3. package/CHANGELOG.md +2 -0
  4. package/README.md +3 -5
  5. package/dist/cjs/index.js +16 -0
  6. package/examples/index.html +171 -0
  7. package/package.json +19 -12
  8. package/rollup.config.js +56 -0
  9. package/src/lib/canvas.index.ts +2 -3
  10. package/src/lib/config.ts +1 -1
  11. package/src/lib/decorators/dom.ts +1 -1
  12. package/src/lib/decorators/index.ts +1 -1
  13. package/src/lib/dev.tools.ts +1 -1
  14. package/src/lib/enums/global.ts +3 -3
  15. package/src/lib/models/block.model.ts +23 -128
  16. package/src/lib/models/coordinate.model.ts +3 -20
  17. package/src/lib/models/data.model.ts +29 -9
  18. package/src/lib/models/defaults.model.ts +10 -4
  19. package/src/lib/models/global.model.ts +1 -1
  20. package/src/lib/models/label.model.ts +5 -38
  21. package/src/lib/models/legend.model.ts +6 -38
  22. package/src/lib/models/model.base.ts +5 -22
  23. package/src/lib/models/seat.model.ts +18 -126
  24. package/src/lib/svg/event.manager.ts +6 -14
  25. package/src/lib/svg/legend/legend.circle.ts +1 -1
  26. package/src/lib/svg/legend/legend.item.ts +7 -4
  27. package/src/lib/svg/legend/legend.title.ts +2 -2
  28. package/src/lib/svg/legend.ts +1 -1
  29. package/src/lib/svg/stage/blocks/block-item/block-item.bounds.ts +1 -1
  30. package/src/lib/svg/stage/blocks/block-item/block-item.index.ts +17 -5
  31. package/src/lib/svg/stage/blocks/block-item/block-item.info.index.ts +2 -1
  32. package/src/lib/svg/stage/blocks/block-item/block-item.labels.index.ts +1 -1
  33. package/src/lib/svg/stage/blocks/block-item/block-item.mask.ts +1 -1
  34. package/src/lib/svg/stage/blocks/block-item/block-item.seats.index.ts +1 -1
  35. package/src/lib/svg/stage/blocks/block-item/bound/bound-item.index.ts +1 -1
  36. package/src/lib/svg/stage/blocks/block-item/info/title.ts +1 -1
  37. package/src/lib/svg/stage/blocks/block-item/label/label-item.circle.ts +1 -1
  38. package/src/lib/svg/stage/blocks/block-item/label/label-item.index.ts +1 -1
  39. package/src/lib/svg/stage/blocks/block-item/label/label-item.title.ts +1 -1
  40. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.check.ts +12 -5
  41. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.circle.ts +1 -1
  42. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.index.ts +4 -4
  43. package/src/lib/svg/stage/blocks/block-item/seat/seat-item.title.ts +1 -1
  44. package/src/lib/svg/stage/blocks/blocks.index.ts +8 -5
  45. package/src/lib/svg/stage/blocks.search-circle.ts +1 -1
  46. package/src/lib/svg/stage/multi-select/rect.ts +1 -1
  47. package/src/lib/svg/stage/multi-select.ts +1 -1
  48. package/src/lib/svg/stage/search-circle/circle.ts +1 -1
  49. package/src/lib/svg/stage/stage.index.ts +1 -1
  50. package/src/lib/svg/svg.base.ts +40 -28
  51. package/src/lib/svg/svg.index.ts +1 -1
  52. package/src/lib/svg/tooltip/rect.ts +1 -1
  53. package/src/lib/svg/tooltip/title.ts +2 -11
  54. package/src/lib/svg/tooltip.ts +4 -3
  55. package/src/lib/svg/zoom-out.bg.ts +2 -2
  56. package/src/lib/svg/zoom.manager.ts +56 -48
  57. package/src/lib/window.manager.ts +3 -3
  58. package/tsconfig.json +21 -17
  59. package/dist/seatmap.canvas.2.0.2.css +0 -1
  60. package/dist/seatmap.canvas.2.0.2.js +0 -2
  61. package/dist/seatmap.canvas.2.0.2.js.LICENSE.txt +0 -14
  62. package/examples/basic/bootstrap.min.css +0 -7
  63. package/examples/basic/index.html +0 -201
  64. package/examples/basic/jquery.min.js +0 -2
  65. package/examples/data/data.json +0 -70007
  66. package/examples/data/small.json +0 -1307
  67. package/examples/data/tiny.json +0 -119
  68. package/examples/old/index.html +0 -262
  69. package/webpack.environments/development.js +0 -58
  70. package/webpack.environments/production.js +0 -52
@@ -18,7 +18,7 @@ jobs:
18
18
  uses: actions/setup-node@v3
19
19
  with:
20
20
  registry-url: https://registry.npmjs.org/
21
- node-version: '16'
21
+ node-version: '18'
22
22
 
23
23
  # Install dependencies (required by Run tests step)
24
24
  - name: Install dependencies
package/.opencommitignore CHANGED
@@ -1 +1,2 @@
1
- /dist
1
+ /dist
2
+ yarn.lock
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 2.3.0 - 2023-12-24
8
+
7
9
  ## 2.0.3 - 2023-12-23
8
10
  ### Added
9
11
  - Changelog
package/README.md CHANGED
@@ -17,15 +17,13 @@ An opensource seat selection
17
17
  - Turnstile and Gate information
18
18
 
19
19
 
20
- ## Installation
21
20
 
22
- <pre>
23
- npm i <a href="https://www.npmjs.com/package/@seatmap/canvas">@seatmap/canvas</a> --save
24
- </pre>
21
+ ## Installation
25
22
 
26
- ### Github registry install
27
23
  <pre>
28
24
  npm i <a href="https://npm.pkg.github.com/alisaitteke/seatmap-canvas">@alisaitteke/seatmap-canvas</a> --save
25
+ OR
26
+ yarn add <a href="https://npm.pkg.github.com/alisaitteke/seatmap-canvas">@alisaitteke/seatmap-canvas</a> --save
29
27
  </pre>
30
28
 
31
29
 
@@ -0,0 +1,16 @@
1
+ !function(t){"use strict";var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function o(t){var e=t+="",o=e.indexOf(":");return o>=0&&"xmlns"!==(e=t.slice(0,o))&&(t=t.slice(o+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function i(t){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(o,t)}}function r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function s(t){var e=o(t);return(e.local?r:i)(e)}function a(){}function l(t){return null==t?a:function(){return this.querySelector(t)}}function u(){return[]}function c(t){return null==t?u:function(){return this.querySelectorAll(t)}}function h(t){return function(){return this.matches(t)}}function f(t){return new Array(t.length)}function d(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}d.prototype={constructor:d,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var p="$";function _(t,e,n,o,i,r){for(var s,a=0,l=e.length,u=r.length;a<u;++a)(s=e[a])?(s.__data__=r[a],o[a]=s):n[a]=new d(t,r[a]);for(;a<l;++a)(s=e[a])&&(i[a]=s)}function g(t,e,n,o,i,r,s){var a,l,u,c={},h=e.length,f=r.length,_=new Array(h);for(a=0;a<h;++a)(l=e[a])&&(_[a]=u=p+s.call(l,l.__data__,a,e),u in c?i[a]=l:c[u]=l);for(a=0;a<f;++a)(l=c[u=p+s.call(t,r[a],a,r)])?(o[a]=l,l.__data__=r[a],c[u]=null):n[a]=new d(t,r[a]);for(a=0;a<h;++a)(l=e[a])&&c[_[a]]===l&&(i[a]=l)}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function y(t){return function(){this.removeAttribute(t)}}function v(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,e){return function(){this.setAttribute(t,e)}}function w(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function x(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function M(t){return function(){this.style.removeProperty(t)}}function L(t,e,n){return function(){this.style.setProperty(t,e,n)}}function T(t,e,n){return function(){var o=e.apply(this,arguments);null==o?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function z(t,e){return t.style.getPropertyValue(e)||x(t).getComputedStyle(t,null).getPropertyValue(e)}function C(t){return function(){delete this[t]}}function S(t,e){return function(){this[t]=e}}function A(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function O(t){return t.trim().split(/^|\s+/)}function B(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=O(t.getAttribute("class")||"")}function U(t,e){for(var n=B(t),o=-1,i=e.length;++o<i;)n.add(e[o])}function V(t,e){for(var n=B(t),o=-1,i=e.length;++o<i;)n.remove(e[o])}function I(t){return function(){U(this,t)}}function K(t){return function(){V(this,t)}}function G(t,e){return function(){(e.apply(this,arguments)?U:V)(this,t)}}function D(){this.textContent=""}function P(t){return function(){this.textContent=t}}function R(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function j(){this.innerHTML=""}function Z(t){return function(){this.innerHTML=t}}function H(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Y(){this.nextSibling&&this.parentNode.appendChild(this)}function q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function X(){return null}function W(){var t=this.parentNode;t&&t.removeChild(this)}function F(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function $(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}N.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var J={},Q=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(J={mouseenter:"mouseover",mouseleave:"mouseout"}));function tt(t,e,n){return t=et(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function et(t,e,n){return function(o){var i=Q;Q=o;try{t.call(this,this.__data__,e,n)}finally{Q=i}}}function nt(t){return function(){var e=this.__on;if(e){for(var n,o=0,i=-1,r=e.length;o<r;++o)n=e[o],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function ot(t,e,n){var o=J.hasOwnProperty(t.type)?tt:et;return function(i,r,s){var a,l=this.__on,u=o(e,r,s);if(l)for(var c=0,h=l.length;c<h;++c)if((a=l[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=u,a.capture=n),void(a.value=e);this.addEventListener(t.type,u,n),a={type:t.type,name:t.name,value:e,listener:u,capture:n},l?l.push(a):this.__on=[a]}}function it(t,e,n){var o=x(t),i=o.CustomEvent;"function"==typeof i?i=new i(e,n):(i=o.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function rt(t,e){return function(){return it(this,t,e)}}function st(t,e){return function(){return it(this,t,e.apply(this,arguments))}}var at=[null];function lt(t,e){this._groups=t,this._parents=e}function ut(){return new lt([[document.documentElement]],at)}function ct(t){return"string"==typeof t?new lt([[document.querySelector(t)]],[document.documentElement]):new lt([[t]],at)}function ht(){for(var t,e=Q;t=e.sourceEvent;)e=t;return e}function ft(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}function dt(t){var e=ht();return e.changedTouches&&(e=e.changedTouches[0]),ft(t,e)}function pt(t,e,n){arguments.length<3&&(n=e,e=ht().changedTouches);for(var o,i=0,r=e?e.length:0;i<r;++i)if((o=e[i]).identifier===n)return ft(t,o);return null}
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */lt.prototype=ut.prototype={constructor:lt,select:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r,s,a=e[i],u=a.length,c=o[i]=new Array(u),h=0;h<u;++h)(r=a[h])&&(s=t.call(r,r.__data__,h,a))&&("__data__"in r&&(s.__data__=r.__data__),c[h]=s);return new lt(o,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=c(t));for(var e=this._groups,n=e.length,o=[],i=[],r=0;r<n;++r)for(var s,a=e[r],l=a.length,u=0;u<l;++u)(s=a[u])&&(o.push(t.call(s,s.__data__,u,a)),i.push(s));return new lt(o,i)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r,s=e[i],a=s.length,l=o[i]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new lt(o,this._parents)},data:function(t,e){if(!t)return d=new Array(this.size()),u=-1,this.each((function(t){d[++u]=t})),d;var n=e?g:_,o=this._parents,i=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],h=i[u],f=h.length,d=t.call(c,c&&c.__data__,u,o),p=d.length,m=a[u]=new Array(p),y=s[u]=new Array(p);n(c,h,m,y,l[u]=new Array(f),d,e);for(var v,b,w=0,E=0;w<p;++w)if(v=m[w]){for(w>=E&&(E=w+1);!(b=y[E])&&++E<p;);v._next=b||null}}return(s=new lt(s,o))._enter=a,s._exit=l,s},enter:function(){return new lt(this._enter||this._groups.map(f),this._parents)},exit:function(){return new lt(this._exit||this._groups.map(f),this._parents)},join:function(t,e,n){var o=this.enter(),i=this,r=this.exit();return o="function"==typeof t?t(o):o.append(t+""),null!=e&&(i=e(i)),null==n?r.remove():n(r),o&&i?o.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l,u=e[a],c=n[a],h=u.length,f=s[a]=new Array(h),d=0;d<h;++d)(l=u[d]||c[d])&&(f[d]=l);for(;a<o;++a)s[a]=e[a];return new lt(s,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o,i=t[e],r=i.length-1,s=i[r];--r>=0;)(o=i[r])&&(s&&4^o.compareDocumentPosition(s)&&s.parentNode.insertBefore(o,s),s=o);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=m);for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var s,a=n[r],l=a.length,u=i[r]=new Array(l),c=0;c<l;++c)(s=a[c])&&(u[c]=s);u.sort(e)}return new lt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i,r=e[n],s=0,a=r.length;s<a;++s)(i=r[s])&&t.call(i,i.__data__,s,r);return this},attr:function(t,e){var n=o(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?v:y:"function"==typeof e?n.local?k:E:n.local?w:b)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?M:"function"==typeof e?T:L)(t,e,null==n?"":n)):z(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?C:"function"==typeof e?A:S)(t,e)):this.node()[t]},classed:function(t,e){var n=O(t+"");if(arguments.length<2){for(var o=B(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?G:e?I:K)(n,e))},text:function(t){return arguments.length?this.each(null==t?D:("function"==typeof t?R:P)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?j:("function"==typeof t?H:Z)(t)):this.node().innerHTML},raise:function(){return this.each(Y)},lower:function(){return this.each(q)},append:function(t){var e="function"==typeof t?t:s(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:s(t),o=null==e?X:"function"==typeof e?e:l(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)}))},remove:function(){return this.each(W)},clone:function(t){return this.select(t?$:F)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var o,i,r=function(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),s=r.length;if(!(arguments.length<2)){for(a=e?ot:nt,null==n&&(n=!1),o=0;o<s;++o)this.each(a(r[o],e,n));return this}var a=this.node().__on;if(a)for(var l,u=0,c=a.length;u<c;++u)for(o=0,l=a[u];o<s;++o)if((i=r[o]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,e){return this.each(("function"==typeof e?st:rt)(t,e))}};var _t=function(t,e){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},_t(t,e)};function gt(t,e){function n(){this.constructor=t}_t(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function mt(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}function yt(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function vt(t,e){return t[0]-e[0]||t[1]-e[1]}function bt(t){for(var e,n,o,i=t.length,r=[0,1],s=2,a=2;a<i;++a){for(;s>1&&(e=t[r[s-2]],n=t[r[s-1]],o=t[a],(n[0]-e[0])*(o[1]-e[1])-(n[1]-e[1])*(o[0]-e[0])<=0);)--s;r[s++]=a}return r.slice(0,s)}var wt=function(){function t(t){return this.parent=t,this.node=null,this.autoGenerate=!1,this.child_index=null,this.domText=null,this.child_items=[],this.dom_attrs=[],this.dom_classes=[],this.tags=[],this.eventCode=null,void 0!==t.global&&(this.global=t.global),Object(this).dom_params&&(Object(this).dom_params.tag&&(this.domTag=Object(this).dom_params.tag),Object(this).dom_params.class&&(this.domClass=Object(this).dom_params.class),Object(this).dom_params.event_code&&(this.eventCode=Object(this).dom_params.event_code)),void 0!==Object(this).dom_params.autoGenerate&&!0===Object(this).dom_params.autoGenerate&&(this.autoGenerate=!0),this.generateThisDom(),this}return t.prototype.generateThisDom=function(){return this.autoGenerate&&(this.domGenerate(this.parent.node),this.afterGenerate()),this},t.prototype.domGenerate=function(t,e){void 0===e&&(e=0);var n=this.domTag?this.domTag:"g";this.child_index=e,this.node=t.datum(this.parent).append(n);for(var o=0;o<this.dom_attrs.length;o++){var i=this.dom_attrs[o];this.node.attr(i.name,i.value)}this.domText&&this.node.text(this.domText),this.domClass&&this.node.classed(this.domClass,!0);for(var r=0;r<this.dom_classes.length;r++){var s=this.dom_classes[r];this.node.classed(s.name,s.value)}return this},t.prototype.attr=function(t,e){return this.dom_attrs.push({name:t,value:e}),this},t.prototype.text=function(t){return this.domText=t,this},t.prototype.addChild=function(t,e,n){for(var o in e){var i=e[o];t.dom_attrs.push({name:o,value:i})}return this.child_items.push(t),this},t.prototype.classed=function(t,e){return void 0===e&&(e=!0),this.dom_classes.push({name:t,value:e}),this},t.prototype.clear=function(){return this.child_items.map((function(t){t.node.remove()})),this.child_items=[],this},t.prototype.updateChilds=function(){var t=this;return this.child_items.map((function(e,n){e.domGenerate(t.node,n),e.update()})),this.afterGenerate(),this.updateEvents(!1),this},t.prototype.updateEvents=function(t){void 0===t&&(t=!1);var e=this,n=["click","mousever","mouseleave","mouseout","mouseenter","mousemove","keydown","keypress","mousedown","mouseup","touchstart"];if(this.eventCode){for(var o=function(t){var o=i.global.eventManager.events[t],r=o.type.toString().split(".");r[0].toLowerCase()===i.eventCode.toLowerCase()&&-1!==n.indexOf(r[1].toLowerCase())&&void 0!==r[1]&&i.node.on(r[1].toLowerCase()+".globalevent",(function(t){var n=dt(e.parent.node.node());o.fn(e,t,n)}))},i=this,r=0;r<this.global.eventManager.events.length;r++)o(r);t&&this.child_items.length>0&&this.child_items.map((function(t){"function"==typeof t.updateEvents&&t.updateEvents(!0)}))}return this},t.prototype.addEventListener=function(t,e){return this.global.eventManager.addEventListener(t,e),this.updateEvents(!1),this},t.prototype.addTag=function(t){return this.tags.push(t),this},t.prototype.hasTag=function(t){return-1!==this.tags.indexOf(t)},t.prototype.getChilds=function(t){return void 0===t&&(t=null),null===t?this.child_items.filter((function(e){return e.constructor.name===t})):this.child_items},t.prototype.getChildCount=function(){return this.child_items.length},t.prototype.beforeGenerate=function(){},t.prototype.afterGenerate=function(){},t.prototype.addToParent=function(){return this.parent.addChild(this),this},t.prototype.addTo=function(t){return t.addChild(this),this},t}();function Et(t){return function(e){e.prototype.dom_params={},t.tag&&(e.prototype.dom_params.tag=t.tag),t.class&&(e.prototype.dom_params.class=t.class),t.event_code?e.prototype.dom_params.event_code=t.event_code:t.class&&(e.prototype.dom_params.event_code=t.class),void 0!==t.autoGenerate?e.prototype.dom_params.autoGenerate=t.autoGenerate:e.prototype.dom_params.autoGenerate=!0}}var kt,xt,Mt,Lt=function(){this.child_index=null,this.item_type=null},Tt=function(t){function e(e){var n=t.call(this)||this;return n.tag_index={},n.id=e.id,n.x=e.x,n.y=e.y,n.title=e.title||null,n.color=e.color||null,n.block=e.block,n.note=e.note||null,n.salable=!1!==e.salable||e.salable,n.selected=e.selected||!1,n.tags=e.tags||[],n.custom_data=e.custom_data||{},n.tag_index={},n.svg=null,n}return gt(e,t),e.prototype.selectedToggle=function(){return this.selected=!0!==this.selected,this.selected},e.prototype.addTag=function(t){this.tag_index[t]||(this.tag_index[t]=!0,this.tags.push(t))},e.prototype.removeTags=function(t){},e.prototype.toJson=function(){return{id:this.id,x:this.x,y:this.y,salable:this.salable,note:this.note,color:this.color,block:this.block.toJson()}},e}(Lt),zt=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.block=e.block,n}return gt(e,t),e}(Lt),Ct=function(t){function e(e){var n=t.call(this)||this;return n.id=e.id?e.id:(1e3*Math.random()).toString(),n.width=e.width||null,n.height=e.height||null,n.x=e.x||null,n.y=e.y||null,n.bounds=e._bounds||[],n.color=e.color||"#f1f1f1",n.border_color=e.border_color||"#f1f1f1",n.title=e.title,n.rotate=e.rotate||0,n.labels=e.labels.map((function(t){return t.block=n,new zt(t)}))||[],n.seats=e.seats.map((function(t){return t.block=n,new Tt(t)}))||[],n}return gt(e,t),e.prototype.toJson=function(){return{id:this.id,title:this.title,x:this.x,y:this.y,color:this.color,width:this.width,height:this.height}},e}(Lt),St=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("block-id",e.item.block.id),n.attr("r",n.global.config.seat_style.radius),n.attr("fill",n.global.config.seat_style.color),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width",1),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Et({tag:"circle",class:"seat-circle",autoGenerate:!1}),yt("design:paramtypes",[Nt])],e)}(wt),At=function(){function t(t){this.x=t.x||0,this.y=t.y||0}return t.prototype.toArray=function(){return[this.x,this.y]},t.prototype.toJson=function(){return{}},t}();!function(t){t.ADD_BLOCK="BLOCK.ADD",t.REMOVE_BLOCK="BLOCK.REMOVE",t.CLICK_BLOCK="BLOCK.CLICK",t.MOUSEENTER_BLOCK="BLOCK.MOUSEENTER",t.TOUCHSTART_BLOCK="BLOCK.TOUCHSTART",t.MOUSEDOWN_BLOCK="BLOCK.MOUSEDOWN",t.MOUSEUP_BLOCK="BLOCK.MOUSEUP",t.MOUSEMOVE_BLOCK="BLOCK.MOUSEMOVE",t.MOUSELEAVE_BLOCK="BLOCK.MOUSELEAVE",t.UPDATE_BLOCK="BLOCK.UPDATE",t.CLICK_SEAT="SEAT.CLICK",t.TOUCHSTART_SEAT="SEAT.TOUCHSTART",t.MOUSEMOVE_SEAT="SEAT.MOUSEMOVE",t.MOUSEDOWN_SEAT="SEAT.MOUSEDOWN",t.MOUSEENTER_SEAT="SEAT.MOUSEENTER",t.MOUSELEAVE_SEAT="SEAT.MOUSELEAVE",t.MOUSEOUT_SEAT="SEAT.MOUSEOUT",t.ADD_SEAT="SEAT.ADD",t.REMOVE_SEAT="SEAT.REMOVE",t.ZOOM_LEVEL_CHANGE="ZOOM_LEVEL_CHANGE",t.BOUND_CLICK="BOUND.CLICK",t.MOUSE_MOVE="MOUSE.MOVE",t.RESIZE_WINDOW="WINDOW.RESIZE",t.CLICK_ZOOM_OUT="ZOOM-OUT-BG.CLICK",t.MOUSEMOVE_ZOOM_OUT="ZOOM-OUT-BG.MOUSEMOVE",t.KEYDOWN_SVG="KEYDOWN.SEATMAP-SVG",t.KEYUP_SVG="KEYUP.SEATMAP-SVG",t.MULTI_SELECT_ENABLE="MULTI_SELECT_ENABLE",t.MULTI_SELECT_DISABLE="MULTI_SELECT_DISABLE",t.BEST_AVAILABLE_ENABLE="BEST_AVAILABLE_ENABLE",t.MBEST_AVAILABLE_DISABLE="MBEST_AVAILABLE_DISABLE",t.READY="READY"}(kt||(kt={})),function(t){t.VENUE="VENUE",t.BLOCK="BLOCK",t.SEAT="SEAT"}(xt||(xt={})),function(t){t.HOVER="hover",t.FOCUS="focus",t.LEAVE="leave",t.SELECT="select",t.NORMAL="normal"}(Mt||(Mt={}));var Ot,Bt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.text(""),n.attr("class","fa"),n.attr("fill",n.global.config.seat_style.check_icon_color),n.attr("transform","translate(-7,4) scale(0.8)"),n.attr("pointer-events","none"),n.attr("display","none"),n.attr("opacity",0),n}return gt(e,t),e.prototype.update=function(){return this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e.prototype.show=function(){return this.node.attr("display","block"),this.node.attr("opacity",1),this},e.prototype.hide=function(){return this.node.attr("display","none"),this.node.attr("opacity",0),this},e=mt([Et({tag:"text",class:"seat-check",autoGenerate:!1}),yt("design:paramtypes",[Nt])],e)}(wt),Nt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.coordinates=new At(n),o.attr("transform","translate("+o.coordinates.toArray()+")"),o.item.svg=o,o}return gt(e,t),e.prototype.setColor=function(t,e){return void 0===e&&(e=!1),e?this.circle.node.transition().duration(this.global.config.animation_speed).attr("fill",t):this.circle.node.attr("fill",t),this},e.prototype.updateColor=function(t){return this.setColor(this.getColor()),this},e.prototype.select=function(t){return this.item.selected=!0,this.node.classed("selected",!0),this.circle.node.attr("fill",this.global.config.seat_style.selected),this.check.show(),this},e.prototype.unSelect=function(){return this.item.selected=!1,this.node.classed("selected",!1),this.circle.node.attr("fill",this.global.config.seat_style.color),this.check.hide(),this},e.prototype.isSelected=function(){return this.item.selected},e.prototype.isSalable=function(){return this.item.salable},e.prototype.hover=function(){this.setColor(this.global.config.seat_style.hover)},e.prototype.blur=function(){this.setColor(this.getColor())},e.prototype.getColor=function(t){return void 0===t&&(t=null),this.isSalable()?t==Mt.FOCUS?this.isSelected()?this.global.config.seat_style.focus_out:this.global.config.seat_style.focus:t==Mt.HOVER?this.isSelected()?this.global.config.seat_style.selected:this.global.config.seat_style.hover:t==Mt.LEAVE?this.isSelected()?this.global.config.seat_style.selected:this.global.config.seat_style.color:t==Mt.SELECT?(this.isSelected(),this.global.config.seat_style.selected):this.isSelected()?this.global.config.seat_style.selected:this.global.config.seat_style.color:this.global.config.seat_style.not_salable},e.prototype.update=function(){return this.circle=new St(this),this.addChild(this.circle),this.check=new Bt(this).addTo(this),this.updateChilds(),this},e.prototype.afterGenerate=function(){this.setColor(this.getColor()),this.item.selected?this.check.show():this.check.hide()},e=mt([Et({tag:"g",class:"seat",autoGenerate:!1}),yt("design:paramtypes",[Ut,Tt])],e)}(wt),Ut=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.global.eventManager.addEventListener(kt.MOUSEENTER_SEAT,(function(t){o.global.multi_select||t.setColor(t.getColor(Mt.HOVER))})),o.global.eventManager.addEventListener(kt.MOUSELEAVE_SEAT,(function(t){t.setColor(t.getColor())})),o}return gt(e,t),e.prototype.update=function(){var t=this;return this.item.seats.forEach((function(e){t.addChild(new Nt(t,e),{id:e.id})})),this.updateChilds(),this},e.prototype.getSeat=function(t){return this.child_items.find((function(e){return e.item.id==t}))},e.prototype.getSeats=function(){return this.child_items},e.prototype.getSeatsCount=function(){return this.child_items.length},e.prototype.getSeatByIndex=function(t){return this.child_items[t]},e.prototype.resetSeatsColors=function(t){void 0===t&&(t=!1);for(var e=0;e<this.getSeatsCount();e++){var n=this.getSeatByIndex(e);n.item;var o=n.getColor();!n.isSelected()&&n.isSalable()&&(o=n.getColor(Mt.LEAVE),n.setColor(o,t))}},e=mt([Et({tag:"g",class:"seats",autoGenerate:!1}),yt("design:paramtypes",[Ht,Ct])],e)}(wt),Vt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.block_style.title_color),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Et({tag:"text",class:"title",autoGenerate:!1}),yt("design:paramtypes",[It])],e)}(wt),It=function(t){function e(e,n){var o=t.call(this,e)||this;o.parent=e,o.item=n,console.log("item",n),o.attr("opacity",0);var i=(o.item.bounds[1][0]-o.item.bounds[2][0])/2+o.item.bounds[2][0],r=(o.item.bounds[0][1]-o.item.bounds[1][1])/2+o.item.bounds[1][1];return o.attr("transform","translate("+[i,r]+")"),o}return gt(e,t),e.prototype.update=function(){return this.title=new Vt(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.parent.item.title),this},e=mt([Et({tag:"g",class:"info",autoGenerate:!1}),yt("design:paramtypes",[Ht,Ct])],e)}(wt),Kt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o}return gt(e,t),e.prototype.show=function(){this.node.classed("bound-hide",!1)},e.prototype.hide=function(){this.node.classed("bound-hide",!0)},e.prototype.update=function(){return this.updateChilds(),this.node.datum(this.item.bounds).attr("d",(function(t){return"M"+t.join("L")+"Z"})),this},e=mt([Et({tag:"path",class:"bound",autoGenerate:!1}),yt("design:paramtypes",[Object,Ct])],e)}(wt),Gt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o}return gt(e,t),e.prototype.update=function(){return this.bound1=new Kt(this,this.item),this.bound1.attr("fill",this.parent.item.border_color),this.bound1.attr("stroke-width",70),this.bound1.attr("stroke",this.parent.item.border_color),this.bound1.classed("block-hull-border"),this.bound2=new Kt(this,this.item),this.bound2.attr("fill",this.item.color),this.bound2.attr("stroke-width",60),this.bound2.attr("stroke",this.item.color),this.bound2.classed("block-hull"),this.addChild(this.bound1),this.addChild(this.bound2),this.updateChilds(),this},e=mt([Et({tag:"g",class:"bounds",autoGenerate:!1}),yt("design:paramtypes",[Ht,Ct])],e)}(wt),Dt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.global.eventManager.addEventListener(kt.BOUND_CLICK,(function(t){if(!o.global.multi_select){var n=t.parent.parent.item;t.hasTag("block-level")?e.global.zoomManager.zoomToBlock(n.id):t.hasTag("seat-level")&&e.global.zoomManager.zoomToSelection()}})),o}return gt(e,t),e.prototype.update=function(){return this.seatLevelMask=new Kt(this,this.item),this.seatLevelMask.attr("fill",this.item.color),this.seatLevelMask.attr("stroke-width",59),this.seatLevelMask.attr("stroke",this.item.color),this.seatLevelMask.tags.push("seat-level"),this.seatLevelMask.classed("seat-level-mask"),this.blockLevelMask=new Kt(this,this.item),this.blockLevelMask.attr("fill",this.item.color),this.blockLevelMask.attr("stroke-width",59),this.blockLevelMask.attr("stroke",this.item.color),this.blockLevelMask.tags.push("block-level"),this.blockLevelMask.classed("block-level-mask"),this.addChild(this.seatLevelMask),this.addChild(this.blockLevelMask),this.updateChilds(),this},e=mt([Et({tag:"g",class:"masks",autoGenerate:!1}),yt("design:paramtypes",[Ht,Ct])],e)}(wt),Pt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.label_style.radius),n.attr("fill",n.global.config.label_style.bg),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Et({tag:"circle",class:"label-circle",autoGenerate:!1}),yt("design:paramtypes",[jt])],e)}(wt),Rt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("fill",n.global.config.label_style.color),n.attr("font-size",n.global.config.label_style.font_size),n}return gt(e,t),e.prototype.update=function(){return this},e=mt([Et({tag:"text",class:"label-text",autoGenerate:!1}),yt("design:paramtypes",[jt])],e)}(wt),jt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.coordinates=new At(n),o.attr("transform","translate("+o.coordinates.toArray()+")"),o}return gt(e,t),e.prototype.update=function(){return this.circle=new Pt(this),this.addChild(this.circle),this.circle=new Rt(this),this.addChild(this.circle),this.updateChilds(),this.circle.node.text(this.item.title),this},e=mt([Et({tag:"g",class:"label",autoGenerate:!1}),yt("design:paramtypes",[Zt,zt])],e)}(wt),Zt=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o}return gt(e,t),e.prototype.update=function(){var t=this;return this.item.labels.map((function(e){t.addChild(new jt(t,e))})),this.updateChilds(),this},e.prototype.getLabels=function(){return this.child_items},e=mt([Et({tag:"g",class:"labels",autoGenerate:!1}),yt("design:paramtypes",[Ht,Ct])],e)}(wt),Ht=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.item=n,o.center_position={x:null,y:null},o.top_position={x:null,y:null},o.attr("id",n.id),o.attr("opacity",0),o.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level===xt.VENUE?(o.mask.blockLevelMask.show(),o.mask.seatLevelMask.show(),o.seats.resetSeatsColors(!1),o.infosToCenter()):t.level===xt.BLOCK?(o.mask.blockLevelMask.hide(),o.mask.seatLevelMask.show(),o.infosToTop()):t.level===xt.SEAT&&(o.mask.blockLevelMask.hide(),o.mask.seatLevelMask.hide(),o.seats.resetSeatsColors(!1),o.infosToTop())})),o.global.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){o.seats.resetSeatsColors(!1)})),o.global.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){o.seats.resetSeatsColors(!1)})),o.global.eventManager.addEventListener(kt.MOUSEMOVE_BLOCK,(function(t){if(o.parent.parent.searchCircle.is_enable&&!o.global.multi_select){var e=dt(o.parent.parent.blocks.node.node()),n=o.global.config.zoom_focus_circle_radius;if(o.global.zoomManager.zoomLevel===xt.BLOCK)for(var i=0;i<t.seats.getSeatsCount();i++){var r=t.seats.getSeatByIndex(i),s=r.item,a=r.getColor();r.isSelected()?a=r.getColor(Mt.SELECT):(s.x-n<e[0]&&s.x+n>e[0]&&s.y-n<e[1]&&s.y+n>e[1]&&(a=r.getColor(Mt.FOCUS)),r.setColor(a))}}})),o.global.eventManager.addEventListener(kt.MOUSELEAVE_BLOCK,(function(t){console.log(t),o.seats.resetSeatsColors()})),o.parent.node.on("mouseleave.seats",(function(){o.seats.resetSeatsColors(!1)})),o}return gt(e,t),e.prototype.update=function(){return this.bounds=new Gt(this,this.item),this.addChild(this.bounds),this.seats=new Ut(this,this.item),this.addChild(this.seats),this.labels=new Zt(this,this.item),this.addChild(this.labels),this.mask=new Dt(this,this.item),this.addChild(this.mask),this.info=new It(this,this.item),this.addChild(this.info),this.center_position.x=(this.item.bounds[1][0]-this.item.bounds[2][0])/2+this.item.bounds[2][0],this.center_position.y=(this.item.bounds[0][1]-this.item.bounds[1][1])/2+this.item.bounds[1][1],this.top_position.x=this.center_position.x,this.top_position.y=this.item.bounds[1][1]-50,this.updateChilds(),this.infosToCenter(),this.node.interrupt().transition().duration(this.global.config.animation_speed).attr("opacity",1),this.item.rotate&&(this.node.attr("transform-origin","".concat(this.center_position.x," ").concat(this.center_position.y)),this.node.attr("transform","rotate("+this.item.rotate+")")),this},e.prototype.infosToTop=function(){this.info.node&&this.top_position.x&&this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.top_position.x+","+this.top_position.y+")").attr("opacity",1).attr("font-size",14).attr("fill","#ffffff")},e.prototype.infosToCenter=function(){this.info.node&&this.center_position.x&&this.info.node.interrupt().transition().duration(this.global.config.animation_speed).attr("transform","translate("+this.center_position.x+","+this.center_position.y+")").attr("opacity",1).attr("font-size",28).attr("fill","#ffffff")},e=mt([Et({tag:"g",class:"block",autoGenerate:!1}),yt("design:paramtypes",[Yt,Ct])],e)}(wt),Yt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.global.data.getBlocks().map((function(e){var n=new Ht(t,e),o=e.seats;o&&o.length&&(o[0].y+=1e-4,o[0].x+=1e-4);var i=o.map((function(t){return[t.x,t.y]})).concat(e.labels.map((function(t){return[t.x,t.y]})));e.bounds=function(t){if((n=t.length)<3)return null;var e,n,o=new Array(n),i=new Array(n);for(e=0;e<n;++e)o[e]=[+t[e][0],+t[e][1],e];for(o.sort(vt),e=0;e<n;++e)i[e]=[o[e][0],-o[e][1]];var r=bt(o),s=bt(i),a=s[0]===r[0],l=s[s.length-1]===r[r.length-1],u=[];for(e=r.length-1;e>=0;--e)u.push(t[o[r[e]][2]]);for(e=+a;e<s.length-l;++e)u.push(t[o[s[e]][2]]);return u}(i),t.addChild(n)})),this.updateChilds(),this.seats=this.node.selectAll(".seat"),this},e.prototype.getBlock=function(t){var e=this.getBlocks().find((function(e){return e.item.id==t}));return e||null},e.prototype.getBlocks=function(){return this.getChilds(Ht.name)},e.prototype.center=function(){},e=mt([Et({tag:"g",class:"blocks",autoGenerate:!1}),yt("design:paramtypes",[Wt])],e)}(wt),qt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.parent.global.config.zoom_focus_circle_radius),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e=mt([Et({tag:"circle",class:"circle",autoGenerate:!1}),yt("design:paramtypes",[Xt])],e)}(wt),Xt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.is_enable=!0,n.global.eventManager.addEventListener(kt.MOUSE_MOVE,(function(t){n.global.zoomManager.zoomLevel===xt.BLOCK&&n.is_enable&&n.node.attr("transform","translate("+t+")")})),n.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level!==xt.VENUE&&t.level!==xt.SEAT||n.node.classed("show",!1)})),n.global.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){n.disable()})),n.global.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){n.enable()})),n}return gt(e,t),e.prototype.update=function(){var t=this;return this.clear(),this.circle=new qt(this),this.addChild(this.circle),this.updateChilds(),this.parent.blocks.node.on("mouseleave.search",(function(){t.node.classed("show",!1)})),this.parent.blocks.node.on("mousemove.search",(function(){t.global.zoomManager.zoomLevel===xt.VENUE?t.node.classed("show",!1):t.global.zoomManager.zoomLevel===xt.BLOCK?t.node.classed("show",!0):t.global.zoomManager.zoomLevel===xt.SEAT&&t.node.classed("show",!1)})),this},e.prototype.enable=function(){return this.is_enable=!0,this.node.style("display","block"),this},e.prototype.disable=function(){return this.is_enable=!1,this.node.style("display","none"),this},e=mt([Et({tag:"g",class:"search-circle",autoGenerate:!1}),yt("design:paramtypes",[Wt])],e)}(wt),Wt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){this.blocks=new Yt(this),this.addChild(this.blocks),this.searchCircle=new Xt(this),this.addChild(this.searchCircle),this.updateChilds()},e=mt([Et({tag:"g",class:"stage",autoGenerate:!1}),yt("design:paramtypes",[me])],e)}(wt),Ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(t){!function(e){var n="object"==typeof Ft?Ft:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=i(t);function i(t,e){return function(n,o){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:o}),e&&e(n,o)}}void 0===n.Reflect?n.Reflect=t:o=i(n.Reflect,o),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",r="function"==typeof Object.create,s={__proto__:[]}instanceof Array,a=!r&&!s,l={create:r?function(){return ot(Object.create(null))}:s?function(){return ot({__proto__:null})}:function(){return ot({})},has:a?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:a?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,f=c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,d=new(c||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,o){if(U(n)){if(!Z(t))throw new TypeError;if(!Y(e))throw new TypeError;return x(t,e)}if(!Z(t))throw new TypeError;if(!K(e))throw new TypeError;if(!K(o)&&!U(o)&&!V(o))throw new TypeError;return V(o)&&(o=void 0),M(t,e,n=j(n),o)}function _(t,e){function n(n,o){if(!K(n))throw new TypeError;if(!U(o)&&!q(o))throw new TypeError;A(t,e,n,o)}return n}function g(t,e,n,o){if(!K(n))throw new TypeError;return U(o)||(o=j(o)),A(t,e,n,o)}function m(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),T(t,e,n)}function y(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),z(t,e,n)}function v(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),C(t,e,n)}function b(t,e,n){if(!K(e))throw new TypeError;return U(n)||(n=j(n)),S(t,e,n)}function w(t,e){if(!K(t))throw new TypeError;return U(e)||(e=j(e)),O(t,e)}function E(t,e){if(!K(t))throw new TypeError;return U(e)||(e=j(e)),B(t,e)}function k(t,e,n){if(!K(e))throw new TypeError;U(n)||(n=j(n));var o=L(e,n,!1);if(U(o))return!1;if(!o.delete(t))return!1;if(o.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}function x(t,e){for(var n=t.length-1;n>=0;--n){var o=(0,t[n])(e);if(!U(o)&&!V(o)){if(!Y(o))throw new TypeError;e=o}}return e}function M(t,e,n,o){for(var i=t.length-1;i>=0;--i){var r=(0,t[i])(e,n,o);if(!U(r)&&!V(r)){if(!K(r))throw new TypeError;o=r}}return o}function L(t,e,n){var o=d.get(t);if(U(o)){if(!n)return;o=new h,d.set(t,o)}var i=o.get(e);if(U(i)){if(!n)return;i=new h,o.set(e,i)}return i}function T(t,e,n){if(z(t,e,n))return!0;var o=Q(e);return!V(o)&&T(t,o,n)}function z(t,e,n){var o=L(e,n,!1);return!U(o)&&P(o.has(t))}function C(t,e,n){if(z(t,e,n))return S(t,e,n);var o=Q(e);return V(o)?void 0:C(t,o,n)}function S(t,e,n){var o=L(e,n,!1);if(!U(o))return o.get(t)}function A(t,e,n,o){L(n,o,!0).set(t,e)}function O(t,e){var n=B(t,e),o=Q(t);if(null===o)return n;var i=O(o,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var r=new f,s=[],a=0,l=n;a<l.length;a++){var u=l[a];r.has(u)||(r.add(u),s.push(u))}for(var c=0,h=i;c<h.length;c++){u=h[c];r.has(u)||(r.add(u),s.push(u))}return s}function B(t,e){var n=[],o=L(t,e,!1);if(U(o))return n;for(var i=W(o.keys()),r=0;;){var s=$(i);if(!s)return n.length=r,n;var a=F(s);try{n[r]=a}catch(t){try{J(i)}finally{throw t}}r++}}function N(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function U(t){return void 0===t}function V(t){return null===t}function I(t){return"symbol"==typeof t}function K(t){return"object"==typeof t?null!==t:"function"==typeof t}function G(t,e){switch(N(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=X(t,o);if(void 0!==i){var r=i.call(t,n);if(K(r))throw new TypeError;return r}return D(t,"default"===n?"number":n)}function D(t,e){if("string"===e){var n=t.toString;if(H(n))if(!K(i=n.call(t)))return i;if(H(o=t.valueOf))if(!K(i=o.call(t)))return i}else{var o;if(H(o=t.valueOf))if(!K(i=o.call(t)))return i;var i,r=t.toString;if(H(r))if(!K(i=r.call(t)))return i}throw new TypeError}function P(t){return!!t}function R(t){return""+t}function j(t){var e=G(t,3);return I(e)?e:R(e)}function Z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function H(t){return"function"==typeof t}function Y(t){return"function"==typeof t}function q(t){switch(N(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!H(n))throw new TypeError;return n}}function W(t){var e=X(t,i);if(!H(e))throw new TypeError;var n=e.call(t);if(!K(n))throw new TypeError;return n}function F(t){return t.value}function $(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var n=t.prototype,o=n&&Object.getPrototypeOf(n);if(null==o||o===Object.prototype)return e;var i=o.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var o=this._keys.length,i=n+1;i<o;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,o)},e.prototype.values=function(){return new n(this._keys,this._values,r)},e.prototype.entries=function(){return new n(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function o(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=l.create(),o=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=r(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=r(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return r(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=r(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+u()}while(l.has(n,t));return n[t]=!0,t}function r(t,n){if(!e.call(t,o)){if(!n)return;Object.defineProperty(t,o,{value:l.create()})}return t[o]}function s(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function a(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):s(new Uint8Array(t),t):s(new Array(t),t)}function u(){var e=a(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",o=0;o<t;++o){var i=e[o];4!==o&&6!==o&&8!==o||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function ot(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",_),t("defineMetadata",g),t("hasMetadata",m),t("hasOwnMetadata",y),t("getMetadata",v),t("getOwnMetadata",b),t("getMetadataKeys",w),t("getOwnMetadataKeys",E),t("deleteMetadata",k)}(o)}()}(Ot||(Ot={}));var $t=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(kt.RESIZE_WINDOW,(function(t){n.node.attr("width",t.width).attr("height",t.height).on("click.zoomout",(function(){n.global.eventManager.dispatch(kt.CLICK_ZOOM_OUT,n)}))})),n}return gt(e,t),e.prototype.update=function(){},e=mt([Et({tag:"rect",class:"zoom-out-bg",autoGenerate:!1}),yt("design:paramtypes",[me])],e)}(wt),Jt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("r",n.global.config.legend_style.radius),n.attr("fill",n.parent.legend_data.color),n}return gt(e,t),e.prototype.update=function(){},e=mt([Et({tag:"circle",class:"legend-circle",autoGenerate:!1}),yt("design:paramtypes",[ee])],e)}(wt),Qt=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",1.5*n.global.config.legend_style.radius),n.attr("fill",n.global.config.legend_style.font_color),n}return gt(e,t),e.prototype.update=function(){},e=mt([Et({tag:"text",class:"legend-title",autoGenerate:!1}),yt("design:paramtypes",[ee])],e)}(wt),te=function(t){function e(e){var n=t.call(this)||this;return n.x=e.x,n.y=e.y,n.title=e.title,n.color=e.color,n}return gt(e,t),e}(Lt),ee=function(t){function e(e,n){var o=t.call(this,e)||this;return o.parent=e,o.legend_data=n,o}return gt(e,t),e.prototype.update=function(){if(this.circle=new Jt(this),this.addChild(this.circle),this.title=new Qt(this),this.addChild(this.title),this.updateChilds(),this.title.node.text(this.legend_data.title),this.child_index){var t=this.child_index*this.global.config.legend_style.padding;this.node.attr("transform","translate("+[0,t]+")")}},e=mt([Et({tag:"g",class:"legend-item",autoGenerate:!1}),yt("design:paramtypes",[ne,te])],e)}(wt),ne=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n}return gt(e,t),e.prototype.update=function(){var t=[];t.push({title:this.global.config.lang.non_selectable,color:this.global.config.seat_style.not_salable}),t.push({title:this.global.config.lang.selectable,color:this.global.config.seat_style.color}),t.push({title:this.global.config.lang.your_selection,color:this.global.config.seat_style.selected});for(var e=0;e<t.length;e++){var n=new ee(this,t[e]);this.addChild(n)}this.updateChilds()},e.prototype.afterGenerate=function(){var t=2*this.global.config.legend_style.radius,e=150-this.global.config.legend_style.padding*this.getChildCount();this.node.attr("transform","translate("+[t,e]+")")},e=mt([Et({tag:"g",class:"legend",autoGenerate:!1}),yt("design:paramtypes",[me])],e)}(wt),oe=Math.PI,ie=2*oe,re=1e-6,se=ie-re;function ae(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function le(){return new ae}function ue(t){return function(){return t}}function ce(t){this._context=t}function he(t){return new ce(t)}function fe(t){return t[0]}function de(t){return t[1]}ae.prototype=le.prototype={constructor:ae,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,o){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+o)},bezierCurveTo:function(t,e,n,o,i,r){this._+="C"+ +t+","+ +e+","+ +n+","+ +o+","+(this._x1=+i)+","+(this._y1=+r)},arcTo:function(t,e,n,o,i){t=+t,e=+e,n=+n,o=+o,i=+i;var r=this._x1,s=this._y1,a=n-t,l=o-e,u=r-t,c=s-e,h=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>re)if(Math.abs(c*a-l*u)>re&&i){var f=n-r,d=o-s,p=a*a+l*l,_=f*f+d*d,g=Math.sqrt(p),m=Math.sqrt(h),y=i*Math.tan((oe-Math.acos((p+h-_)/(2*g*m)))/2),v=y/m,b=y/g;Math.abs(v-1)>re&&(this._+="L"+(t+v*u)+","+(e+v*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*d)+","+(this._x1=t+b*a)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,o,i,r){t=+t,e=+e,r=!!r;var s=(n=+n)*Math.cos(o),a=n*Math.sin(o),l=t+s,u=e+a,c=1^r,h=r?o-i:i-o;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>re||Math.abs(this._y1-u)>re)&&(this._+="L"+l+","+u),n&&(h<0&&(h=h%ie+ie),h>se?this._+="A"+n+","+n+",0,1,"+c+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):h>re&&(this._+="A"+n+","+n+",0,"+ +(h>=oe)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +o+"h"+-n+"Z"},toString:function(){return this._}},ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var pe=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("width",n.global.config.tooltip_style.width),n.attr("height",n.global.config.tooltip_style.height),n.attr("x",0),n.attr("y",0),n.attr("rx",3),n.attr("ry",3),function(){var t=fe,e=de,n=ue(!0),o=null,i=he,r=null;function s(s){var a,l,u,c=s.length,h=!1;for(null==o&&(r=i(u=le())),a=0;a<=c;++a)!(a<c&&n(l=s[a],a,s))===h&&((h=!h)?r.lineStart():r.lineEnd()),h&&r.point(+t(l,a,s),+e(l,a,s));if(u)return r=null,u+""||null}return s.x=function(e){return arguments.length?(t="function"==typeof e?e:ue(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ue(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:ue(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=o&&(r=i(o)),s):i},s.context=function(t){return arguments.length?(null==t?o=r=null:r=i(o=t),s):o},s}().x((function(t){return t.x})).y((function(t){return t.y})),n.attr("fill",n.global.config.tooltip_style.bg),n.attr("stroke","rgba(0,0,0,0.3)"),n.attr("stroke-width","1px"),n.attr("opacity",.8),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none")},e=mt([Et({tag:"rect",class:"tooltip-rect",autoGenerate:!1}),yt("design:paramtypes",[ge])],e)}(wt),_e=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("x",6),n.attr("y",21),n.attr("fill",n.global.config.tooltip_style.color),n}return gt(e,t),e.prototype.update=function(){return this.updateChilds(),this},e.prototype.afterGenerate=function(){this.node.style("pointer-events","none"),this.node.style("font-size","12px")},e.prototype.generateTitle=function(){this.node.selectAll("tspan").remove().data(this.title).enter().append("tspan").text((function(t){return t})).attr("x",6).attr("y",(function(t,e){return 16*e+16}))},e=mt([Et({tag:"text",class:"tooltip-title",autoGenerate:!1}),yt("design:paramtypes",[ge])],e)}(wt),ge=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.attr("transform","translate(0,0)"),n.attr("opacity",0),n.activeSeat=null,n.global.eventManager.addEventListener([kt.MOUSEMOVE_SEAT],(function(t){n.global.multi_select||n.activeSeat!==t&&t.item.title&&(n.activeSeat=t,n.setTitle(t.item.title.split("\n")),n.title.generateTitle())})),n.global.eventManager.addEventListener([kt.MOUSEOUT_SEAT],(function(t){n.node.attr("opacity",0),n.activeSeat=null,n.title.title=[],n.title.generateTitle()})),n.global.eventManager.addEventListener([kt.TOUCHSTART_BLOCK],(function(t){n.node.attr("opacity",0)})),n}return gt(e,t),e.prototype.setTitle=function(t){return this.title.title=t,this},e.prototype.update=function(){return this.rect=new pe(this).addTo(this),this.title=new _e(this).addTo(this),this.updateChilds(),this},e.prototype.afterGenerate=function(){var t=this;this.parent.node.on("mousemove.seat",(function(){if(!t.global.multi_select)if(t.global.zoomManager.zoomLevel===xt.SEAT&&null!==t.activeSeat){var e=dt(this),n=e[0]-t.global.config.tooltip_style.width/2,o=e[1]-(t.global.config.tooltip_style.height+t.global.config.seat_style.radius+2);t.node.attr("transform","translate("+[n,o]+")").attr("opacity",1)}else t.node.attr("opacity",0)}))},e=mt([Et({tag:"g",class:"seatmap-tooltip",autoGenerate:!1}),yt("design:paramtypes",[me])],e)}(wt),me=function(t){function e(e){var n=t.call(this,e)||this;return n.parent=e,n.global.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){n.node.classed("zoom-level-"+xt.SEAT,!1),n.node.classed("zoom-level-"+xt.BLOCK,!1),n.node.classed("zoom-level-"+xt.VENUE,!1),n.node.classed("zoom-level-"+t.level,!0)})),n}return gt(e,t),e.prototype.update=function(){var t=this;this.stage=new Wt(this).addToParent(),this.zoomOutBg=new $t(this).addToParent(),this.global.config.legend_show&&(this.legend=new ne(this).addToParent()),this.tooltip=new ge(this).addToParent(),this.updateChilds(),this.stage.node.raise(),this.global.config.legend_show&&this.legend.node.raise(),this.tooltip.node.raise(),this.node.on("mousemove",(function(){var e=dt(t.stage.node.node());t.parent.eventManager.dispatch(kt.MOUSE_MOVE,e)}))},e=mt([Et({tag:"svg",class:"seatmap-svg",autoGenerate:!1}),yt("design:paramtypes",[Fo])],e)}(wt),ye=function(){function t(t){this.context=t}return t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return console.log(t),this},t}(),ve=function(){function t(t){this._self=t,this.blocks=[],this.eventManager=t.eventManager,this.addEventListener=t.eventManager.addEventListener}return t.prototype.addBlock=function(t){return this.blocks.push(new Ct(t)),this.eventManager.dispatch(kt.ADD_BLOCK,[t]),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.addBulkBlock=function(t){var e=this;return t.map((function(t){console.log("item",t),e.blocks.push(new Ct(t))})),this.eventManager.dispatch(kt.ADD_BLOCK,[t]),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.replaceData=function(t){return this.blocks=[],this.addBulkBlock(t),this},t.prototype.getBlock=function(t){var e=this.blocks.find((function(e){return e.id===t}));return e||null},t.prototype.getBlocks=function(t){if(t){var e=this.getBlock(t);return e?[e]:[]}return this.blocks},t.prototype.removeBlock=function(t){var e=this;return this.filterBlock({id:t}).map((function(t,n){e.blocks.splice(n,1)})),this.eventManager.dispatch(kt.REMOVE_BLOCK,t),this.eventManager.dispatch(kt.UPDATE_BLOCK,this.blocks),this},t.prototype.getSeat=function(t,e){var n=this.getBlock(e);if(n){var o=n.seats.find((function(e){return e.id==t}));return o||null}return console.error(new Error("Block not found!")),null},t.prototype.getSelectedSeats=function(t){var e=this.getBlocks(t),n=[];return e.forEach((function(t){t.seats.forEach((function(t){t.selected&&n.push(t)}))})),n},t.prototype.filterBlock=function(t){return this.blocks.filter((function(e){return e.id===t.id}))},t.prototype.toJson=function(){return{blocks:this.blocks}},t}(),be=function(){function t(t){this.min_zoom=.1,this.max_zoom=1.9,this.animation_speed=600,this.resizable=!1,this.container=null,this.zoom_focus_circle_radius=60,this.click_enable_sold_seats=!1,this.legend_show=!1,this.canvas_stageout_control=!0,this.zoom_focus_circle_radius=t.zoom_focus_circle_radius?t.zoom_focus_circle_radius:this.zoom_focus_circle_radius,this.click_enable_sold_seats=t.click_enable_sold_seats?t.click_enable_sold_seats:this.click_enable_sold_seats,this.max_zoom=t.max_zoom?t.max_zoom:this.max_zoom,this.resizable=t.resizable?t.resizable:this.resizable,this.zoom_out_button=t.zoom_out_button?t.zoom_out_button:".zoom-out-button",this.legend_show=0!=t.legend_show||t.legend_show,this.canvas_stageout_control=0!=t.canvas_stageout_control||t.canvas_stageout_control,this.seat_style={radius:t.seat_style&&t.seat_style.radius||12,color:t.seat_style&&t.seat_style.color||"#77b2ff",not_salable:t.seat_style&&t.seat_style.not_salable||"#ccc9c9",selected:t.seat_style&&t.seat_style.selected||"#51ff48",hover:t.seat_style&&t.seat_style.hover||"#4770ff",focus:t.seat_style&&t.seat_style.focus||"#6293d2",focus_out:t.seat_style&&t.seat_style.focus_out||"#ff001c",check_color:t.seat_style&&t.seat_style.check_color||"#ffffff",check_icon:null,check_icon_color:t.seat_style&&t.seat_style.check_icon_color||"#ffffff"},this.block_style={fill:t.block_style&&t.block_style.fill||"#ffffff",stroke:t.block_style&&t.block_style.stroke||"#ffffff",border_width:t.block_style&&t.block_style.border_width||4,title_color:t.block_style&&t.block_style.title_color||"#000000",title_font_size:t.block_style&&t.block_style.title_font_size||28},this.label_style={color:t.label_style&&t.label_style.color||"#000000",bg:t.label_style&&t.label_style.bg||"#ffffff",font_size:t.label_style&&t.label_style.font_size||12,radius:t.label_style&&t.label_style.radius||12},this.legend_style={radius:t.legend_style&&t.legend_style.radius||12,padding:t.legend_style&&t.legend_style.padding||36,font_size:t.legend_style&&t.legend_style.font_size||100,font_color:t.legend_style&&t.legend_style.font_color||"#000000"},this.tooltip_style={border_width:t.tooltip_style&&t.tooltip_style.border_width||1,width:t.tooltip_style&&t.tooltip_style.width||140,height:t.tooltip_style&&t.tooltip_style.height||58,color:t.tooltip_style&&t.tooltip_style.color||"#000000",bg:t.tooltip_style&&t.tooltip_style.bg||"#ffffff"},this.lang={selectable:t.lang&&t.lang.selectable||"Selectable",non_selectable:t.lang&&t.lang.non_selectable||"Non Selectable or Rezerved",your_selection:t.lang&&t.lang.your_selection||"Your Selection"}}return t.prototype.getAll=function(){return this},t}(),we={value:function(){}};function Ee(){for(var t,e=0,n=arguments.length,o={};e<n;++e){if(!(t=arguments[e]+"")||t in o||/[\s.]/.test(t))throw new Error("illegal type: "+t);o[t]=[]}return new ke(o)}function ke(t){this._=t}function xe(t,e){for(var n,o=0,i=t.length;o<i;++o)if((n=t[o]).name===e)return n.value}function Me(t,e,n){for(var o=0,i=t.length;o<i;++o)if(t[o].name===e){t[o]=we,t=t.slice(0,o).concat(t.slice(o+1));break}return null!=n&&t.push({name:e,value:n}),t}function Le(){Q.preventDefault(),Q.stopImmediatePropagation()}function Te(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ze(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Ce(){}ke.prototype=Ee.prototype={constructor:ke,on:function(t,e){var n,o,i=this._,r=(o=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),s=-1,a=r.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s<a;)if(n=(t=r[s]).type)i[n]=Me(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Me(i[n],t.name,null);return this}for(;++s<a;)if((n=(t=r[s]).type)&&(n=xe(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ke(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,o,i=new Array(n),r=0;r<n;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,n=(o=this._[t]).length;r<n;++r)o[r].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)}};var Se=.7,Ae=1/Se,Oe="\\s*([+-]?\\d+)\\s*",Be="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ne="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ue=/^#([0-9a-f]{3,8})$/,Ve=new RegExp("^rgb\\("+[Oe,Oe,Oe]+"\\)$"),Ie=new RegExp("^rgb\\("+[Ne,Ne,Ne]+"\\)$"),Ke=new RegExp("^rgba\\("+[Oe,Oe,Oe,Be]+"\\)$"),Ge=new RegExp("^rgba\\("+[Ne,Ne,Ne,Be]+"\\)$"),De=new RegExp("^hsl\\("+[Be,Ne,Ne]+"\\)$"),Pe=new RegExp("^hsla\\("+[Be,Ne,Ne,Be]+"\\)$"),Re={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function je(){return this.rgb().formatHex()}function Ze(){return this.rgb().formatRgb()}function He(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ue.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ye(e):3===n?new We(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?qe(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?qe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ve.exec(t))?new We(e[1],e[2],e[3],1):(e=Ie.exec(t))?new We(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ke.exec(t))?qe(e[1],e[2],e[3],e[4]):(e=Ge.exec(t))?qe(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=De.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=Pe.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):Re.hasOwnProperty(t)?Ye(Re[t]):"transparent"===t?new We(NaN,NaN,NaN,0):null}function Ye(t){return new We(t>>16&255,t>>8&255,255&t,1)}function qe(t,e,n,o){return o<=0&&(t=e=n=NaN),new We(t,e,n,o)}function Xe(t,e,n,o){return 1===arguments.length?((i=t)instanceof Ce||(i=He(i)),i?new We((i=i.rgb()).r,i.g,i.b,i.opacity):new We):new We(t,e,n,null==o?1:o);var i}function We(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}function Fe(){return"#"+Je(this.r)+Je(this.g)+Je(this.b)}function $e(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Je(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Qe(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new en(t,e,n,o)}function tn(t){if(t instanceof en)return new en(t.h,t.s,t.l,t.opacity);if(t instanceof Ce||(t=He(t)),!t)return new en;if(t instanceof en)return t;var e=(t=t.rgb()).r/255,n=t.g/255,o=t.b/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(s=e===r?(n-o)/a+6*(n<o):n===r?(o-e)/a+2:(e-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new en(s,a,l,t.opacity)}function en(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}function nn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function on(t){return function(){return t}}function rn(t){return 1==(t=+t)?sn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}(e,n,t):on(isNaN(e)?n:e)}}function sn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):on(isNaN(t)?e:t)}Te(Ce,He,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:je,formatHex:je,formatHsl:function(){return tn(this).formatHsl()},formatRgb:Ze,toString:Ze}),Te(We,Xe,ze(Ce,{brighter:function(t){return t=null==t?Ae:Math.pow(Ae,t),new We(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Se:Math.pow(Se,t),new We(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fe,formatHex:Fe,formatRgb:$e,toString:$e})),Te(en,(function(t,e,n,o){return 1===arguments.length?tn(t):new en(t,e,n,null==o?1:o)}),ze(Ce,{brighter:function(t){return t=null==t?Ae:Math.pow(Ae,t),new en(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Se:Math.pow(Se,t),new en(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,i=2*n-o;return new We(nn(t>=240?t-240:t+120,i,o),nn(t,i,o),nn(t<120?t+240:t-120,i,o),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var an=function t(e){var n=rn(e);function o(t,e){var o=n((t=Xe(t)).r,(e=Xe(e)).r),i=n(t.g,e.g),r=n(t.b,e.b),s=sn(t.opacity,e.opacity);return function(e){return t.r=o(e),t.g=i(e),t.b=r(e),t.opacity=s(e),t+""}}return o.gamma=t,o}(1);function ln(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cn=new RegExp(un.source,"g");function hn(t,e){var n,o,i,r=un.lastIndex=cn.lastIndex=0,s=-1,a=[],l=[];for(t+="",e+="";(n=un.exec(t))&&(o=cn.exec(e));)(i=o.index)>r&&(i=e.slice(r,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:ln(n,o)})),r=cn.lastIndex;return r<e.length&&(i=e.slice(r),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,o=0;o<e;++o)a[(n=l[o]).i]=n.x(t);return a.join("")})}var fn,dn,pn,_n,gn=180/Math.PI,mn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yn(t,e,n,o,i,r){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*o)&&(n-=t*l,o-=e*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),t*o<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(e,t)*gn,skewX:Math.atan(l)*gn,scaleX:s,scaleY:a}}function vn(t,e,n,o){function i(t){return t.length?t.pop()+" ":""}return function(r,s){var a=[],l=[];return r=t(r),s=t(s),function(t,o,i,r,s,a){if(t!==i||o!==r){var l=s.push("translate(",null,e,null,n);a.push({i:l-4,x:ln(t,i)},{i:l-2,x:ln(o,r)})}else(i||r)&&s.push("translate("+i+e+r+n)}(r.translateX,r.translateY,s.translateX,s.translateY,a,l),function(t,e,n,r){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),r.push({i:n.push(i(n)+"rotate(",null,o)-2,x:ln(t,e)})):e&&n.push(i(n)+"rotate("+e+o)}(r.rotate,s.rotate,a,l),function(t,e,n,r){t!==e?r.push({i:n.push(i(n)+"skewX(",null,o)-2,x:ln(t,e)}):e&&n.push(i(n)+"skewX("+e+o)}(r.skewX,s.skewX,a,l),function(t,e,n,o,r,s){if(t!==n||e!==o){var a=r.push(i(r)+"scale(",null,",",null,")");s.push({i:a-4,x:ln(t,n)},{i:a-2,x:ln(e,o)})}else 1===n&&1===o||r.push(i(r)+"scale("+n+","+o+")")}(r.scaleX,r.scaleY,s.scaleX,s.scaleY,a,l),r=s=null,function(t){for(var e,n=-1,o=l.length;++n<o;)a[(e=l[n]).i]=e.x(t);return a.join("")}}}var bn=vn((function(t){return"none"===t?mn:(fn||(fn=document.createElement("DIV"),dn=document.documentElement,pn=document.defaultView),fn.style.transform=t,t=pn.getComputedStyle(dn.appendChild(fn),null).getPropertyValue("transform"),dn.removeChild(fn),yn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),wn=vn((function(t){return null==t?mn:(_n||(_n=document.createElementNS("http://www.w3.org/2000/svg","g")),_n.setAttribute("transform",t),(t=_n.transform.baseVal.consolidate())?yn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):mn)}),", ",")",")"),En=Math.SQRT2,kn=2,xn=4,Mn=1e-12;function Ln(t){return((t=Math.exp(t))+1/t)/2}function Tn(t,e){var n,o,i=t[0],r=t[1],s=t[2],a=e[0],l=e[1],u=e[2],c=a-i,h=l-r,f=c*c+h*h;if(f<Mn)o=Math.log(u/s)/En,n=function(t){return[i+t*c,r+t*h,s*Math.exp(En*t*o)]};else{var d=Math.sqrt(f),p=(u*u-s*s+xn*f)/(2*s*kn*d),_=(u*u-s*s-xn*f)/(2*u*kn*d),g=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(_*_+1)-_);o=(m-g)/En,n=function(t){var e=t*o,n=Ln(g),a=s/(kn*d)*(n*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(En*e+g)-function(t){return((t=Math.exp(t))-1/t)/2}(g));return[i+a*c,r+a*h,s*n/Ln(En*e+g)]}}return n.duration=1e3*o,n}var zn,Cn,Sn=0,An=0,On=0,Bn=1e3,Nn=0,Un=0,Vn=0,In="object"==typeof performance&&performance.now?performance:Date,Kn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Gn(){return Un||(Kn(Dn),Un=In.now()+Vn)}function Dn(){Un=0}function Pn(){this._call=this._time=this._next=null}function Rn(t,e,n){var o=new Pn;return o.restart(t,e,n),o}function jn(){Un=(Nn=In.now())+Vn,Sn=An=0;try{!function(){Gn(),++Sn;for(var t,e=zn;e;)(t=Un-e._time)>=0&&e._call.call(null,t),e=e._next;--Sn}()}finally{Sn=0,function(){var t,e,n=zn,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:zn=e);Cn=t,Hn(o)}(),Un=0}}function Zn(){var t=In.now(),e=t-Nn;e>Bn&&(Vn-=e,Nn=t)}function Hn(t){Sn||(An&&(An=clearTimeout(An)),t-Un>24?(t<1/0&&(An=setTimeout(jn,t-In.now()-Vn)),On&&(On=clearInterval(On))):(On||(Nn=In.now(),On=setInterval(Zn,Bn)),Sn=1,Kn(jn)))}function Yn(t,e,n){var o=new Pn;return e=null==e?0:+e,o.restart((function(n){o.stop(),t(n+e)}),e,n),o}Pn.prototype=Rn.prototype={constructor:Pn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Gn():+n)+(null==e?0:+e),this._next||Cn===this||(Cn?Cn._next=this:zn=this,Cn=this),this._call=t,this._time=n,Hn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hn())}};var qn=Ee("start","end","cancel","interrupt"),Xn=[],Wn=0,Fn=1,$n=2,Jn=3,Qn=4,to=5,eo=6;function no(t,e,n,o,i,r){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};!function(t,e,n){var o,i=t.__transition;function r(t){n.state=Fn,n.timer.restart(s,n.delay,n.time),n.delay<=t&&s(t-n.delay)}function s(r){var u,c,h,f;if(n.state!==Fn)return l();for(u in i)if((f=i[u]).name===n.name){if(f.state===Jn)return Yn(s);f.state===Qn?(f.state=eo,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+u<e&&(f.state=eo,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[u])}if(Yn((function(){n.state===Jn&&(n.state=Qn,n.timer.restart(a,n.delay,n.time),a(r))})),n.state=$n,n.on.call("start",t,t.__data__,n.index,n.group),n.state===$n){for(n.state=Jn,o=new Array(h=n.tween.length),u=0,c=-1;u<h;++u)(f=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(o[++c]=f);o.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(l),n.state=to,1),r=-1,s=o.length;++r<s;)o[r].call(t,i);n.state===to&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){for(var o in n.state=eo,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Rn(r,0,n.time)}(t,n,{name:e,index:o,group:i,on:qn,tween:Xn,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Wn})}function oo(t,e){var n=ro(t,e);if(n.state>Wn)throw new Error("too late; already scheduled");return n}function io(t,e){var n=ro(t,e);if(n.state>Jn)throw new Error("too late; already running");return n}function ro(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function so(t,e){var n,o,i,r=t.__transition,s=!0;if(r){for(i in e=null==e?null:e+"",r)(n=r[i]).name===e?(o=n.state>$n&&n.state<to,n.state=eo,n.timer.stop(),n.on.call(o?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[i]):s=!1;s&&delete t.__transition}}function ao(t,e){var n,o;return function(){var i=io(this,t),r=i.tween;if(r!==n)for(var s=0,a=(o=n=r).length;s<a;++s)if(o[s].name===e){(o=o.slice()).splice(s,1);break}i.tween=o}}function lo(t,e,n){var o,i;if("function"!=typeof n)throw new Error;return function(){var r=io(this,t),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function uo(t,e,n){var o=t._id;return t.each((function(){var t=io(this,o);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ro(t,o).value[e]}}function co(t,e){var n;return("number"==typeof e?ln:e instanceof He?an:(n=He(e))?(e=n,an):hn)(t,e)}function ho(t){return function(){this.removeAttribute(t)}}function fo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function po(t,e,n){var o,i,r=n+"";return function(){var s=this.getAttribute(t);return s===r?null:s===o?i:i=e(o=s,n)}}function _o(t,e,n){var o,i,r=n+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===o?i:i=e(o=s,n)}}function go(t,e,n){var o,i,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttribute(t))===(a=l+"")?null:s===o&&a===i?r:(i=a,r=e(o=s,l));this.removeAttribute(t)}}function mo(t,e,n){var o,i,r;return function(){var s,a,l=n(this);if(null!=l)return(s=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:s===o&&a===i?r:(i=a,r=e(o=s,l));this.removeAttributeNS(t.space,t.local)}}function yo(t,e){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,i)),n}return i._value=e,i}function vo(t,e){var n,o;function i(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,i)),n}return i._value=e,i}function bo(t,e){return function(){oo(this,t).delay=+e.apply(this,arguments)}}function wo(t,e){return e=+e,function(){oo(this,t).delay=e}}function Eo(t,e){return function(){io(this,t).duration=+e.apply(this,arguments)}}function ko(t,e){return e=+e,function(){io(this,t).duration=e}}var xo=ut.prototype.constructor;function Mo(t){return function(){this.style.removeProperty(t)}}var Lo=0;function To(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function zo(){return++Lo}var Co=ut.prototype;To.prototype={constructor:To,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=l(t));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s<i;++s)for(var a,u,c=o[s],h=c.length,f=r[s]=new Array(h),d=0;d<h;++d)(a=c[d])&&(u=t.call(a,a.__data__,d,c))&&("__data__"in a&&(u.__data__=a.__data__),f[d]=u,no(f[d],e,n,d,f,ro(a,n)));return new To(r,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=c(t));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l,u=o[a],h=u.length,f=0;f<h;++f)if(l=u[f]){for(var d,p=t.call(l,l.__data__,f,u),_=ro(l,n),g=0,m=p.length;g<m;++g)(d=p[g])&&no(d,e,n,g,p,_);r.push(p),s.push(l)}return new To(r,s,e,n)},filter:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,o=new Array(n),i=0;i<n;++i)for(var r,s=e[i],a=s.length,l=o[i]=[],u=0;u<a;++u)(r=s[u])&&t.call(r,r.__data__,u,s)&&l.push(r);return new To(o,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l,u=e[a],c=n[a],h=u.length,f=s[a]=new Array(h),d=0;d<h;++d)(l=u[d]||c[d])&&(f[d]=l);for(;a<o;++a)s[a]=e[a];return new To(s,this._parents,this._name,this._id)},selection:function(){return new xo(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=zo(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s,a=o[r],l=a.length,u=0;u<l;++u)if(s=a[u]){var c=ro(s,e);no(s,t,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new To(o,this._parents,t,n)},call:Co.call,nodes:Co.nodes,node:Co.node,size:Co.size,empty:Co.empty,each:Co.each,on:function(t,e){var n=this._id;return arguments.length<2?ro(this.node(),n).on.on(t):this.each(function(t,e,n){var o,i,r=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?oo:io;return function(){var s=r(this,t),a=s.on;a!==o&&(i=(o=a).copy()).on(e,n),s.on=i}}(n,t,e))},attr:function(t,e){var n=o(t),i="transform"===n?wn:co;return this.attrTween(t,"function"==typeof e?(n.local?mo:go)(n,i,uo(this,"attr."+t,e)):null==e?(n.local?fo:ho)(n):(n.local?_o:po)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=o(t);return this.tween(n,(i.local?yo:vo)(i,e))},style:function(t,e,n){var o="transform"==(t+="")?bn:co;return null==e?this.styleTween(t,function(t,e){var n,o,i;return function(){var r=z(this,t),s=(this.style.removeProperty(t),z(this,t));return r===s?null:r===n&&s===o?i:i=e(n=r,o=s)}}(t,o)).on("end.style."+t,Mo(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var o,i,r;return function(){var s=z(this,t),a=n(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=z(this,t)),s===l?null:s===o&&l===i?r:(i=l,r=e(o=s,a))}}(t,o,uo(this,"style."+t,e))).each(function(t,e){var n,o,i,r,s="style."+e,a="end."+s;return function(){var l=io(this,t),u=l.on,c=null==l.value[s]?r||(r=Mo(e)):void 0;u===n&&i===c||(o=(n=u).copy()).on(a,i=c),l.on=o}}(this._id,t)):this.styleTween(t,function(t,e,n){var o,i,r=n+"";return function(){var s=z(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}(t,o,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==e)return this.tween(o,null);if("function"!=typeof e)throw new Error;return this.tween(o,function(t,e,n){var o,i;function r(){var r=e.apply(this,arguments);return r!==i&&(o=(i=r)&&function(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}(t,r,n)),o}return r._value=e,r}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(uo(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function o(){var o=t.apply(this,arguments);return o!==n&&(e=(n=o)&&function(t){return function(e){this.textContent=t.call(this,e)}}(o)),e}return o._value=t,o}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o,i=ro(this.node(),n).tween,r=0,s=i.length;r<s;++r)if((o=i[r]).name===t)return o.value;return null}return this.each((null==e?ao:lo)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?bo:wo)(e,t)):ro(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Eo:ko)(e,t)):ro(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){io(this,t).ease=e}}(e,t)):ro(this.node(),e).ease},end:function(){var t,e,n=this,o=n._id,i=n.size();return new Promise((function(r,s){var a={value:s},l={value:function(){0==--i&&r()}};n.each((function(){var n=io(this,o),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),n.on=e}))}))}};var So={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ao(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return So.time=Gn(),So;return n}function Oo(t){return function(){return t}}function Bo(t,e,n){this.target=t,this.type=e,this.transform=n}function No(t,e,n){this.k=t,this.x=e,this.y=n}ut.prototype.interrupt=function(t){return this.each((function(){so(this,t)}))},ut.prototype.transition=function(t){var e,n;t instanceof To?(e=t._id,t=t._name):(e=zo(),(n=So).time=Gn(),t=null==t?null:t+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s,a=o[r],l=a.length,u=0;u<l;++u)(s=a[u])&&no(s,t,e,u,a,n||Ao(s,e));return new To(o,this._parents,t,e)},No.prototype={constructor:No,scale:function(t){return 1===t?this:new No(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new No(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Uo=new No(1,0,0);function Vo(){Q.stopImmediatePropagation()}function Io(){Q.preventDefault(),Q.stopImmediatePropagation()}function Ko(){return!Q.ctrlKey&&!Q.button}function Go(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Do(){return this.__zoom||Uo}function Po(){return-Q.deltaY*(1===Q.deltaMode?.05:Q.deltaMode?1:.002)}function Ro(){return navigator.maxTouchPoints||"ontouchstart"in this}function jo(t,e,n){var o=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Zo(){var t,e,n=Ko,o=Go,i=jo,r=Po,s=Ro,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Tn,h=Ee("start","zoom","end"),f=500,d=150,p=0;function _(t){t.property("__zoom",Do).on("wheel.zoom",E).on("mousedown.zoom",k).on("dblclick.zoom",x).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(t,e){return(e=Math.max(a[0],Math.min(a[1],e)))===t.k?t:new No(e,t.x,t.y)}function m(t,e,n){var o=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return o===t.x&&i===t.y?t:new No(t.k,o,i)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function v(t,e,n){t.on("start.zoom",(function(){b(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,r=b(t,i),s=o.apply(t,i),a=null==n?y(s):"function"==typeof n?n.apply(t,i):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=c(u.invert(a).concat(l/u.k),h.invert(a).concat(l/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=l/e[2];t=new No(n,a[0]-e[0]*n,a[1]-e[1]*n)}r.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.extent=o.apply(t,e),this.taps=0}function E(){if(n.apply(this,arguments)){var t=b(this,arguments),e=this.__zoom,o=Math.max(a[0],Math.min(a[1],e.k*Math.pow(2,r.apply(this,arguments)))),s=dt(this);if(t.wheel)t.mouse[0][0]===s[0]&&t.mouse[0][1]===s[1]||(t.mouse[1]=e.invert(t.mouse[0]=s)),clearTimeout(t.wheel);else{if(e.k===o)return;t.mouse=[s,e.invert(s)],so(this),t.start()}Io(),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),d),t.zoom("mouse",i(m(g(e,o),t.mouse[0],t.mouse[1]),t.extent,l))}}function k(){if(!e&&n.apply(this,arguments)){var t=b(this,arguments,!0),o=ct(Q.view).on("mousemove.zoom",(function(){if(Io(),!t.moved){var e=Q.clientX-s,n=Q.clientY-a;t.moved=e*e+n*n>p}t.zoom("mouse",i(m(t.that.__zoom,t.mouse[0]=dt(t.that),t.mouse[1]),t.extent,l))}),!0).on("mouseup.zoom",(function(){o.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,o=ct(t).on("dragstart.drag",null);e&&(o.on("click.drag",Le,!0),setTimeout((function(){o.on("click.drag",null)}),0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(Q.view,t.moved),Io(),t.end()}),!0),r=dt(this),s=Q.clientX,a=Q.clientY;!function(t){var e=t.document.documentElement,n=ct(t).on("dragstart.drag",Le,!0);"onselectstart"in e?n.on("selectstart.drag",Le,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(Q.view),Vo(),t.mouse=[r,this.__zoom.invert(r)],so(this),t.start()}}function x(){if(n.apply(this,arguments)){var t=this.__zoom,e=dt(this),r=t.invert(e),s=t.k*(Q.shiftKey?.5:2),a=i(m(g(t,s),e,r),o.apply(this,arguments),l);Io(),u>0?ct(this).transition().duration(u).call(v,a,e):ct(this).call(_.transform,a)}}function M(){if(n.apply(this,arguments)){var e,o,i,r,s=Q.touches,a=s.length,l=b(this,arguments,Q.changedTouches.length===a);for(Vo(),o=0;o<a;++o)r=[r=pt(this,s,(i=s[o]).identifier),this.__zoom.invert(r),i.identifier],l.touch0?l.touch1||l.touch0[2]===r[2]||(l.touch1=r,l.taps=0):(l.touch0=r,e=!0,l.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(l.taps<2&&(t=setTimeout((function(){t=null}),f)),so(this),l.start())}}function L(){if(this.__zooming){var e,n,o,r,s=b(this,arguments),a=Q.changedTouches,u=a.length;for(Io(),t&&(t=clearTimeout(t)),s.taps=0,e=0;e<u;++e)o=pt(this,a,(n=a[e]).identifier),s.touch0&&s.touch0[2]===n.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===n.identifier&&(s.touch1[0]=o);if(n=s.that.__zoom,s.touch1){var c=s.touch0[0],h=s.touch0[1],f=s.touch1[0],d=s.touch1[1],p=(p=f[0]-c[0])*p+(p=f[1]-c[1])*p,_=(_=d[0]-h[0])*_+(_=d[1]-h[1])*_;n=g(n,Math.sqrt(p/_)),o=[(c[0]+f[0])/2,(c[1]+f[1])/2],r=[(h[0]+d[0])/2,(h[1]+d[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],r=s.touch0[1]}s.zoom("touch",i(m(n,o,r),s.extent,l))}}function T(){if(this.__zooming){var t,n,o=b(this,arguments),i=Q.changedTouches,r=i.length;for(Vo(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),f),t=0;t<r;++t)n=i[t],o.touch0&&o.touch0[2]===n.identifier?delete o.touch0:o.touch1&&o.touch1[2]===n.identifier&&delete o.touch1;if(o.touch1&&!o.touch0&&(o.touch0=o.touch1,delete o.touch1),o.touch0)o.touch0[1]=this.__zoom.invert(o.touch0[0]);else if(o.end(),2===o.taps){var s=ct(this).on("dblclick.zoom");s&&s.apply(this,arguments)}}}return _.transform=function(t,e,n){var o=t.selection?t.selection():t;o.property("__zoom",Do),t!==o?v(t,e,n):o.interrupt().each((function(){b(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},_.scaleBy=function(t,e,n){_.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)}),n)},_.scaleTo=function(t,e,n){_.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,s=null==n?y(t):"function"==typeof n?n.apply(this,arguments):n,a=r.invert(s),u="function"==typeof e?e.apply(this,arguments):e;return i(m(g(r,u),s,a),t,l)}),n)},_.translateBy=function(t,e,n){_.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),l)}))},_.translateTo=function(t,e,n,r){_.transform(t,(function(){var t=o.apply(this,arguments),s=this.__zoom,a=null==r?y(t):"function"==typeof r?r.apply(this,arguments):r;return i(Uo.translate(a[0],a[1]).scale(s.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,l)}),r)},w.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,e,n,o){var i=Q;t.sourceEvent=Q,Q=t;try{return e.apply(n,o)}finally{Q=i}}(new Bo(_,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},_.wheelDelta=function(t){return arguments.length?(r="function"==typeof t?t:Oo(+t),_):r},_.filter=function(t){return arguments.length?(n="function"==typeof t?t:Oo(!!t),_):n},_.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Oo(!!t),_):s},_.extent=function(t){return arguments.length?(o="function"==typeof t?t:Oo([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),_):o},_.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],_):[a[0],a[1]]},_.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(t){return arguments.length?(i=t,_):i},_.duration=function(t){return arguments.length?(u=+t,_):u},_.interpolate=function(t){return arguments.length?(c=t,_):c},_.on=function(){var t=h.on.apply(h,arguments);return t===h?_:t},_.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,_):Math.sqrt(p)},_}No.prototype;var Ho=function(){function t(t){this._self=t,this.zoomTypes={normal:null,animated:null,fastAnimated:null},this.scale={x:null,y:null,k:null},this.zoomLevels={VENUE:null,BLOCK:null,SEAT:null},this.minZoom=null,this.activeBlocks=[],this.zoomLevel=xt.VENUE,this.dispatchZoomEvent()}return t.prototype.init=function(){var t=this;console.log("zoom init"),this.calculateZoomLevels(),this.zoomInit(),this._self.eventManager.addEventListener(kt.KEYDOWN_SVG,(function(e){17!=e.which&&91!==e.which||(t._self.eventManager.dispatch(kt.MULTI_SELECT_ENABLE,e),Q.preventDefault(),t.zoomDisable())})),this._self.eventManager.addEventListener(kt.KEYUP_SVG,(function(e){t._self.eventManager.dispatch(kt.MULTI_SELECT_DISABLE,e),Q.preventDefault(),t.zoomEnable()}))},t.prototype.zoomInit=function(){console.info("zoomInit"),this.zoomTypes.normal=Zo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.zoomEnd(this)).on("zoom",this.zoomHand(this)),this.zoomTypes.animated=Zo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedZoomEnd(this)).on("zoom",this.zoomHandAnimated(this)),this.zoomTypes.fastAnimated=Zo().scaleExtent([this._self.config.min_zoom,this._self.config.max_zoom]).on("end",this.animatedFastZoomEnd(this)).on("zoom",this.zoomHandFastAnimated(this)),this._self.svg.node.call(this.zoomTypes.normal)},t.prototype.zoomEnd=function(t){return console.info("zoomEnd"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+e+","+n+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.animatedZoomEnd=function(t){return console.info("animatedZoomEnd"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+e+","+n+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.animatedFastZoomEnd=function(t){return console.info("animatedFastZoomEnd"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+e+","+n+")scale("+o+")"),t.calculateActiveBlocks(),t.calculateZoomLevel(o)}},t.prototype.zoomHand=function(t){return console.info("zoomHand"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().attr("transform","translate("+e+","+n+")scale("+o+")"),t.calculateZoomLevel(o)}},t.prototype.zoomHandAnimated=function(t){return console.info("zoomHandAnimated"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed).attr("transform","translate("+e+","+n+")scale("+o+")")}},t.prototype.zoomHandFastAnimated=function(t){return console.info("zoomHandFastAnimated"),function(){var e=Q.transform.x,n=Q.transform.y,o=Q.transform.k;t._self.svg.stage.node.interrupt().transition().duration(t._self.config.animation_speed/2).attr("transform","translate("+e+","+n+")scale("+o+")")}},t.prototype.calculateZoomLevel=function(t){console.info("calculateZoomLevel");var e=this._self.config.max_zoom-.2,n=this.zoomLevels.BLOCK.k,o=this.zoomLevels.VENUE.k,i=null,r=this._self.data.getBlocks().length;t>=e?i=xt.SEAT:t>=n?i=xt.BLOCK:t>=o&&r>1&&(i=xt.VENUE),i!==this.zoomLevel&&(this.zoomLevel=i,this.dispatchZoomEvent())},t.prototype.canvasScopeHandler=function(){if(!1!==this._self.config.canvas_stageout_control){var t=this._self.svg.stage.blocks.node.node().getBoundingClientRect(),e=this._self.svg.node.node().getBoundingClientRect();(this.zoomLevel===xt.VENUE||this.zoomLevel===xt.BLOCK&&1===this._self.data.getBlocks().length||this.zoomLevel==xt.SEAT&&this.zoomLevels.BLOCK&&this.zoomLevels.BLOCK.k===this._self.config.max_zoom)&&(t.left<e.left||t.top<e.top||t.right>e.right||t.bottom>e.bottom)&&this.zoomToVenue(!0,!0)}},t.prototype.calculateZoomLevels=function(t){void 0===t&&(t=this._self.data.getBlocks()),console.info("calculateZoomLevels");var e=this._self.windowManager,n=e.stage;t.map((function(t){t.seats.map((function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)})),t.labels.map((function(e){e.x<t.x&&(t.x=e.x),e.y<t.y&&(t.y=e.y),e.x>n.width&&(n.width=e.x),e.y>n.height&&(n.height=e.y)}))})),e.width&&e.height&&(this.scale.x=e.width/n.width-e.width/n.width/5,this.scale.y=e.height/n.height-e.height/n.height/5),this.scale.k=this.scale.x<this.scale.y?this.scale.x:this.scale.y,this.minZoom=this.scale.k<1?this.scale.k:1,this.scale.k=this.scale.k>this._self.config.max_zoom?this._self.config.max_zoom:this.scale.k;var o=n.width/2,i=n.height/2;return this.zoomLevels.VENUE={x:o,y:i,k:this.scale.k-.1},1===this._self.data.getBlocks().length&&this.zoomLevels.BLOCK&&(this.zoomLevels.VENUE=this.zoomLevels.BLOCK),this},t.prototype.calculateActiveBlocks=function(t){var e=this;if(void 0===t&&(t=this._self.data.getBlocks()),this.activeBlocks=[],t.map((function(t){var n=e._self.svg.stage.blocks.getBlock(t.id);if(n){var o=n.node.node().getBoundingClientRect(),i=n.node.node().getBBox();if(t.bbox=i,e._self.windowManager.width&&e._self.windowManager.height){var r=e._self.windowManager.width/i.width-e._self.windowManager.width/i.width/3,s=e._self.windowManager.height/i.height-e._self.windowManager.height/i.height/3,a=r<s?r:s;r+=i.x+i.width/2,s+=i.y+i.height/2,a=a>e._self.config.max_zoom?e._self.config.max_zoom:a,t.zoom_bbox={x:r,y:s,k:a};var l=Math.max(0,Math.min(e._self.windowManager.width,o.right)-Math.max(0,o.left))*Math.max(0,Math.min(e._self.windowManager.height,o.bottom)-Math.max(0,o.top)),u=100*l/(e._self.windowManager.width*e._self.windowManager.height);l>0&&e.activeBlocks.push({block:n,ratio:Number(u.toFixed(2))})}}})),this.activeBlocks=this.activeBlocks.sort((function(t,e){return e.ratio-t.ratio})),this.activeBlocks.length){var n=this.activeBlocks[0].block.item;this.zoomLevels.BLOCK=n.zoom_bbox}return this.activeBlocks},t.prototype.zoomToSelection=function(t){void 0===t&&(t=!0);var e=dt(this._self.svg.stage.blocks.node.node()),n=e[0],o=e[1],i=this._self.config.max_zoom;this.zoomLevels.SEAT={x:n,y:o,k:i},t?this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,o).call(this.zoomTypes.animated.scaleTo,i):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,o).call(this.zoomTypes.normal.scaleTo,i),this.zoomLevel=xt.SEAT,this.dispatchZoomEvent()},t.prototype.zoomToBlock=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=!1);var o=this._self.data.getBlocks().find((function(e){return e.id.toString()===t.toString()}));o&&(e?n?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,o.zoom_bbox.x,o.zoom_bbox.y).call(this.zoomTypes.fastAnimated.scaleTo,o.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,o.zoom_bbox.x,o.zoom_bbox.y).call(this.zoomTypes.animated.scaleTo,o.zoom_bbox.k):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,o.zoom_bbox.x,o.zoom_bbox.y).call(this.zoomTypes.normal.scaleTo,o.zoom_bbox.k),o.zoom_bbox.k===this._self.config.max_zoom?this.zoomLevel=xt.SEAT:this.zoomLevel=xt.BLOCK,this.dispatchZoomEvent())},t.prototype.zoomToVenue=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1),console.info("zoomToVenue");var n=this.zoomLevels.VENUE.x,o=this.zoomLevels.VENUE.y,i=this.zoomLevels.VENUE.k;if(this._self.config.min_zoom=i,this.zoomInit(),1!==this._self.data.getBlocks().length)n&&o&&i&&(t?e?this._self.svg.node.interrupt().call(this.zoomTypes.fastAnimated.translateTo,n,o).call(this.zoomTypes.fastAnimated.scaleTo,i):this._self.svg.node.interrupt().call(this.zoomTypes.animated.translateTo,n,o).call(this.zoomTypes.animated.scaleTo,i):this._self.svg.node.interrupt().call(this.zoomTypes.normal.translateTo,n,o).call(this.zoomTypes.normal.scaleTo,i),this.zoomLevel=xt.VENUE,this.dispatchZoomEvent());else{var r=this._self.data.getBlocks()[0];this.zoomToBlock(r.id,t,e)}},t.prototype.zoomEnable=function(){return this._self.svg.node.call(this.zoomTypes.normal),this},t.prototype.zoomDisable=function(){return this._self.svg.node.on(".zoom",null),this},t.prototype.getZoomLevelValues=function(t){return this.zoomLevels[t]},t.prototype.getActiveZoom=function(){return this.zoomLevels[this.zoomLevel]},t.prototype.dispatchZoomEvent=function(){this._self.eventManager.dispatch(kt.ZOOM_LEVEL_CHANGE,{level:this.zoomLevel,values:this.getZoomLevelValues(this.zoomLevel)})},t}(),Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});var qo=Yo.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length},Xo=function(){function t(t){this._self=t,this.events=[]}return t.prototype.addEventListener=function(t,e){if(qo(t))for(var n=0;n<t.length;n++)this.events.push({type:t[n],fn:e});else this.events.push({type:t,fn:e});return this},t.prototype.dispatch=function(t,e){return this.events.filter((function(e){return e.type===t})).map((function(t){return t.fn(e)})),this},t}(),Wo=function(){function t(t){var e=this;this.parent=t,this.width=null,this.height=null,this.stage={width:null,height:null},ct(window).on("resize.svg",(function(){e.resizeHandler()}))}return t.prototype.resizeHandler=function(){var t=ct(this.parent.container_selector).node().getBoundingClientRect();return this.width=t.width,this.height=t.height,this.parent.svg.node.attr("width",t.width),this.parent.svg.node.attr("height",t.height),this.parent.global.eventManager.dispatch(kt.RESIZE_WINDOW,t),this},t}(),Fo=function(t,e){void 0===e&&(e={});var n=this;this.container_selector=t,this.node=null;var o=this;this.config=new be(e),this.eventManager=new Xo(this),this.addEventListener=this.eventManager.addEventListener,this.node=ct(t),this.windowManager=new Wo(this),this.zoomManager=new Ho(this),this.data=new ve(this),this.global={eventManager:this.eventManager,windowManager:this.windowManager,config:this.config,data:this.data,zoomManager:this.zoomManager,root:this,svg:this.svg,multi_select:!1,best_available:!1},ct(window).on("keydown.dispatch",(function(t,e,n){o.eventManager.dispatch(kt.KEYDOWN_SVG,Q)})),ct(window).on("keyup.dispatch",(function(t,e,n){o.eventManager.dispatch(kt.KEYUP_SVG,Q)})),this.dev=new ye(this),this.svg=new me(this),this.svg.domGenerate(this.node),this.svg.update(),this.windowManager.resizeHandler(),this.zoomManager.init(),this.eventManager.addEventListener(kt.CLICK_ZOOM_OUT,(function(){return n.zoomManager.zoomToVenue()})),this.eventManager.addEventListener(kt.MULTI_SELECT_ENABLE,(function(){n.global.multi_select=!0,n.node.classed("multi-select-enable",!0)})),this.eventManager.addEventListener(kt.MULTI_SELECT_DISABLE,(function(){n.global.multi_select=!1,n.node.classed("multi-select-enable",!1)})),this.eventManager.addEventListener(kt.BEST_AVAILABLE_ENABLE,(function(){n.global.best_available=!0})),this.eventManager.addEventListener(kt.MBEST_AVAILABLE_DISABLE,(function(){n.global.best_available=!1})),this.eventManager.addEventListener(kt.ZOOM_LEVEL_CHANGE,(function(t){t.level===xt.VENUE||t.level===xt.BLOCK?ct(n.config.zoom_out_button).style("display","none"):t.level===xt.SEAT&&ct(n.config.zoom_out_button).style("display","block")})),ct(this.config.zoom_out_button).on("click",(function(){n.zoomManager.zoomToVenue(!0)})),this.eventManager.addEventListener(kt.ADD_BLOCK,(function(t){n.svg.stage.blocks.update(),n.windowManager.resizeHandler(),n.zoomManager.calculateZoomLevels(n.data.getBlocks()),n.zoomManager.calculateActiveBlocks(n.data.getBlocks()),n.windowManager.resizeHandler(),n.zoomManager.zoomToVenue(!1)})),this.eventManager.dispatch(kt.READY,this)};window.SeatMapCanvas=Fo,t.SeatMapCanvas=Fo}({});
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,171 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Required meta tags -->
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
+
8
+ <!-- Bootstrap CSS -->
9
+ <link rel="stylesheet" href="/cjs/index.css" crossorigin="anonymous">
10
+ <script src="https://cdn.tailwindcss.com"></script>
11
+ <script defer type="text/javascript" src="/cjs/index.js"></script>
12
+ <link href="https://use.fontawesome.com/releases/v6.4.2/css/all.css" rel="stylesheet"/>
13
+ <script>
14
+ tailwind.config = {
15
+ theme: {
16
+ darkMode: 'class',
17
+ }
18
+ }
19
+ </script>
20
+ <title>Seatmap Demo</title>
21
+ </head>
22
+ <body>
23
+
24
+ <div class="absolute flex flex-col w-screen h-screen">
25
+ <div class="flex gap-3 p-1.5 bg-gray-300">
26
+ <button class="border bg-white py-1.5 px-3 rounded-lg hover:bg-gray-100" id="zoomout-button">
27
+ <i class="fa-solid fa-magnifying-glass-minus"></i>
28
+ All Blocks
29
+ </button>
30
+ <button class="border bg-white py-1.5 px-3 rounded-lg hover:bg-gray-100" id="get-selected-seats">
31
+ <i class="fa-solid fa-code"></i>
32
+ Get Selected Seat(s) Json
33
+ </button>
34
+ <button class="border bg-white py-1.5 px-3 rounded-lg hover:bg-gray-100 zoom-to-block" data-block-id="block-0">
35
+ <i class="fa-solid fa-magnifying-glass-plus"></i>
36
+ Zoom Block 1
37
+ </button>
38
+ <button class="border bg-white py-1.5 px-3 rounded-lg hover:bg-gray-100 zoom-to-block" data-block-id="block-1">
39
+ <i class="fa-solid fa-magnifying-glass-plus"></i>
40
+ Zoom Block 2
41
+ </button>
42
+ <button class="border bg-white py-1.5 px-3 rounded-lg hover:bg-gray-100 zoom-to-block" data-block-id="block-2">
43
+ <i class="fa-solid fa-magnifying-glass-plus"></i>
44
+ Zoom Block 3
45
+ </button>
46
+ </div>
47
+ <div id="seats_container" class="w-full flex-1 h-full bg-gradient-to-r from-slate-900 to-slate-700"></div>
48
+ </div>
49
+
50
+
51
+ <script src="https://code.jquery.com/jquery-3.7.1.min.js"
52
+ integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
53
+
54
+ <script type="text/javascript">
55
+ $(document).ready(function () {
56
+
57
+ let seatmap = new SeatMapCanvas("#seats_container", {
58
+ seat_style: {
59
+ hover: '#8fe100',
60
+ color: '#f0f7fa',
61
+ selected: '#8fe100',
62
+ check_icon_color: '#fff',
63
+ not_salable: '#10546b',
64
+ focus: '#8fe100',
65
+ },
66
+ legend_style:{
67
+ font_color: '#fff'
68
+ },
69
+ block_style: {
70
+ title_color: '#fff'
71
+ }
72
+ });
73
+ seatmap.eventManager.addEventListener("SEAT.CLICK", (seat) => {
74
+ console.log("seat", seat)
75
+ if (!seat.isSelected() && seat.item.salable === true) {
76
+ seat.select()
77
+ } else {
78
+ seat.unSelect()
79
+ }
80
+
81
+ });
82
+
83
+ $("#zoomout-button").on("click", function () {
84
+ seatmap.zoomManager.zoomToVenue();
85
+ });
86
+
87
+ $(".zoom-to-block").on("click", function (a) {
88
+ let blockId = $(this).attr('data-block-id');
89
+ console.log('blockId', blockId)
90
+ seatmap.zoomManager.zoomToBlock(blockId);
91
+ });
92
+ $("#get-selected-seats").on("click", function (a) {
93
+
94
+ let selectedSeats = seatmap.data.getSelectedSeats();
95
+ console.log(selectedSeats)
96
+ });
97
+
98
+ $("#unselect-seat").on("click", function (a) {
99
+ let seatId = $(this).attr('seat-id');
100
+ let blockId = $(this).attr('block-id');
101
+ let seat = seatmap.data.getSeat(seatId, blockId);
102
+ seat.svg.unSelect()
103
+ });
104
+
105
+
106
+ let block_colors = ["#10546b", "#10546b", "#10546b", "#10546b"];
107
+
108
+
109
+ let blocks = []
110
+ let last_x = 0;
111
+ for (let j = 0; j < 4; j++) { // blocks
112
+
113
+ let color = block_colors[j];
114
+ console.log(color)
115
+
116
+ let seats = []
117
+ let cell_count = 0;
118
+ let row_count = 0;
119
+ let block_final_x = 0;
120
+ let randomSeatCount = Math.round((Math.random() * (Math.abs(200 - 40))) + 40)
121
+
122
+ for (let k = 0; k < 96; k++) { // row
123
+
124
+ if (k % 12 === 0) {
125
+ cell_count = 1;
126
+ row_count++;
127
+ }
128
+
129
+ let x = (cell_count * 33) + last_x;
130
+ let y = row_count * 30;
131
+
132
+ console.log(x)
133
+
134
+ if (block_final_x < x) block_final_x = x;
135
+
136
+
137
+ let seat = {
138
+ id: `s-${k}`,
139
+ x: x,
140
+ y: y,
141
+ color: color, // can use item.color from json data
142
+ salable: Math.ceil(Math.random() * 10) > 3,
143
+ custom_data: {any: "things"},
144
+ note: "note test",
145
+ tags: {},
146
+ title: `Title ${cell_count} ${row_count}`
147
+ }
148
+ cell_count++;
149
+ seats.push(seat)
150
+ }
151
+
152
+ last_x = block_final_x + 100;
153
+
154
+ let block = {
155
+ "id": `block-${j}`,
156
+ "title": `Block - ${j + 1}`,
157
+ "labels": [],
158
+ "color": color,
159
+ "seats": seats
160
+ };
161
+
162
+ blocks.push(block);
163
+ }
164
+
165
+ seatmap.data.addBulkBlock(blocks);
166
+
167
+
168
+ });
169
+ </script>
170
+ </body>
171
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisaitteke/seatmap-canvas",
3
- "version": "2.0.3",
3
+ "version": "2.3.0",
4
4
  "tags": "seating, seat, seatmap, seat-selection, seat-booking, booking, ticket, reservation",
5
5
  "author": "Ali Sait TEKE <alisaitt@gmail.com>",
6
6
  "homepage": "https://github.com/alisaitteke/seatmap-canvas",
@@ -15,18 +15,22 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "scripts": {
18
- "test": "echo \"Error: no test specified\" && exit 1",
19
- "start": "webpack-dev-server --config ./webpack.environments/development.js",
20
- "build": "webpack --progress --config ./webpack.environments/production.js"
18
+ "start": "rollup --config --watch --bundleConfigAsCjs",
19
+ "build": "rollup -c --prod --bundleConfigAsCjs"
21
20
  },
22
21
  "engines": {
23
- "node": ">=4.0.0"
22
+ "node": ">=18.0.0"
24
23
  },
25
24
  "license": "MIT",
26
- "main": "dist/seatmap.canvas.2.0.1-0.js",
25
+ "main": "dist/cjs/index.js",
26
+ "module": "dist/esm/index.js",
27
+ "types": "dist/index.d.ts",
27
28
  "devDependencies": {
29
+ "@rollup/plugin-commonjs": "^25.0.7",
30
+ "@rollup/plugin-node-resolve": "^15.2.3",
31
+ "@rollup/plugin-typescript": "^11.1.5",
28
32
  "@types/d3": "^5.0.0",
29
- "@types/node": "^18.6.3",
33
+ "@types/node": "^16.6.3",
30
34
  "css-loader": "6.7.1",
31
35
  "d3": "^5.7.0",
32
36
  "file-loader": "^6.2.0",
@@ -34,17 +38,20 @@
34
38
  "node-sass": "9.0.0",
35
39
  "postcss-loader": "^7.0.1",
36
40
  "reflect-metadata": "^0.1.12",
41
+ "rollup": "^4.9.1",
42
+ "rollup-plugin-dts": "^6.1.0",
43
+ "rollup-plugin-livereload": "^2.0.5",
44
+ "rollup-plugin-peer-deps-external": "^2.2.4",
45
+ "rollup-plugin-scss": "3",
46
+ "rollup-plugin-serve": "^1.1.1",
47
+ "rollup-plugin-terser": "^7.0.2",
37
48
  "rxjs": "^6.3.3",
38
49
  "sass": "^1.54.0",
39
50
  "sass-loader": "^13.0.2",
40
51
  "style-loader": "^3.3.1",
41
52
  "ts-loader": "^9.3.1",
42
53
  "ts-node": "^10.9.1",
43
- "typescript": "^4.7.4",
44
- "webpack": "^5.74.0",
45
- "webpack-cli": "^4.10.0",
46
- "webpack-dev-server": "^4.9.3",
47
- "webpack-merge": "^5.8.0"
54
+ "typescript": "^4.7.4"
48
55
  },
49
56
  "dependencies": {},
50
57
  "directories": {
@@ -0,0 +1,56 @@
1
+ import resolve from "@rollup/plugin-node-resolve";
2
+ import commonjs from "@rollup/plugin-commonjs";
3
+ import typescript from "@rollup/plugin-typescript";
4
+ import dts from "rollup-plugin-dts";
5
+ import {terser} from "rollup-plugin-terser";
6
+ import peerDepsExternal from "rollup-plugin-peer-deps-external";
7
+ import serve from 'rollup-plugin-serve'
8
+ import scss from 'rollup-plugin-scss'
9
+ import livereload from 'rollup-plugin-livereload'
10
+
11
+ const packageJson = require("./package.json");
12
+
13
+ export default commandLineArgs => {
14
+ console.log('cmd', commandLineArgs)
15
+ let config = [
16
+ {
17
+ input: "src/lib/canvas.index.ts",
18
+ output: [
19
+ {
20
+ file: packageJson.main,
21
+ format: "iife",
22
+ sourcemap: true,
23
+ },
24
+ {
25
+ file: packageJson.module,
26
+ format: "esm",
27
+ sourcemap: true,
28
+ },
29
+ ],
30
+ plugins: [
31
+ scss(),
32
+ peerDepsExternal(),
33
+ resolve(),
34
+ commonjs(),
35
+ typescript({tsconfig: "./tsconfig.json"}),
36
+ terser()
37
+ ],
38
+ external: [],
39
+ },
40
+ {
41
+ input: "src/lib/canvas.index.ts",
42
+ output: [{file: "dist/types.d.ts", format: "es"}],
43
+ plugins: [scss(), dts.default()],
44
+ },
45
+ ];
46
+ console.log('commandLineArgs.prod', commandLineArgs.prod)
47
+ if (!commandLineArgs.prod) {
48
+ config[0].plugins.push(livereload())
49
+ config[0].plugins.push(serve({
50
+ openPage: '/index.html',
51
+ contentBase: ['dist', 'examples', 'src'],
52
+ port: 3002,
53
+ }))
54
+ }
55
+ return config;
56
+ }
@@ -1,9 +1,8 @@
1
1
  /*
2
2
  * index.ts
3
- * https://github.com/seatmap/canvas Copyright 2018 Ali Sait TEKE
3
+ * https://github.com/alisaitteke/seatmap-canvas Copyright 2023 Ali Sait TEKE
4
4
  */
5
5
  import "../scss/style.scss";
6
-
7
6
  import {select as d3Select,event as d3Event} from 'd3-selection'
8
7
  import Svg from "./svg/svg.index";
9
8
  import SeatMapDevTools from "./dev.tools";
@@ -71,7 +70,7 @@ export class SeatMapCanvas {
71
70
  this.windowManager.resizeHandler();
72
71
  this.zoomManager.init();
73
72
 
74
- this.eventManager.addEventListener(EventType.CLICK_ZOOMOUT, () => this.zoomManager.zoomToVenue());
73
+ this.eventManager.addEventListener(EventType.CLICK_ZOOM_OUT, () => this.zoomManager.zoomToVenue());
75
74
  this.eventManager.addEventListener(EventType.MULTI_SELECT_ENABLE, () => {
76
75
  this.global.multi_select = true;
77
76
  this.node.classed("multi-select-enable", true);