Back to Codebase

Vulnerability Analysis Report

Magento Luma Default Theme v2.3.3-p1

Scan ID: SCAN-MAGENTO-LUMA-bQvK7c • Hash: 49e75662

Severity Score
Critical
Total Findings
100
Engine Version
ECOMGUARD-HYBRID-AST-1.5
Scan Duration
0.798s

Vulnerability Details

L30

Dynamic Code Execution in AssertArrayContains.php

CWE-94
File Location: dev/tests/api-functional/framework/Magento/TestFramework/Assert/AssertArrayContains.php:30
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- self::assert($value, $actual[$key]);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L42

Dynamic Code Execution in AssertOrderInOrdersGrid.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php:42
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert(OrderInjectable $order, OrderIndex $orderIndex, $status, $orderId = '')
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L21

Dynamic Code Execution in AssertCartPriceRuleFreeShippingIsApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php:21
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L71

Dynamic Code Execution in AssertShipmentItems.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php:71
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert(
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L21

Dynamic Code Execution in AssertTaxWithCrossBorderNotApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php:21
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert($actualPrices)
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L55

Dynamic Code Execution in BundleProductsAssert.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/BundleProductsAssert.php:55
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L54

Dynamic Code Execution in ConfigurableProductsAssert.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/ConfigurableProductsAssert.php:54
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L76

Dynamic Code Execution in ImagesAssert.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/ImagesAssert.php:76
Security Score:
98 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L59

Dynamic Code Execution in AssertShipmentItems.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php:59
Security Score:
97 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assert($order, $ids, $orderShipmentView, $data);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L57

Dynamic Code Execution in AbstractAssertTaxWithCrossBorderApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php:57
Security Score:
97 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- abstract protected function assert($actualPrices);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L71

Dynamic Code Execution in AssertTaxRuleApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php:71
Security Score:
97 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- abstract protected function assert();
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L50

Dynamic Code Execution in SimpleProductsAssert.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixturesAsserts/SimpleProductsAssert.php:50
Security Score:
97 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L21

Dynamic Code Execution in AssertArrayContains.php

CWE-94
File Location: dev/tests/api-functional/framework/Magento/TestFramework/Assert/AssertArrayContains.php:21
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public static function assert(array $expected, array $actual)
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L30

Dynamic Code Execution in AssertOrderInOrdersGrid.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php:30
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assert($order, $orderIndex, $status, $orderId);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L103

Dynamic Code Execution in AssertCartPriceRuleApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleApplying.php:103
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- abstract protected function assert();
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L193

Dynamic Code Execution in AssertCartPriceRuleApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleApplying.php:193
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assert();
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L19

Dynamic Code Execution in AssertCartPriceRuleConditionIsApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php:19
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L19

Dynamic Code Execution in AssertCartPriceRuleConditionIsNotApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php:19
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L141

Dynamic Code Execution in AssertTaxRuleApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php:141
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assert();
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L21

Dynamic Code Execution in AssertTaxWithCrossBorderApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php:21
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- public function assert($actualPrices)
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L141

Dynamic Code Execution in MassActionTest.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Cache/MassActionTest.php:141
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $configData = eval(str_replace('<?php', '', file_get_contents($configPath)));
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L469

Dynamic Code Execution in Filesystem.php

CWE-94
File Location: lib/internal/Magento/Framework/Data/Collection/Filesystem.php:469
Security Score:
96 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- eval('$result = ' . $this->_filterEvalRendered . ';');
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L36

Dynamic Code Execution in AssertOrdersInOrdersGrid.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php:36
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $assertOrderInOrdersGrid->assert($order, $orderIndex, $orderStatuses[$key]);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L84

Dynamic Code Execution in AbstractAssertTaxWithCrossBorderApplying.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php:84
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assert($actualPrices);
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L19

Dynamic Code Execution in AssertTaxRuleIsApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php:19
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L19

Dynamic Code Execution in AssertTaxRuleIsNotApplied.php

CWE-94
File Location: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php:19
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- protected function assert()
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L121

Dynamic Code Execution in FixtureModelTest.php

CWE-94
File Location: dev/tests/integration/testsuite/Magento/Setup/Fixtures/FixtureModelTest.php:121
Security Score:
95 / 100
Confirmed Issue

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. High Severity (Confirmed via full AST flow control tracing). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $this->assertTrue($entityAssert->assert());
+ // Avoid dynamic function/code evaluation. Rewrite with native callbacks.
L91

Insecure DOM Manipulation (XSS) in swagger-ui-bundle.min.js

CWE-79
File Location: app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js:91
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- function n(e){if("string"!=typeof e)throw new TypeError("expected a string.");return e=e.replace(/([A-Z])/g," $1"),1===e.length?e.toUpperCase():(e=e.replace(/^[\W_]+|[\W_]+$/g,"").toLowerCase(),e=e.charAt(0).toUpperCase()+e.slice(1),e.replace(/[\W_]+(\w|$)/g,function(e,t){return t.toUpperCase()}))}e.exports=n},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n(442),s=i(a),u=n(230),l=i(u),c=function(){function e(t,n,r){o(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r}return e.prototype.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},e.prototype.previous=function(){var e=this;return this.previousMaps||(this.previousMaps=[],this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;-1===e.previousMaps.indexOf(n)&&e.previousMaps.push(n)}})),this.previousMaps},e.prototype.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},e.prototype.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},e.prototype.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)for(var e=void 0,t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)},e.prototype.setSourcesContent=function(){var e=this,t={};this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.relative(r);e.map.setSourceContent(i,n.source.input.css)}}})},e.prototype.applyPrevMaps=function(){for(var e=this.previous(),t=Array.isArray(e),n=0,e=t?e:e[Symbol.iterator]();;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}var i=r,o=this.relative(i.file),a=i.root||l.default.dirname(i.file),u=void 0;!1===this.mapOpts.sourcesContent?(u=new s.default.SourceMapConsumer(i.text),u.sourcesContent&&(u.sourcesContent=u.sourcesContent.map(function(){return null}))):u=i.consumer(),this.map.applySourceMap(u,o,this.relative(a))}},e.prototype.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},e.prototype.toBase64=function(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e).toString("base64"):new r(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},e.prototype.addAnnotation=function(){var e=void 0;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:this.outputFile()+".map";var t="\n";-1!==this.css.indexOf("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},e.prototype.outputFile=function(){return this.opts.to?this.relative(this.opts.to):this.opts.from?this.relative(this.opts.from):"to.css"},e.prototype.generateMap=function(){return this.generateString(),this.isSourcesContent()&&this.setSourcesContent(),this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},e.prototype.relative=function(e){if(0===e.indexOf("<"))return e;if(/^\w+:\/\//.test(e))return e;var t=this.opts.to?l.default.dirname(this.opts.to):".";return"string"==typeof this.mapOpts.annotation&&(t=l.default.dirname(l.default.resolve(t,this.mapOpts.annotation))),e=l.default.relative(t,e),"\\"===l.default.sep?e.replace(/\\/g,"/"):e},e.prototype.sourcePath=function(e){return this.mapOpts.from?this.mapOpts.from:this.relative(e.source.input.from)},e.prototype.generateString=function(){var e=this;this.css="",this.map=new s.default.SourceMapGenerator({file:this.outputFile()});var t=1,n=1,r=void 0,i=void 0;this.stringify(this.root,function(o,a,s){e.css+=o,a&&"end"!==s&&(a.source&&a.source.start?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.start.line,column:a.source.start.column-1}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}})),r=o.match(/\n/g),r?(t+=r.length,i=o.lastIndexOf("\n"),n=o.length-i):n+=o.length,a&&"start"!==s&&(a.source&&a.source.end?e.map.addMapping({source:e.sourcePath(a),generated:{line:t,column:n-1},original:{line:a.source.end.line,column:a.source.end.column}}):e.map.addMapping({source:"<no source>",original:{line:1,column:0},generated:{line:t,column:n-1}}))})},e.prototype.generate=function(){if(this.clearAnnotation(),this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},e}();t.default=c,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=n(234),a=r(o),s=n(438),u=r(s),l=n(232),c=r(l),p=n(156),f=r(p),h=n(237),d=r(h),m=n(157),v=r(m),g=function(){function e(t){i(this,e),this.input=t,this.root=new d.default,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{line:1,column:1}}}return e.prototype.createTokenizer=function(){this.tokenizer=(0,u.default)(this.input)},e.prototype.parse=function(){for(var e=void 0;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},e.prototype.comment=function(e){var t=new c.default;this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]};var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},e.prototype.emptyRule=function(e){var t=new v.default;this.init(t,e[2],e[3]),t.selector="",t.raws.between="",this.current=t},e.prototype.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],a=[],s=e;s;){if(n=s[0],a.push(s),"("===n||"["===n)i||(i=s),o.push("("===n?")":"]");else if(0===o.length){if(";"===n){if(r)return void this.decl(a);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));s=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){for(;a.length&&("space"===(s=a[a.length-1][0])||"comment"===s);)this.tokenizer.back(a.pop());return void this.decl(a)}this.unknownWord(a)},e.prototype.rule=function(e){e.pop();var t=new v.default;this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},e.prototype.decl=function(e){var t=new a.default;this.init(t);var n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),n[4]?t.source.end={line:n[4],column:n[5]}:t.source.end={line:n[2],column:n[3]};"word"!==e[0][0];)1===e.length&&this.unknownWord(e),t.raws.before+=e.shift()[1];for(t.source.start={line:e[0][2],column:e[0][3]},t.prop="";e.length;){var r=e[0][0];if(":"===r||"space"===r||"comment"===r)break;t.prop+=e.shift()[1]}t.raws.between="";for(var i=void 0;e.length;){if(i=e.shift(),":"===i[0]){t.raws.between+=i[1];break}t.raws.between+=i[1]}"_"!==t.prop[0]&&"*"!==t.prop[0]||(t.raws.before+=t.prop[0],t.prop=t.prop.slice(1)),t.raws.between+=this.spacesAndCommentsFromStart(e),this.precheckMissedSemicolon(e);for(var o=e.length-1;o>0;o--){if(i=e[o],"!important"===i[1].toLowerCase()){t.important=!0;var s=this.stringFrom(e,o);s=this.spacesFromEnd(e)+s," !important"!==s&&(t.raws.important=s);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),l="",c=o;c>0;c--){var p=u[c][0];if(0===l.trim().indexOf("!")&&"space"!==p)break;l=u.pop()[1]+l}0===l.trim().indexOf("!")&&(t.important=!0,t.raws.important=l,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}this.raw(t,"value",e),-1!==t.value.indexOf(":")&&this.checkMissedSemicolon(e)},e.prototype.atrule=function(e){var t=new f.default;t.name=e[1].slice(1),""===t.name&&this.unnamedAtrule(t,e),this.init(t,e[2],e[3]);for(var n=void 0,r=void 0,i=!1,o=!1,a=[];!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),";"===e[0]){t.source.end={line:e[2],column:e[3]},this.semicolon=!0;break}if("{"===e[0]){o=!0;break}if("}"===e[0]){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(t.source.end={line:n[4],column:n[5]})}this.end(e);break}if(a.push(e),this.tokenizer.endOfFile()){i=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),i&&(e=a[a.length-1],t.source.end={line:e[4],column:e[5]},this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),o&&(t.nodes=[],this.current=t)},e.prototype.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end={line:e[2],column:e[3]},this.current=this.current.parent):this.unexpectedClose(e)},e.prototype.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces},e.prototype.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},e.prototype.init=function(e,t,n){this.current.push(e),e.source={start:{line:t,column:n},input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},e.prototype.raw=function(e,t,n){for(var r=void 0,i=void 0,o=n.length,a="",s=!0,u=0;u<o;u+=1)r=n[u],i=r[0],"comment"===i||"space"===i&&u===o-1?s=!1:a+=r[1];if(!s){var l=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={value:a,raw:l}}e[t]=a},e.prototype.spacesAndCommentsFromEnd=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},e.prototype.spacesAndCommentsFromStart=function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},e.prototype.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},e.prototype.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},e.prototype.colon=function(e){for(var t=0,n=void 0,r=void 0,i=void 0,o=0;o<e.length;o++){if(n=e[o],"("===(r=n[0]))t+=1;else if(")"===r)t-=1;else if(0===t&&":"===r){if(i){if("word"===i[0]&&"progid"===i[1])continue;return o}this.doubleColon(n)}i=n}return!1},e.prototype.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",e[2],e[3])},e.prototype.unknownWord=function(e){throw this.input.error("Unknown word",e[0][2],e[0][3])},e.prototype.unexpectedClose=function(e){throw this.input.error("Unexpected }",e[2],e[3])},e.prototype.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},e.prototype.doubleColon=function(e){throw this.input.error("Double colon",e[2],e[3])},e.prototype.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",t[2],t[3])},e.prototype.precheckMissedSemicolon=function(e){},e.prototype.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n=0,r=void 0,i=t-1;i>=0&&(r=e[i],"space"===r[0]||2!==(n+=1));i--);throw this.input.error("Missed semicolon",r[2],r[3])}},e}();t.default=g,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new u.default(t)}t.__esModule=!0;var o=n(234),a=r(o),s=n(436),u=r(s),l=n(238),c=r(l),p=n(232),f=r(p),h=n(156),d=r(h),m=n(986),v=r(m),g=n(236),y=r(g),_=n(435),b=r(_),x=n(157),w=r(x),k=n(237),E=r(k);i.plugin=function(e,t){var n=function(){var n=t.apply(void 0,arguments);return n.postcssPlugin=e,n.postcssVersion=(new u.default).version,n},r=void 0;return Object.defineProperty(n,"postcss",{get:function(){return r||(r=n()),r}}),n.process=function(e,t,r){return i([n(r)]).process(e,t)},n},i.stringify=c.default,i.parse=y.default,i.vendor=v.default,i.list=b.default,i.comment=function(e){return new f.default(e)},i.atRule=function(e){return new d.default(e)},i.decl=function(e){return new a.default(e)},i.rule=function(e){return new w.default(e)},i.root=function(e){return new E.default(e)},t.default=i,e.exports=t.default},function(e,t,n){"use strict";(function(r){function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return r?r.from&&r.from!==Uint8Array.from?r.from(e,"base64").toString():new r(e,"base64").toString():window.atob(e)}t.__esModule=!0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u=n(442),l=i(u),c=n(230),p=i(c),f=n(1210),h=i(f),d=function(){function e(t,n){o(this,e),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");var r=n.map?n.map.prev:void 0,i=this.loadMap(n.from,r);i&&(this.text=i)}return e.prototype.consumer=function(){return this.consumerCache||(this.consumerCache=new l.default.SourceMapConsumer(this.text)),this.consumerCache},e.prototype.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e.prototype.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},e.prototype.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);t&&(this.annotation=t[1].trim())},e.prototype.decodeInline=function(e){var t=/^data:application\/json;(?:charset=utf-?8;)?base64,/,n="data:application/json,";if(this.startWith(e,n))return decodeURIComponent(e.substr(n.length));if(t.test(e))return a(e.substr(RegExp.lastMatch.length));var r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)},e.prototype.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"==typeof t){var n=t(e);if(n&&h.default.existsSync&&h.default.existsSync(n))return h.default.readFileSync(n,"utf-8").toString().trim();throw new Error("Unable to load previous source map: "+n.toString())}if(t instanceof l.default.SourceMapConsumer)return l.default.SourceMapGenerator.fromSourceMap(t).toString();if(t instanceof l.default.SourceMapGenerator)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=p.default.join(p.default.dirname(e),r)),this.root=p.default.dirname(r),!(!h.default.existsSync||!h.default.existsSync(r))&&h.default.readFileSync(r,"utf-8").toString().trim()}},e.prototype.isMap=function(e){return"object"===(void 0===e?"undefined":s(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings)},e}();t.default=d,e.exports=t.default}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(988),a=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t,n,i){r(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=i,this.css=void 0,this.map=void 0}return e.prototype.toString=function(){return this.css},e.prototype.warn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new a.default(e,t);return this.messages.push(n),n},e.prototype.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},i(e,[{key:"content",get:function(){return this.css}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e[0],r=e[1];if("word"===n){if("."===r[0])return"class";if("#"===r[0])return"hash"}if(!t.endOfFile()){var i=t.nextToken();if(t.back(i),"brackets"===i[0]||"("===i[0])return"call"}return n}function o(e){for(var t=(0,l.default)(new p.default(e),{ignoreErrors:!0}),n="";!t.endOfFile();)!function(){var e=t.nextToken(),r=f[i(e,t)];n+=r?e[1].split(/\r?\n/).map(function(e){return r(e)}).join("\n"):e[1]}();return n}t.__esModule=!0;var a=n(503),s=r(a),u=n(438),l=r(u),c=n(433),p=r(c),f={brackets:s.default.cyan,"at-word":s.default.cyan,call:s.default.cyan,comment:s.default.gray,string:s.default.green,class:s.default.yellow,hash:s.default.magenta,"(":s.default.cyan,")":s.default.cyan,"{":s.default.yellow,"}":s.default.yellow,"[":s.default.yellow,"]":s.default.yellow,":":s.default.yellow,";":s.default.yellow};t.default=o,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r={prefix:function(e){var t=e.match(/^(-\w+-)/);return t?t[0]:""},unprefixed:function(e){return e.replace(/^-\w+-/,"")}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){i[e]||(i[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}t.__esModule=!0,t.default=r;var i={};e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,e),this.type="warning",this.text=t,n.node&&n.node.source){var i=n.node.positionBy(n);this.line=i.line,this.column=i.column}for(var o in n)this[o]=n[o]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}();t.default=i,e.exports=t.default},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},function(e,t){function n(e,r,i,o,a,s){var u=Math.floor((r-e)/2)+e,l=a(i,o[u],!0);return 0===l?u:l>0?r-u>1?n(u,r,i,o,a,s):s==t.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-e>1?n(e,u,i,o,a,s):s==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,i,o){if(0===r.length)return-1;var a=n(-1,r.length,e,r,i,o||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===i(r[a],r[a-1],!0);)--a;return a}},function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,a=t.generatedColumn;return r>n||r==n&&a>=i||o.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var o=n(121);i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(o.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i},function(e,t){function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,o,a){if(o<a){var s=r(o,a),u=o-1;n(e,s,a);for(var l=e[a],c=o;c<a;c++)t(e[c],l)<=0&&(u+=1,n(e,u,c));n(e,u+1,c);var p=u+1;i(e,t,o,p-1),i(e,t,p+1,a)}}t.quickSort=function(e,t){i(e,t,0,e.length-1)}},function(e,t,n){function r(e,t){var n=e;return"string"==typeof e&&(n=s.parseSourceMapInput(e)),null!=n.sections?new a(n,t):new i(n,t)}function i(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var r=s.getArg(n,"version"),i=s.getArg(n,"sources"),o=s.getArg(n,"names",[]),a=s.getArg(n,"sourceRoot",null),u=s.getArg(n,"sourcesContent",null),c=s.getArg(n,"mappings"),p=s.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);a&&(a=s.normalize(a)),i=i.map(String).map(s.normalize).map(function(e){return a&&s.isAbsolute(a)&&s.isAbsolute(e)?s.relative(a,e):e}),this._names=l.fromArray(o.map(String),!0),this._sources=l.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(e){return s.computeSourceURL(a,e,t)}),this.sourceRoot=a,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=t,this.file=p}function o(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function a(e,t){var n=e;"string"==typeof e&&(n=s.parseSourceMapInput(e));var i=s.getArg(n,"version"),o=s.getArg(n,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new l,this._names=new l;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=s.getArg(e,"offset"),i=s.getArg(n,"line"),o=s.getArg(n,"column");if(i<a.line||i===a.line&&o<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:i+1,generatedColumn:o+1},consumer:new r(s.getArg(e,"map"),t)}})}var s=n(121),u=n(990),l=n(439).ArraySet,c=n(440),p=n(992).quickSort;r.fromSourceMap=function(e,t){return i.fromSourceMap(e,t)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},r.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,t,n){var i,o=t||null,a=n||r.GENERATED_ORDER;switch(a){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var t=null===e.source?null:this._sources.at(e.source);return t=s.computeSourceURL(u,t,this._sourceMapURL),{source:t,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,o)},r.prototype.allGeneratedPositionsFor=function(e){var t=s.getArg(e,"line"),n={source:s.getArg(e,"source"),originalLine:t,originalColumn:s.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var o=this._originalMappings[i];if(void 0===e.column)for(var a=o.originalLine;o&&o.originalLine===a;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i];else for(var l=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==l;)r.push({line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i]}return r},t.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.prototype._findSourceIndex=function(e){var t=e;if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var n;for(n=0;n<this._absoluteSources.length;++n)if(this._absoluteSources[n]==e)return n;return-1},i.fromSourceMap=function(e,t){var n=Object.create(i.prototype),r=n._names=l.fromArray(e._names.toArray(),!0),a=n._sources=l.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(e){return s.computeSourceURL(n.sourceRoot,e,t)});for(var u=e._mappings.toArray().slice(),c=n.__generatedMappings=[],f=n.__originalMappings=[],h=0,d=u.length;h<d;h++){var m=u[h],v=new o;v.generatedLine=m.generatedLine,v.generatedColumn=m.generatedColumn,m.source&&(v.source=a.indexOf(m.source),v.originalLine=m.originalLine,v.originalColumn=m.originalColumn,m.name&&(v.name=r.indexOf(m.name)),f.push(v)),c.push(v)}return p(n.__originalMappings,s.compareByOriginalPositions),n},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),i.prototype._parseMappings=function(e,t){for(var n,r,i,a,u,l=1,f=0,h=0,d=0,m=0,v=0,g=e.length,y=0,_={},b={},x=[],w=[];y<g;)if(";"===e.charAt(y))l++,y++,f=0;else if(","===e.charAt(y))y++;else{for(n=new o,n.generatedLine=l,a=y;a<g&&!this._charIsMappingSeparator(e,a);a++);if(r=e.slice(y,a),i=_[r])y+=r.length;else{for(i=[];y<a;)c.decode(e,y,b),u=b.value,y=b.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");_[r]=i}n.generatedColumn=f+i[0],f=n.generatedColumn,i.length>1&&(n.source=m+i[1],m+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=v+i[4],v+=i[4])),w.push(n),"number"==typeof n.originalLine&&x.push(n)}p(w,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,p(x,s.compareByOriginalPositions),this.__originalMappings=x},i.prototype._findMapping=function(e,t,n,r,i,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,o)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var o=s.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),o=s.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var a=s.getArg(i,"name",null);return null!==a&&(a=this._names.at(a)),{source:o,line:s.getArg(i,"originalLine",null),column:s.getArg(i,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r=e;null!=this.sourceRoot&&(r=s.relative(this.sourceRoot,r));var i;if(null!=this.sourceRoot&&(i=s.urlParse(this.sourceRoot))){var o=r.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!i.path||"/"==i.path)&&this._sources.has("/"+r))return this.sourcesContent[this._sources.indexOf("/"+r)]}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===n.source)return{line:s.getArg(o,"generatedLine",null),column:s.getArg(o,"generatedColumn",null),lastColumn:s.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i,a.prototype=Object.create(r.prototype),a.prototype.constructor=r,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),a.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=u.search(t,this._sections,function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n||e.generatedColumn-t.generatedOffset.generatedColumn}),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},a.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},a.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n],i=r.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},a.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(s.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r){return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}}return{line:null,column:null}},a.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],i=r.consumer._generatedMappings,o=0;o<i.length;o++){var a=i[o],u=r.consumer._sources.at(a.source);u=s.computeSourceURL(r.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var l=null;a.name&&(l=r.consumer._names.at(a.name),this._names.add(l),l=this._names.indexOf(l));var c={source:u,generatedLine:a.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(r.generatedOffset.generatedLine===a.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:l};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}p(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),p(this.__originalMappings,s.compareByOriginalPositions)},t.IndexedSourceMapConsumer=a},function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[s]=!0,null!=r&&this.add(r)}var i=n(441).SourceMapGenerator,o=n(121),a=/(\r?\n)/,s="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)s.add(t);else{var i=n?o.join(n,e.source):e.source;s.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var s=new r,u=e.split(a),l=0,c=function(){function e(){return l<u.length?u[l++]:void 0}return e()+(e()||"")},p=1,f=0,h=null;return t.eachMapping(function(e){if(null!==h){if(!(p<e.generatedLine)){var t=u[l]||"",n=t.substr(0,e.generatedColumn-f);return u[l]=t.substr(e.generatedColumn-f),f=e.generatedColumn,i(h,n),void(h=e)}i(h,c()),p++,f=0}for(;p<e.generatedLine;)s.add(c()),p++;if(f<e.generatedColumn){var t=u[l]||"";s.add(t.substr(0,e.generatedColumn)),u[l]=t.substr(e.generatedColumn),f=e.generatedColumn}h=e},this),l<u.length&&(h&&i(h,c()),s.add(u.splice(l).join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=o.join(n,e)),s.setSourceContent(e,r))}),s},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)t=this.children[n],t[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},r.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},r.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},r.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},r.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);for(var r=Object.keys(this.sourceContents),t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},r.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e},r.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new i(e),r=!1,o=null,a=null,s=null,u=null;return this.walk(function(e,i){t.code+=e,null!==i.source&&null!==i.line&&null!==i.column?(o===i.source&&a===i.line&&s===i.column&&u===i.name||n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),o=i.source,a=i.line,s=i.column,u=i.name,r=!0):r&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,r=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(o=null,r=!1):r&&n.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,t){n.setSourceContent(e,t)}),{code:t.code,map:n}},t.SourceNode=r},function(e,t,n){"use strict";function r(e,t,n,r,i){}e.exports=r},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(444);e.exports=function(){function e(e,t,n,r,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(32),i=n(8),o=n(10),a=n(13),s=n(444),u=n(995);e.exports=function(e,t){function n(e){var t=e&&(C&&e[C]||e[A]);if("function"==typeof t)return t}function l(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){this.message=e,this.stack=""}function p(e){function n(n,r,o,a,u,l,p){if(a=a||D,l=l||o,p!==s)if(t)i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else;return null==r[o]?n?new c(null===r[o]?"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+u+" `"+l+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(r,o,a,u,l)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,i,o,a){var s=t[n];if(w(s)!==e)return new c("Invalid "+i+" `"+o+"` of type `"+k(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return p(t)}function h(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var l=e(a,u,r,i,o+"["+u+"]",s);if(l instanceof Error)return l}return null}return p(t)}function d(e){function t(t,n,r,i,o){if(!(t[n]instanceof e)){var a=e.name||D;return new c("Invalid "+i+" `"+o+"` of type `"+S(t[n])+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null}return p(t)}function m(e){function t(t,n,r,i,o){for(var a=t[n],s=0;s<e.length;s++)if(l(a,e[s]))return null;return new c("Invalid "+i+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?p(t):r.thatReturnsNull}function v(e){function t(t,n,r,i,o){if("function"!=typeof e)return new c("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var l in a)if(a.hasOwnProperty(l)){var p=e(a,l,r,i,o+"."+l,s);if(p instanceof Error)return p}return null}return p(t)}function g(e){function t(t,n,r,i,o){for(var a=0;a<e.length;a++){if(null==(0,e[a])(t,n,r,i,o,s))return null}return new c("Invalid "+i+" `"+o+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var i=e[n];if("function"!=typeof i)return o(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",E(i),n),r.thatReturnsNull}return p(t)}function y(e){function t(t,n,r,i,o){var a=t[n],u=w(a);if("object"!==u)return new c("Invalid "+i+" `"+o+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");for(var l in e){var p=e[l];if(p){var f=p(a,l,r,i,o+"."+l,s);if(f)return f}}return null}return p(t)}function _(e){function t(t,n,r,i,o){var u=t[n],l=w(u);if("object"!==l)return new c("Invalid "+i+" `"+o+"` of type `"+l+"` supplied to `"+r+"`, expected `object`.");var p=a({},t[n],e);for(var f in p){var h=e[f];if(!h)return new c("Invalid "+i+" `"+o+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var d=h(u,f,r,i,o+"."+f,s);if(d)return d}return null}return p(t)}function b(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(b);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!b(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!b(a[1]))return!1}return!0;default:return!1}}function x(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function w(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":x(t,e)?"symbol":t}function k(e){if(void 0===e||null===e)return""+e;var t=w(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function E(e){var t=k(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function S(e){return e.constructor&&e.constructor.name?e.constructor.name:D}var C="function"==typeof Symbol&&Symbol.iterator,A="@@iterator",D="<<anonymous>>",O={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return p(r.thatReturnsNull)}(),arrayOf:h,element:function(){function t(t,n,r,i,o){var a=t[n];if(!e(a)){return new c("Invalid "+i+" `"+o+"` of type `"+w(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return p(t)}(),instanceOf:d,node:function(){function e(e,t,n,r,i){return b(e[t])?null:new c("Invalid "+r+" `"+i+"` supplied to `"+n+"`, expected a ReactNode.")}return p(e)}(),objectOf:v,oneOf:m,oneOfType:g,shape:y,exact:_};return c.prototype=Error.prototype,O.checkPropTypes=u,O.PropTypes=O,O}},function(e,t,n){(function(e,r){var i;!function(o){function a(e){throw RangeError(P[e])}function s(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function u(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(T,"."),r+s(e.split("."),t).join(".")}function l(e){for(var t,n,r=[],i=0,o=e.length;i<o;)t=e.charCodeAt(i++),t>=55296&&t<=56319&&i<o?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function c(e){return s(e,function(e){var t="";return e>65535&&(e-=65536,t+=j(e>>>10&1023|55296),e=56320|1023&e),t+=j(e)}).join("")}function p(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:x}function f(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function h(e,t,n){var r=0;for(e=n?R(e/S):e>>1,e+=R(e/t);e>I*k>>1;r+=x)e=R(e/I);return R(r+(I+1)*e/(e+E))}function d(e){var t,n,r,i,o,s,u,l,f,d,m=[],v=e.length,g=0,y=A,_=C;for(n=e.lastIndexOf(D),n<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&a("not-basic"),m.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=g,s=1,u=x;i>=v&&a("invalid-input"),l=p(e.charCodeAt(i++)),(l>=x||l>R((b-g)/s))&&a("overflow"),g+=l*s,f=u<=_?w:u>=_+k?k:u-_,!(l<f);u+=x)d=x-f,s>R(b/d)&&a("overflow"),s*=d;t=m.length+1,_=h(g-o,t,0==o),R(g/t)>b-y&&a("overflow"),y+=R(g/t),g%=t,m.splice(g++,0,y)}return c(m)}function m(e){var t,n,r,i,o,s,u,c,p,d,m,v,g,y,_,E=[];for(e=l(e),v=e.length,t=A,n=0,o=C,s=0;s<v;++s)(m=e[s])<128&&E.push(j(m));for(r=i=E.length,i&&E.push(D);r<v;){for(u=b,s=0;s<v;++s)(m=e[s])>=t&&m<u&&(u=m);for(g=r+1,u-t>R((b-n)/g)&&a("overflow"),n+=(u-t)*g,t=u,s=0;s<v;++s)if(m=e[s],m<t&&++n>b&&a("overflow"),m==t){for(c=n,p=x;d=p<=o?w:p>=o+k?k:p-o,!(c<d);p+=x)_=c-d,y=x-d,E.push(j(f(d+_%y,0))),c=R(_/y);E.push(j(f(c,0))),o=h(n,g,r==i),n=0,++r}++n,++t}return E.join("")}function v(e){return u(e,function(e){return O.test(e)?d(e.slice(4).toLowerCase()):e})}function g(e){return u(e,function(e){return M.test(e)?"xn--"+m(e):e})}var y=("object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType,"object"==typeof r&&r);var _,b=2147483647,x=36,w=1,k=26,E=38,S=700,C=72,A=128,D="-",O=/^xn--/,M=/[^\x20-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},I=x-w,R=Math.floor,j=String.fromCharCode;_={version:"1.3.2",ucs2:{decode:l,encode:c},decode:d,encode:m,toASCII:g,toUnicode:v},void 0!==(i=function(){return _}.call(t,n,t,e))&&(e.exports=i)}()}).call(t,n(72)(e),n(17))},function(e,t,n){"use strict";var r=n(1001),i=n(1e3),o=n(445);e.exports={formats:o,parse:i,stringify:r}},function(e,t,n){"use strict";var r=n(446),i=Object.prototype.hasOwnProperty,o={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:r.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},a=function(e,t){for(var n={},r=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,s=r.split(t.delimiter,a),u=0;u<s.length;++u){var l,c,p=s[u],f=p.indexOf("]="),h=-1===f?p.indexOf("="):f+1;-1===h?(l=t.decoder(p,o.decoder),c=t.strictNullHandling?null:""):(l=t.decoder(p.slice(0,h),o.decoder),c=t.decoder(p.slice(h+1),o.decoder)),i.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}return n},s=function(e,t,n){for(var r=t,i=e.length-1;i>=0;--i){var o,a=e[i];if("[]"===a)o=[],o=o.concat(r);else{o=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(s,10);!isNaN(u)&&a!==s&&String(u)===s&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(o=[],o[u]=r):o[s]=r}r=o}return r},u=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=o.exec(r),l=u?r.slice(0,u.index):r,c=[];if(l){if(!n.plainObjects&&i.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var p=0;null!==(u=a.exec(r))&&p<n.depth;){if(p+=1,!n.plainObjects&&i.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(u[1])}return u&&c.push("["+r.slice(u.index)+"]"),s(c,t,n)}};e.exports=function(e,t){var n=t?r.assign({},t):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:o.delimiter,n.depth="number"==typeof n.depth?n.depth:o.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:o.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:o.decoder,n.allowDots="boolean"==typeof n.allowDots?n.allowDots:o.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:o.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:o.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:o.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:o.strictNullHandling,""===e||null===e||void 0===e)return n.plainObjects?Object.create(null):{};for(var i="string"==typeof e?a(e,n):e,s=n.plainObjects?Object.create(null):{},l=Object.keys(i),c=0;c<l.length;++c){var p=l[c],f=u(p,i[p],n);s=r.merge(s,f,n)}return r.compact(s)}},function(e,t,n){"use strict";var r=n(446),i=n(445),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:r.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},u=function e(t,n,i,o,a,u,l,c,p,f,h,d){var m=t;if("function"==typeof l)m=l(n,m);else if(m instanceof Date)m=f(m);else if(null===m){if(o)return u&&!d?u(n,s.encoder):n;m=""}if("string"==typeof m||"number"==typeof m||"boolean"==typeof m||r.isBuffer(m)){if(u){return[h(d?n:u(n,s.encoder))+"="+h(u(m,s.encoder))]}return[h(n)+"="+h(String(m))]}var v=[];if(void 0===m)return v;var g;if(Array.isArray(l))g=l;else{var y=Object.keys(m);g=c?y.sort(c):y}for(var _=0;_<g.length;++_){var b=g[_];a&&null===m[b]||(v=Array.isArray(m)?v.concat(e(m[b],i(n,b),i,o,a,u,l,c,p,f,h,d)):v.concat(e(m[b],n+(p?"."+b:"["+b+"]"),i,o,a,u,l,c,p,f,h,d)))}return v};e.exports=function(e,t){var n=e,a=t?r.assign({},t):{};if(null!==a.encoder&&void 0!==a.encoder&&"function"!=typeof a.encoder)throw new TypeError("Encoder has to be a function.");var l=void 0===a.delimiter?s.delimiter:a.delimiter,c="boolean"==typeof a.strictNullHandling?a.strictNullHandling:s.strictNullHandling,p="boolean"==typeof a.skipNulls?a.skipNulls:s.skipNulls,f="boolean"==typeof a.encode?a.encode:s.encode,h="function"==typeof a.encoder?a.encoder:s.encoder,d="function"==typeof a.sort?a.sort:null,m=void 0!==a.allowDots&&a.allowDots,v="function"==typeof a.serializeDate?a.serializeDate:s.serializeDate,g="boolean"==typeof a.encodeValuesOnly?a.encodeValuesOnly:s.encodeValuesOnly;if(void 0===a.format)a.format=i.default;else if(!Object.prototype.hasOwnProperty.call(i.formatters,a.format))throw new TypeError("Unknown format option provided.");var y,_,b=i.formatters[a.format];"function"==typeof a.filter?(_=a.filter,n=_("",n)):Array.isArray(a.filter)&&(_=a.filter,y=_);var x=[];if("object"!=typeof n||null===n)return"";var w;w=a.arrayFormat in o?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var k=o[w];y||(y=Object.keys(n)),d&&y.sort(d);for(var E=0;E<y.length;++E){var S=y[E];p&&null===n[S]||(x=x.concat(u(n[S],S,k,c,p,f?h:null,_,d,m,v,b,g)))}var C=x.join(l),A=!0===a.addQueryPrefix?"?":"";return C.length>0?A+C:""}},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var p,f,h,d,m=e[c].replace(s,"%20"),v=m.indexOf(n);v>=0?(p=m.substr(0,v),f=m.substr(v+1)):(p=m,f=""),h=decodeURIComponent(p),d=decodeURIComponent(f),r(a,h)?i(a[h])?a[h].push(d):a[h]=[a[h],d]:a[h]=d}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?r(a(e),function(a){var s=encodeURIComponent(i(a))+n;return o(e[a])?r(e[a],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[a]))}).join(t):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";t.decode=t.parse=n(1002),t.encode=t.stringify=n(1003)},function(e,t,n){"use strict";function r(e){return decodeURIComponent(e.replace(/\+/g," "))}function i(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,i={};t=n.exec(e);i[r(t[1])]=r(t[2]));return i}function o(e,t){t=t||"";var n=[];"string"!=typeof t&&(t="?");for(var r in e)a.call(e,r)&&n.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return n.length?t+n.join("&"):""}var a=Object.prototype.hasOwnProperty;t.stringify=o,t.parse=i},function(e,t,n){(function(t){(function(){var n,r,i,o,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:void 0!==t&&null!==t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},r=t.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},o=n(),s=1e9*t.uptime(),a=o-s):Date.now?(e.exports=function(){return Date.now()-i},i=Date.now()):(e.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(t,n(33))},function(e,t){e.exports='---\nurl: "http://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://online.swagger.io/validator"\noauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"\n'},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.UnmountClosed=void 0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),p=r(c),f=n(1),h=r(f),d=n(447);(t.UnmountClosed=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.componentWillReceiveProps=function(e){var t=e.isOpened;!n.props.isOpened&&t&&n.setState({forceInitialAnimation:!0,shouldUnmount:!1})},n.onRest=function(){var e=n.props,t=e.isOpened,r=e.onRest;t||n.setState({shouldUnmount:!0}),r&&r.apply(void 0,arguments)},n.state={shouldUnmount:!n.props.isOpened,forceInitialAnimation:!n.props.isOpened},n}return s(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.isOpened,n=(e.onRest,i(e,["isOpened","onRest"])),r=this.state,o=r.forceInitialAnimation;return r.shouldUnmount?null:p.default.createElement(d.Collapse,u({forceInitialAnimation:o,isOpened:t,onRest:this.onRest},n))}}]),t}(p.default.PureComponent)).propTypes={isOpened:h.default.bool.isRequired,onRest:h.default.func}},function(e,t,n){"use strict";var r={Properties:{"aria-current":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0},DOMAttributeNames:{},DOMPropertyNames:{}};e.exports=r},function(e,t,n){"use strict";var r=n(14),i=n(378),o={focusDOMComponent:function(){i(r.getNodeFromInstance(this))}};e.exports=o},function(e,t,n){"use strict";function r(e){return(e.ctrlKey||e.altKey||e.metaKey)&&!(e.ctrlKey&&e.altKey)}function i(e){switch(e){case"topCompositionStart":return S.compositionStart;case"topCompositionEnd":return S.compositionEnd;case"topCompositionUpdate":return S.compositionUpdate}}function o(e,t){return"topKeyDown"===e&&t.keyCode===y}function a(e,t){switch(e){case"topKeyUp":return-1!==g.indexOf(t.keyCode);case"topKeyDown":return t.keyCode!==y;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function s(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data:null}function u(e,t,n,r){var u,l;if(_?u=i(e):A?a(e,n)&&(u=S.compositionEnd):o(e,n)&&(u=S.compositionStart),!u)return null;w&&(A||u!==S.compositionStart?u===S.compositionEnd&&A&&(l=A.getData()):A=d.getPooled(r));var c=m.getPooled(u,t,n,r);if(l)c.data=l;else{var p=s(n);null!==p&&(c.data=p)}return f.accumulateTwoPhaseDispatches(c),c}function l(e,t){switch(e){case"topCompositionEnd":return s(t);case"topKeyPress":return t.which!==k?null:(C=!0,E);case"topTextInput":var n=t.data;return n===E&&C?null:n;default:return null}}function c(e,t){if(A){if("topCompositionEnd"===e||!_&&a(e,t)){var n=A.getData();return d.release(A),A=null,n}return null}switch(e){case"topPaste":return null;case"topKeyPress":return t.which&&!r(t)?String.fromCharCode(t.which):null;case"topCompositionEnd":return w?null:t.data;default:return null}}function p(e,t,n,r){var i;if(!(i=x?l(e,n):c(e,n)))return null;var o=v.getPooled(S.beforeInput,t,n,r);return o.data=i,f.accumulateTwoPhaseDispatches(o),o}var f=n(123),h=n(25),d=n(1017),m=n(1054),v=n(1057),g=[9,13,27,32],y=229,_=h.canUseDOM&&"CompositionEvent"in window,b=null;h.canUseDOM&&"documentMode"in document&&(b=document.documentMode);var x=h.canUseDOM&&"TextEvent"in window&&!b&&!function(){var e=window.opera;return"object"==typeof e&&"function"==typeof e.version&&parseInt(e.version(),10)<=12}(),w=h.canUseDOM&&(!_||b&&b>8&&b<=11),k=32,E=String.fromCharCode(k),S={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},C=!1,A=null,D={eventTypes:S,extractEvents:function(e,t,n,r){return[u(e,t,n,r),p(e,t,n,r)]}};e.exports=D},function(e,t,n){"use strict";var r=n(450),i=n(25),o=(n(39),n(747),n(1063)),a=n(754),s=n(757),u=(n(10),s(function(e){return a(e)})),l=!1,c="cssFloat";if(i.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){l=!0}void 0===document.documentElement.style.cssFloat&&(c="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var i=0===r.indexOf("--"),a=e[r];null!=a&&(n+=u(r)+":",n+=o(r,a,t,i)+";")}return n||null},setValueForStyles:function(e,t,n){var i=e.style;for(var a in t)if(t.hasOwnProperty(a)){var s=0===a.indexOf("--"),u=o(a,t[a],n,s);if("float"!==a&&"cssFloat"!==a||(a=c),s)i.setProperty(a,u);else if(u)i[a]=u;else{var p=l&&r.shorthandPropertyExpansions[a];if(p)for(var f in p)i[f]="";else i[a]=""}}}};e.exports=f},function(e,t,n){"use strict";function r(e,t,n){var r=C.getPooled(T.change,e,t,n);return r.type="change",w.accumulateTwoPhaseDispatches(r),r}function i(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=r(I,e,D(e));S.batchedUpdates(a,t)}function a(e){x.enqueueEvents(e),x.processEventQueue(!1)}function s(e,t){P=e,I=t,P.attachEvent("onchange",o)}function u(){P&&(P.detachEvent("onchange",o),P=null,I=null)}function l(e,t){var n=A.updateValueIfChanged(e),r=!0===t.simulated&&F._allowSimulatedPassThrough;if(n||r)return e}function c(e,t){if("topChange"===e)return t}function p(e,t,n){"topFocus"===e?(u(),s(t,n)):"topBlur"===e&&u()}function f(e,t){P=e,I=t,P.attachEvent("onpropertychange",d)}function h(){P&&(P.detachEvent("onpropertychange",d),P=null,I=null)}function d(e){"value"===e.propertyName&&l(I,e)&&o(e)}function m(e,t,n){"topFocus"===e?(h(),f(t,n)):"topBlur"===e&&h()}function v(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return l(I,n)}function g(e){var t=e.nodeName;return t&&"input"===t.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t,n){if("topClick"===e)return l(t,n)}function _(e,t,n){if("topInput"===e||"topChange"===e)return l(t,n)}function b(e,t){if(null!=e){var n=e._wrapperState||t._wrapperState;if(n&&n.controlled&&"number"===t.type){var r=""+t.value;t.getAttribute("value")!==r&&t.setAttribute("value",r)}}}var x=n(122),w=n(123),k=n(25),E=n(14),S=n(44),C=n(51),A=n(466),D=n(252),O=n(253),M=n(468),T={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},P=null,I=null,R=!1;k.canUseDOM&&(R=O("change")&&(!document.documentMode||document.documentMode>8));var j=!1;k.canUseDOM&&(j=O("input")&&(!document.documentMode||document.documentMode>9));var F={eventTypes:T,_allowSimulatedPassThrough:!0,_isInputEventSupported:j,extractEvents:function(e,t,n,o){var a,s,u=t?E.getNodeFromInstance(t):window;if(i(u)?R?a=c:s=p:M(u)?j?a=_:(a=v,s=m):g(u)&&(a=y),a){var l=a(e,t,n);if(l){return r(l,n,o)}}s&&s(e,u,t),"topBlur"===e&&b(t,u)}};e.exports=F},function(e,t,n){"use strict";var r=n(11),i=n(88),o=n(25),a=n(750),s=n(32),u=(n(8),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(o.canUseDOM||r("56"),t||r("57"),"HTML"===e.nodeName&&r("58"),"string"==typeof t){var n=a(t,s)[0];e.parentNode.replaceChild(n,e)}else i.replaceChildWithTree(e,t)}});e.exports=u},function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=r},function(e,t,n){"use strict";var r=n(123),i=n(14),o=n(160),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},s={eventTypes:a,extractEvents:function(e,t,n,s){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var u;if(s.window===s)u=s;else{var l=s.ownerDocument;u=l?l.defaultView||l.parentWindow:window}var c,p;if("topMouseOut"===e){c=t;var f=n.relatedTarget||n.toElement;p=f?i.getClosestInstanceFromNode(f):null}else c=null,p=t;if(c===p)return null;var h=null==c?u:i.getNodeFromInstance(c),d=null==p?u:i.getNodeFromInstance(p),m=o.getPooled(a.mouseLeave,c,n,s);m.type="mouseleave",m.target=h,m.relatedTarget=d;var v=o.getPooled(a.mouseEnter,p,n,s);return v.type="mouseenter",v.target=d,v.relatedTarget=h,r.accumulateEnterLeaveDispatches(m,v,c,p),[m,v]}};e.exports=s},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var i=n(13),o=n(70),a=n(465);i(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,i=this.getText(),o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(89),i=r.injection.MUST_USE_PROPERTY,o=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,s=r.injection.HAS_POSITIVE_NUMERIC_VALUE,u=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,l={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:o,allowTransparency:0,alt:0,as:0,async:o,autoComplete:0,autoPlay:o,capture:o,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:i|o,cite:0,classID:0,className:0,cols:s,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:o,controlsList:0,coords:0,crossOrigin:0,data:0,dateTime:0,default:o,defer:o,dir:0,disabled:o,download:u,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:o,formTarget:0,frameBorder:0,headers:0,height:0,hidden:o,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:o,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:i|o,muted:i|o,name:0,nonce:0,noValidate:o,open:o,optimum:0,pattern:0,placeholder:0,playsInline:o,poster:0,preload:0,profile:0,radioGroup:0,readOnly:o,referrerPolicy:0,rel:0,required:o,reversed:o,role:0,rows:s,rowSpan:a,sandbox:0,scope:0,scoped:o,scrolling:0,seamless:o,selected:i|o,shape:0,size:s,sizes:0,span:s,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:o,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{},DOMMutationMethods:{value:function(e,t){if(null==t)return e.removeAttribute("value");"number"!==e.type||!1===e.hasAttribute("value")?e.setAttribute("value",""+t):e.validity&&!e.validity.badInput&&e.ownerDocument.activeElement!==e&&e.setAttribute("value",""+t)}}};e.exports=l},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){var i=void 0===e[n];null!=t&&i&&(e[n]=o(t,!0))}var i=n(90),o=n(467),a=(n(244),n(254)),s=n(470);n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1});var u={instantiateChildren:function(e,t,n,i){if(null==e)return null;var o={};return s(e,r,o),o},updateChildren:function(e,t,n,r,s,u,l,c,p){if(t||e){var f,h;for(f in t)if(t.hasOwnProperty(f)){h=e&&e[f];var d=h&&h._currentElement,m=t[f];if(null!=h&&a(d,m))i.receiveComponent(h,m,s,c),t[f]=h;else{h&&(r[f]=i.getHostNode(h),i.unmountComponent(h,!1));var v=o(m,!0);t[f]=v;var g=i.mountComponent(v,s,u,l,c,p);n.push(g)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(h=e[f],r[f]=i.getHostNode(h),i.unmountComponent(h,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];i.unmountComponent(r,t)}}};e.exports=u}).call(t,n(33))},function(e,t,n){"use strict";var r=n(240),i=n(1027),o={processChildrenUpdates:i.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=o},function(e,t,n){"use strict";function r(e){}function i(e){return!(!e.prototype||!e.prototype.isReactComponent)}function o(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var a=n(11),s=n(13),u=n(92),l=n(246),c=n(52),p=n(247),f=n(124),h=(n(39),n(460)),d=n(90),m=n(144),v=(n(8),n(208)),g=n(254),y=(n(10),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=f.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return t};var _=1,b={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,c=this._currentElement.props,p=this._processContext(s),h=this._currentElement.type,d=e.getUpdateQueue(),v=i(h),g=this._constructComponent(v,c,p,d);v||null!=g&&null!=g.render?o(h)?this._compositeType=y.PureClass:this._compositeType=y.ImpureClass:(l=g,null===g||!1===g||u.isValidElement(g)||a("105",h.displayName||h.name||"Component"),g=new r(h),this._compositeType=y.StatelessFunctional);g.props=c,g.context=p,g.refs=m,g.updater=d,this._instance=g,f.set(g,this);var b=g.state;void 0===b&&(g.state=b=null),("object"!=typeof b||Array.isArray(b))&&a("106",this.getName()||"ReactCompositeComponent"),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var x;return x=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),x},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var i=this._currentElement.type;return e?new i(t,n,r):i(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,i){var o,a=r.checkpoint();try{o=this.performInitialMount(e,t,n,r,i)}catch(s){r.rollback(a),this._instance.unstable_handleError(s),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),o=this.performInitialMount(e,t,n,r,i)}return o},performInitialMount:function(e,t,n,r,i){var o=this._instance,a=0;o.componentWillMount&&(o.componentWillMount(),this._pendingStateQueue&&(o.state=this._processPendingState(o.props,o.context))),void 0===e&&(e=this._renderValidatedComponent());var s=h.getType(e);this._renderedNodeType=s;var u=this._instantiateReactComponent(e,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,r,t,n,this._processChildContext(i),a);return l},getHostNode:function(){return d.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";p.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(d.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,f.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var i in n)r[i]=e[i];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes&&a("107",this.getName()||"ReactCompositeComponent");for(var i in t)i in n.childContextTypes||a("108",this.getName()||"ReactCompositeComponent",i);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,i=this._context;this._pendingElement=null,this.updateComponent(t,r,e,i,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?d.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,i){var o=this._instance;null==o&&a("136",this.getName()||"ReactCompositeComponent");var s,u=!1;this._context===i?s=o.context:(s=this._processContext(i),u=!0);var l=t.props,c=n.props;t!==n&&(u=!0),u&&o.componentWillReceiveProps&&o.componentWillReceiveProps(c,s);var p=this._processPendingState(c,s),f=!0;this._pendingForceUpdate||(o.shouldComponentUpdate?f=o.shouldComponentUpdate(c,p,s):this._compositeType===y.PureClass&&(f=!v(l,c)||!v(o.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,c,p,s,e,i)):(this._currentElement=n,this._context=i,o.props=c,o.state=p,o.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var o=s({},i?r[0]:n.state),a=i?1:0;a<r.length;a++){var u=r[a];s(o,"function"==typeof u?u.call(n,o,e,t):u)}return o},_performComponentUpdate:function(e,t,n,r,i,o){var a,s,u,l=this._instance,c=Boolean(l.componentDidUpdate);c&&(a=l.props,s=l.state,u=l.context),l.componentWillUpdate&&l.componentWillUpdate(t,n,r),this._currentElement=e,this._context=o,l.props=t,l.state=n,l.context=r,this._updateRenderedComponent(i,o),c&&i.getReactMountReady().enqueue(l.componentDidUpdate.bind(l,a,s,u),l)},_updateRenderedComponent:function(e,t){var n=this._renderedComponent,r=n._currentElement,i=this._renderValidatedComponent(),o=0;if(g(r,i))d.receiveComponent(n,i,e,this._processChildContext(t));else{var a=d.getHostNode(n);d.unmountComponent(n,!1);var s=h.getType(i);this._renderedNodeType=s;var u=this._instantiateReactComponent(i,s!==h.EMPTY);this._renderedComponent=u;var l=d.mountComponent(u,e,this._hostParent,this._hostContainerInfo,this._processChildContext(t),o);this._replaceNodeWithMarkup(a,l,n)}},_replaceNodeWithMarkup:function(e,t,n){l.replaceNodeWithMarkup(e,t,n)},_renderValidatedComponentWithoutOwnerOrContext:function(){var e=this._instance;return e.render()},_renderValidatedComponent:function(){var e;if(this._compositeType!==y.StatelessFunctional){c.current=this;try{e=this._renderValidatedComponentWithoutOwnerOrContext()}finally{c.current=null}}else e=this._renderValidatedComponentWithoutOwnerOrContext();return null===e||!1===e||u.isValidElement(e)||a("109",this.getName()||"ReactCompositeComponent"),e},attachRef:function(e,t){var n=this.getPublicInstance();null==n&&a("110");var r=t.getPublicInstance();(n.refs===m?n.refs={}:n.refs)[e]=r},detachRef:function(e){delete this.getPublicInstance().refs[e]},getName:function(){var e=this._currentElement.type,t=this._instance&&this._instance.constructor;return e.displayName||t&&t.displayName||e.name||t&&t.name||null},getPublicInstance:function(){var e=this._instance;return this._compositeType===y.StatelessFunctional?null:e},_instantiateReactComponent:null};e.exports=b},function(e,t,n){"use strict";var r=n(14),i=n(1035),o=n(459),a=n(90),s=n(44),u=n(1048),l=n(1064),c=n(464),p=n(1071);n(10);i.inject();var f={findDOMNode:l,render:o.render,unmountComponentAtNode:o.unmountComponentAtNode,version:u,unstable_batchedUpdates:s.batchedUpdates,unstable_renderSubtreeIntoContainer:p};"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject&&__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ComponentTree:{getClosestInstanceFromNode:r.getClosestInstanceFromNode,getNodeFromInstance:function(e){return e._renderedComponent&&(e=c(e)),e?r.getNodeFromInstance(e):null}},Mount:o,Reconciler:a});e.exports=f},function(e,t,n){"use strict";function r(e){if(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" This DOM node was rendered by `"+n+"`."}}return""}function i(e,t){t&&(X[e._tag]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&v("137",e._tag,e._currentElement._owner?" Check the render method of "+e._currentElement._owner.getName()+".":""),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&v("60"),"object"==typeof t.dangerouslySetInnerHTML&&W in t.dangerouslySetInnerHTML||v("61")),null!=t.style&&"object"!=typeof t.style&&v("62",r(e)))}function o(e,t,n,r){if(!(r instanceof R)){var i=e._hostContainerInfo,o=i._node&&i._node.nodeType===H,s=o?i._node:i._ownerDocument;q(t,s),r.getReactMountReady().enqueue(a,{inst:e,registrationName:t,listener:n})}}function a(){var e=this;E.putListener(e.inst,e.registrationName,e.listener)}function s(){var e=this;O.postMountWrapper(e)}function u(){var e=this;P.postMountWrapper(e)}function l(){var e=this;M.postMountWrapper(e)}function c(){F.track(this)}function p(){var e=this;e._rootNodeID||v("63");var t=L(e);switch(t||v("64"),e._tag){case"iframe":case"object":e._wrapperState.listeners=[C.trapBubbledEvent("topLoad","load",t)];break;case"video":case"audio":e._wrapperState.listeners=[];for(var n in G)G.hasOwnProperty(n)&&e._wrapperState.listeners.push(C.trapBubbledEvent(n,G[n],t));break;case"source":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t)];break;case"img":e._wrapperState.listeners=[C.trapBubbledEvent("topError","error",t),C.trapBubbledEvent("topLoad","load",t)];break;case"form":e._wrapperState.listeners=[C.trapBubbledEvent("topReset","reset",t),C.trapBubbledEvent("topSubmit","submit",t)];break;case"input":case"select":case"textarea":e._wrapperState.listeners=[C.trapBubbledEvent("topInvalid","invalid",t)]}}function f(){T.postUpdateWrapper(this)}function h(e){Z.call($,e)||(Y.test(e)||v("65",e),$[e]=!0)}function d(e,t){return e.indexOf("-")>=0||null!=t.is}function m(e){var t=e.type;h(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=n(11),g=n(13),y=n(1010),_=n(1012),b=n(88),x=n(241),w=n(89),k=n(452),E=n(122),S=n(242),C=n(159),A=n(453),D=n(14),O=n(1028),M=n(1029),T=n(454),P=n(1032),I=(n(39),n(1041)),R=n(1046),j=(n(32),n(162)),F=(n(8),n(253),n(208),n(466)),N=(n(255),n(10),A),B=E.deleteListener,L=D.getNodeFromInstance,q=C.listenTo,z=S.registrationNameModules,U={string:!0,number:!0},W="__html",V={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},H=11,G={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},J={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},K={listing:!0,pre:!0,textarea:!0},X=g({menuitem:!0},J),Y=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,$={},Z={}.hasOwnProperty,Q=1;m.displayName="ReactDOMComponent",m.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Q++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var o=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(p,this);break;case"input":O.mountWrapper(this,o,t),o=O.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this);break;case"option":M.mountWrapper(this,o,t),o=M.getHostProps(this,o);break;case"select":T.mountWrapper(this,o,t),o=T.getHostProps(this,o),e.getReactMountReady().enqueue(p,this);break;case"textarea":P.mountWrapper(this,o,t),o=P.getHostProps(this,o),e.getReactMountReady().enqueue(c,this),e.getReactMountReady().enqueue(p,this)}i(this,o);var a,f;null!=t?(a=t._namespaceURI,f=t._tag):n._tag&&(a=n._namespaceURI,f=n._tag),(null==a||a===x.svg&&"foreignobject"===f)&&(a=x.html),a===x.html&&("svg"===this._tag?a=x.svg:"math"===this._tag&&(a=x.mathml)),this._namespaceURI=a;var h;if(e.useCreateElement){var d,m=n._ownerDocument;if(a===x.html)if("script"===this._tag){var v=m.createElement("div"),g=this._currentElement.type;v.innerHTML="<"+g+"></"+g+">",d=v.removeChild(v.firstChild)}else d=o.is?m.createElement(this._currentElement.type,o.is):m.createElement(this._currentElement.type);else d=m.createElementNS(a,this._currentElement.type);D.precacheNode(this,d),this._flags|=N.hasCachedChildNodes,this._hostParent||k.setAttributeForRoot(d),this._updateDOMProperties(null,o,e);var _=b(d);this._createInitialChildren(e,o,r,_),h=_}else{var w=this._createOpenTagMarkupAndPutListeners(e,o),E=this._createContentMarkup(e,o,r);h=!E&&J[this._tag]?w+"/>":w+">"+E+"</"+this._currentElement.type+">"}switch(this._tag){case"input":e.getReactMountReady().enqueue(s,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(u,this),o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":case"button":o.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(l,this)}return h},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(z.hasOwnProperty(r))i&&o(this,r,i,e);else{"style"===r&&(i&&(i=this._previousStyleCopy=g({},t.style)),i=_.createMarkupForStyles(i,this));var a=null;null!=this._tag&&d(this._tag,t)?V.hasOwnProperty(r)||(a=k.createMarkupForCustomAttribute(r,i)):a=k.createMarkupForProperty(r,i),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+k.createMarkupForRoot()),n+=" "+k.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)r=j(o);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return K[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&b.queueHTML(r,i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)""!==o&&b.queueText(r,o);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;u<s.length;u++)b.queueChild(r,s[u])}},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,n,r){var o=t.props,a=this._currentElement.props;switch(this._tag){case"input":o=O.getHostProps(this,o),a=O.getHostProps(this,a);break;case"option":o=M.getHostProps(this,o),a=M.getHostProps(this,a);break;case"select":o=T.getHostProps(this,o),a=T.getHostProps(this,a);break;case"textarea":o=P.getHostProps(this,o),a=P.getHostProps(this,a)}switch(i(this,a),this._updateDOMProperties(o,a,e),this._updateDOMChildren(o,a,e,r),this._tag){case"input":O.updateWrapper(this),F.updateValueIfChanged(this);break;case"textarea":P.updateWrapper(this);break;case"select":e.getReactMountReady().enqueue(f,this)}},_updateDOMProperties:function(e,t,n){var r,i,a;for(r in e)if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&null!=e[r])if("style"===r){var s=this._previousStyleCopy;for(i in s)s.hasOwnProperty(i)&&(a=a||{},a[i]="");this._previousStyleCopy=null}else z.hasOwnProperty(r)?e[r]&&B(this,r):d(this._tag,e)?V.hasOwnProperty(r)||k.deleteValueForAttribute(L(this),r):(w.properties[r]||w.isCustomAttribute(r))&&k.deleteValueForProperty(L(this),r);for(r in t){var u=t[r],l="style"===r?this._previousStyleCopy:null!=e?e[r]:void 0;if(t.hasOwnProperty(r)&&u!==l&&(null!=u||null!=l))if("style"===r)if(u?u=this._previousStyleCopy=g({},u):this._previousStyleCopy=null,l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(a=a||{},a[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(a=a||{},a[i]=u[i])}else a=u;else if(z.hasOwnProperty(r))u?o(this,r,u,n):l&&B(this,r);else if(d(this._tag,t))V.hasOwnProperty(r)||k.setValueForAttribute(L(this),r,u);else if(w.properties[r]||w.isCustomAttribute(r)){var c=L(this);null!=u?k.setValueForProperty(c,r,u):k.deleteValueForProperty(c,r)}}a&&_.setValueForStyles(L(this),a,this)},_updateDOMChildren:function(e,t,n,r){var i=U[typeof e.children]?e.children:null,o=U[typeof t.children]?t.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,s=t.dangerouslySetInnerHTML&&t.dangerouslySetInnerHTML.__html,u=null!=i?null:e.children,l=null!=o?null:t.children,c=null!=i||null!=a,p=null!=o||null!=s;null!=u&&null==l?this.updateChildren(null,n,r):c&&!p&&this.updateTextContent(""),null!=o?i!==o&&this.updateTextContent(""+o):null!=s?a!==s&&this.updateMarkup(""+s):null!=l&&this.updateChildren(l,n,r)},getHostNode:function(){return L(this)},unmountComponent:function(e){switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":var t=this._wrapperState.listeners;if(t)for(var n=0;n<t.length;n++)t[n].remove();break;case"input":case"textarea":F.stopTracking(this);break;case"html":case"head":case"body":v("66",this._tag)}this.unmountChildren(e),D.uncacheNode(this),E.deleteAllListeners(this),this._rootNodeID=0,this._domID=0,this._wrapperState=null},getPublicInstance:function(){return L(this)}},g(m.prototype,m.Mixin,I.Mixin),e.exports=m},function(e,t,n){"use strict";function r(e,t){var n={_topLevelWrapper:e,_idCounter:1,_ownerDocument:t?t.nodeType===i?t:t.ownerDocument:null,_node:t,_tag:t?t.nodeName.toLowerCase():null,_namespaceURI:t?t.namespaceURI:null};return n}var i=(n(255),9);e.exports=r},function(e,t,n){"use strict";var r=n(13),i=n(88),o=n(14),a=function(e){this._currentElement=null,this._hostNode=null,this._hostParent=null,this._hostContainerInfo=null,this._domID=0};r(a.prototype,{mountComponent:function(e,t,n,r){var a=n._idCounter++;this._domID=a,this._hostParent=t,this._hostContainerInfo=n;var s=" react-empty: "+this._domID+" ";if(e.useCreateElement){var u=n._ownerDocument,l=u.createComment(s);return o.precacheNode(this,l),i(l)}return e.renderToStaticMarkup?"":"\x3c!--"+s+"--\x3e"},receiveComponent:function(){},getHostNode:function(){return o.getNodeFromInstance(this)},unmountComponent:function(){o.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};e.exports=r},function(e,t,n){"use strict";var r=n(240),i=n(14),o={dangerouslyProcessChildrenUpdates:function(e,t){var n=i.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=o},function(e,t,n){"use strict";function r(){this._rootNodeID&&f.updateWrapper(this)}function i(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checked:null!=e.value}function o(e){var t=this._currentElement.props,n=l.executeOnChange(t,e);p.asap(r,this);var i=t.name;if("radio"===t.type&&null!=i){for(var o=c.getNodeFromInstance(this),s=o;s.parentNode;)s=s.parentNode;for(var u=s.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),f=0;f<u.length;f++){var h=u[f];if(h!==o&&h.form===o.form){var d=c.getInstanceFromNode(h);d||a("90"),p.asap(r,d)}}}return n}var a=n(11),s=n(13),u=n(452),l=n(245),c=n(14),p=n(44),f=(n(8),n(10),{getHostProps:function(e,t){var n=l.getValue(t),r=l.getChecked(t);return s({type:void 0,step:void 0,min:void 0,max:void 0},t,{defaultChecked:void 0,defaultValue:void 0,value:null!=n?n:e._wrapperState.initialValue,checked:null!=r?r:e._wrapperState.initialChecked,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=t.defaultValue;e._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:null!=t.value?t.value:n,listeners:null,onChange:o.bind(e),controlled:i(t)}},updateWrapper:function(e){var t=e._currentElement.props,n=t.checked;null!=n&&u.setValueForProperty(c.getNodeFromInstance(e),"checked",n||!1);var r=c.getNodeFromInstance(e),i=l.getValue(t);if(null!=i)if(0===i&&""===r.value)r.value="0";else if("number"===t.type){var o=parseFloat(r.value,10)||0;(i!=o||i==o&&r.value!=i)&&(r.value=""+i)}else r.value!==""+i&&(r.value=""+i);else null==t.value&&null!=t.defaultValue&&r.defaultValue!==""+t.defaultValue&&(r.defaultValue=""+t.defaultValue),null==t.checked&&null!=t.defaultChecked&&(r.defaultChecked=!!t.defaultChecked)},postMountWrapper:function(e){var t=e._currentElement.props,n=c.getNodeFromInstance(e);switch(t.type){case"submit":case"reset":break;case"color":case"date":case"datetime":case"datetime-local":case"month":case"time":case"week":n.value="",n.value=n.defaultValue;break;default:n.value=n.value}var r=n.name;""!==r&&(n.name=""),n.defaultChecked=!n.defaultChecked,n.defaultChecked=!n.defaultChecked,""!==r&&(n.name=r)}});e.exports=f},function(e,t,n){"use strict";function r(e){var t="";return o.Children.forEach(e,function(e){null!=e&&("string"==typeof e||"number"==typeof e?t+=e:u||(u=!0))}),t}var i=n(13),o=n(92),a=n(14),s=n(454),u=(n(10),!1),l={mountWrapper:function(e,t,n){var i=null;if(null!=n){var o=n;"optgroup"===o._tag&&(o=o._hostParent),null!=o&&"select"===o._tag&&(i=s.getSelectValueContext(o))}var a=null;if(null!=i){var u;if(u=null!=t.value?t.value+"":r(t.children),a=!1,Array.isArray(i)){for(var l=0;l<i.length;l++)if(""+i[l]===u){a=!0;break}}else a=""+i===u}e._wrapperState={selected:a}},postMountWrapper:function(e){var t=e._currentElement.props;if(null!=t.value){a.getNodeFromInstance(e).setAttribute("value",t.value)}},getHostProps:function(e,t){var n=i({selected:void 0,children:void 0},t);null!=e._wrapperState.selected&&(n.selected=e._wrapperState.selected);var o=r(t.children);return o&&(n.children=o),n}};e.exports=l},function(e,t,n){"use strict";function r(e,t,n,r){return e===n&&t===r}function i(e){var t=document.selection,n=t.createRange(),r=n.text.length,i=n.duplicate();i.moveToElementText(e),i.setEndPoint("EndToStart",n);var o=i.text.length;return{start:o,end:o+r}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.anchorNode,i=t.anchorOffset,o=t.focusNode,a=t.focusOffset,s=t.getRangeAt(0);try{s.startContainer.nodeType,s.endContainer.nodeType}catch(e){return null}var u=r(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=u?0:s.toString().length,c=s.cloneRange();c.selectNodeContents(e),c.setEnd(s.startContainer,s.startOffset);var p=r(c.startContainer,c.startOffset,c.endContainer,c.endOffset),f=p?0:c.toString().length,h=f+l,d=document.createRange();d.setStart(n,i),d.setEnd(o,a);var m=d.collapsed;return{start:m?h:f,end:m?f:h}}function a(e,t){var n,r,i=document.selection.createRange().duplicate();void 0===t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o=void 0===t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(p),n.extend(u.node,u.offset)):(p.setEnd(u.node,u.offset),n.addRange(p))}}}var u=n(25),l=n(1068),c=n(465),p=u.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?i:o,setOffsets:p?a:s};e.exports=f},function(e,t,n){"use strict";var r=n(11),i=n(13),o=n(240),a=n(88),s=n(14),u=n(162),l=(n(8),n(255),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});i(l.prototype,{mountComponent:function(e,t,n,r){var i=n._idCounter++,o=" react-text: "+i+" ";if(this._domID=i,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,c=l.createComment(o),p=l.createComment(" /react-text "),f=a(l.createDocumentFragment());return a.queueChild(f,a(c)),this._stringText&&a.queueChild(f,a(l.createTextNode(this._stringText))),a.queueChild(f,a(p)),s.precacheNode(this,c),this._closingComment=p,f}var h=u(this._stringText);return e.renderToStaticMarkup?h:"\x3c!--"+o+"--\x3e"+h+"\x3c!-- /react-text --\x3e"},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();o.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=s.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n&&r("67",this._domID),8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,s.uncacheNode(this)}}),e.exports=l},function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);return l.asap(r,this),n}var o=n(11),a=n(13),s=n(245),u=n(14),l=n(44),c=(n(8),n(10),{getHostProps:function(e,t){return null!=t.dangerouslySetInnerHTML&&o("91"),a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange})},mountWrapper:function(e,t){var n=s.getValue(t),r=n;if(null==n){var a=t.defaultValue,u=t.children;null!=u&&(null!=a&&o("92"),Array.isArray(u)&&(u.length<=1||o("93"),u=u[0]),a=""+u),null==a&&(a=""),r=a}e._wrapperState={initialValue:""+r,listeners:null,onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=u.getNodeFromInstance(e),r=s.getValue(t);if(null!=r){var i=""+r;i!==n.value&&(n.value=i),null==t.defaultValue&&(n.defaultValue=i)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=u.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});e.exports=c},function(e,t,n){"use strict";function r(e,t){"_hostNode"in e||u("33"),"_hostNode"in t||u("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var i=0,o=t;o;o=o._hostParent)i++;for(;n-i>0;)e=e._hostParent,n--;for(;i-n>0;)t=t._hostParent,i--;for(var a=n;a--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function i(e,t){"_hostNode"in e||u("35"),"_hostNode"in t||u("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function o(e){return"_hostNode"in e||u("36"),e._hostParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var i;for(i=r.length;i-- >0;)t(r[i],"captured",n);for(i=0;i<r.length;i++)t(r[i],"bubbled",n)}function s(e,t,n,i,o){for(var a=e&&t?r(e,t):null,s=[];e&&e!==a;)s.push(e),e=e._hostParent;for(var u=[];t&&t!==a;)u.push(t),t=t._hostParent;var l;for(l=0;l<s.length;l++)n(s[l],"bubbled",i);for(l=u.length;l-- >0;)n(u[l],"captured",o)}var u=n(11);n(8);e.exports={isAncestor:i,getLowestCommonAncestor:r,getParentInstance:o,traverseTwoPhase:a,traverseEnterLeave:s}},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var i=n(13),o=n(44),a=n(161),s=n(32),u={initialize:s,close:function(){f.isBatchingUpdates=!1}},l={initialize:s,close:o.flushBatchedUpdates.bind(o)},c=[l,u];i(r.prototype,a,{getTransactionWrappers:function(){return c}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,i,o){var a=f.isBatchingUpdates;return f.isBatchingUpdates=!0,a?e(t,n,r,i,o):p.perform(e,null,t,n,r,i,o)}};e.exports=f},function(e,t,n){"use strict";function r(){k||(k=!0,y.EventEmitter.injectReactEventListener(g),y.EventPluginHub.injectEventPluginOrder(s),y.EventPluginUtils.injectComponentTree(f),y.EventPluginUtils.injectTreeTraversal(d),y.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:a,SelectEventPlugin:x,BeforeInputEventPlugin:o}),y.HostComponent.injectGenericComponentClass(p),y.HostComponent.injectTextComponentClass(m),y.DOMProperty.injectDOMPropertyConfig(i),y.DOMProperty.injectDOMPropertyConfig(l),y.DOMProperty.injectDOMPropertyConfig(b),y.EmptyComponent.injectEmptyComponentFactory(function(e){return new h(e)}),y.Updates.injectReconcileTransaction(_),y.Updates.injectBatchingStrategy(v),y.Component.injectEnvironment(c))}var i=n(1009),o=n(1011),a=n(1013),s=n(1015),u=n(1016),l=n(1018),c=n(1020),p=n(1023),f=n(14),h=n(1025),d=n(1033),m=n(1031),v=n(1034),g=n(1038),y=n(1039),_=n(1044),b=n(1049),x=n(1050),w=n(1051),k=!1;e.exports={inject:r}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";function r(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=n(122),o={handleTopLevel:function(e,t,n,o){r(i.extractEvents(e,t,n,o))}};e.exports=o},function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){var t=h(e.nativeEvent),n=p.getClosestInstanceFromNode(t),i=n;do{e.ancestors.push(i),i=i&&r(i)}while(i);for(var o=0;o<e.ancestors.length;o++)n=e.ancestors[o],m._handleTopLevel(e.topLevelType,n,e.nativeEvent,h(e.nativeEvent))}function a(e){e(d(window))}var s=n(13),u=n(377),l=n(25),c=n(70),p=n(14),f=n(44),h=n(252),d=n(752);s(i.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),c.addPoolingTo(i,c.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:l.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){return n?u.listen(n,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){return n?u.capture(n,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=a.bind(null,e);u.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=i.getPooled(e,t);try{f.batchedUpdates(o,n)}finally{i.release(n)}}}};e.exports=m},function(e,t,n){"use strict";var r=n(89),i=n(122),o=n(243),a=n(246),s=n(455),u=n(159),l=n(457),c=n(44),p={Component:a.injection,DOMProperty:r.injection,EmptyComponent:s.injection,EventPluginHub:i.injection,EventPluginUtils:o.injection,EventEmitter:u.injection,HostComponent:l.injection,Updates:c.injection};e.exports=p},function(e,t,n){"use strict";var r=n(1062),i=/\/?>/,o=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return o.test(e)?e:e.replace(i," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);return n=n&&parseInt(n,10),r(e)===n}};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function i(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:f.getHostNode(e),toIndex:n,afterNode:t}}function o(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e,t){return t&&(e=e||[],e.push(t)),e}function l(e,t){p.processChildrenUpdates(e,t)}var c=n(11),p=n(246),f=(n(124),n(39),n(52),n(90)),h=n(1019),d=(n(32),n(1065)),m=(n(8),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return h.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,i,o){var a,s=0;return a=d(t,s),h.updateChildren(e,a,n,r,i,this,this._hostContainerInfo,o,s),a},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var i=[],o=0;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a],u=0,l=f.mountComponent(s,t,this,this._hostContainerInfo,n,u);s._mountIndex=o++,i.push(l)}return i},updateTextContent:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[s(e)])},updateMarkup:function(e){var t=this._renderedChildren;h.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&c("118");l(this,[a(e)])},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,i={},o=[],a=this._reconcilerUpdateChildren(r,e,o,i,t,n);if(a||r){var s,c=null,p=0,h=0,d=0,m=null;for(s in a)if(a.hasOwnProperty(s)){var v=r&&r[s],g=a[s];v===g?(c=u(c,this.moveChild(v,m,p,h)),h=Math.max(v._mountIndex,h),v._mountIndex=p):(v&&(h=Math.max(v._mountIndex,h)),c=u(c,this._mountChildAtIndex(g,o[d],m,p,t,n)),d++),p++,m=f.getHostNode(g)}for(s in i)i.hasOwnProperty(s)&&(c=u(c,this._unmountChild(r[s],i[s])));c&&l(this,c),this._renderedChildren=a}},unmountChildren:function(e){var t=this._renderedChildren;h.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex<r)return i(e,t,n)},createChild:function(e,t,n){return r(n,t,e._mountIndex)},removeChild:function(e,t){return o(e,t)},_mountChildAtIndex:function(e,t,n,r,i,o){return e._mountIndex=r,this.createChild(e,n,t)},_unmountChild:function(e,t){var n=this.removeChild(e,t);return e._mountIndex=null,n}}});e.exports=m},function(e,t,n){"use strict";function r(e){return!(!e||"function"!=typeof e.attachRef||"function"!=typeof e.detachRef)}var i=n(11),o=(n(8),{addComponentAsRefTo:function(e,t,n){r(n)||i("119"),n.attachRef(t,e)},removeComponentAsRefFrom:function(e,t,n){r(n)||i("120");var o=n.getPublicInstance();o&&o.refs[t]===e.getPublicInstance()&&n.detachRef(t)}});e.exports=o},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!1,this.reactMountReady=o.getPooled(null),this.useCreateElement=e}var i=n(13),o=n(451),a=n(70),s=n(159),u=n(458),l=(n(39),n(161)),c=n(248),p={initialize:u.getSelectionInformation,close:u.restoreSelection},f={initialize:function(){var e=s.isEnabled();return s.setEnabled(!1),e},close:function(e){s.setEnabled(e)}},h={initialize:function(){this.reactMountReady.reset()},close:function(){this.reactMountReady.notifyAll()}},d=[p,f,h],m={getTransactionWrappers:function(){return d},getReactMountReady:function(){return this.reactMountReady},getUpdateQueue:function(){return c},checkpoint:function(){return this.reactMountReady.checkpoint()},rollback:function(e){this.reactMountReady.rollback(e)},destructor:function(){o.release(this.reactMountReady),this.reactMountReady=null}};i(r.prototype,l,m),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t,n){"function"==typeof e?e(t.getPublicInstance()):o.addComponentAsRefTo(t,e,n)}function i(e,t,n){"function"==typeof e?e(null):o.removeComponentAsRefFrom(t,e,n)}var o=n(1042),a={};a.attachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&r(n,e,t._owner)}},a.shouldUpdateRefs=function(e,t){var n=null,r=null;null!==e&&"object"==typeof e&&(n=e.ref,r=e._owner);var i=null,o=null;return null!==t&&"object"==typeof t&&(i=t.ref,o=t._owner),n!==i||"string"==typeof i&&o!==r},a.detachRefs=function(e,t){if(null!==t&&"object"==typeof t){var n=t.ref;null!=n&&i(n,e,t._owner)}},e.exports=a},function(e,t,n){"use strict";function r(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e,this.useCreateElement=!1,this.updateQueue=new s(this)}var i=n(13),o=n(70),a=n(161),s=(n(39),n(1047)),u=[],l={enqueue:function(){}},c={getTransactionWrappers:function(){return u},getReactMountReady:function(){return l},getUpdateQueue:function(){return this.updateQueue},destructor:function(){},checkpoint:function(){},rollback:function(){}};i(r.prototype,a,c),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=n(248),o=(n(10),function(){function e(t){r(this,e),this.transaction=t}return e.prototype.isMounted=function(e){return!1},e.prototype.enqueueCallback=function(e,t,n){this.transaction.isInTransaction()&&i.enqueueCallback(e,t,n)},e.prototype.enqueueForceUpdate=function(e){this.transaction.isInTransaction()&&i.enqueueForceUpdate(e)},e.prototype.enqueueReplaceState=function(e,t){this.transaction.isInTransaction()&&i.enqueueReplaceState(e,t)},e.prototype.enqueueSetState=function(e,t){this.transaction.isInTransaction()&&i.enqueueSetState(e,t)},e}());e.exports=o},function(e,t,n){"use strict";e.exports="15.6.2"},function(e,t,n){"use strict";var r={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},i={accentHeight:"accent-height",accumulate:0,additive:0,alignmentBaseline:"alignment-baseline",allowReorder:"allowReorder",alphabetic:0,amplitude:0,arabicForm:"arabic-form",ascent:0,attributeName:"attributeName",attributeType:"attributeType",autoReverse:"autoReverse",azimuth:0,baseFrequency:"baseFrequency",baseProfile:"baseProfile",baselineShift:"baseline-shift",bbox:0,begin:0,bias:0,by:0,calcMode:"calcMode",capHeight:"cap-height",clip:0,clipPath:"clip-path",clipRule:"clip-rule",clipPathUnits:"clipPathUnits",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",contentScriptType:"contentScriptType",contentStyleType:"contentStyleType",cursor:0,cx:0,cy:0,d:0,decelerate:0,descent:0,diffuseConstant:"diffuseConstant",direction:0,display:0,divisor:0,dominantBaseline:"dominant-baseline",dur:0,dx:0,dy:0,edgeMode:"edgeMode",elevation:0,enableBackground:"enable-background",end:0,exponent:0,externalResourcesRequired:"externalResourcesRequired",fill:0,fillOpacity:"fill-opacity",fillRule:"fill-rule",filter:0,filterRes:"filterRes",filterUnits:"filterUnits",floodColor:"flood-color",floodOpacity:"flood-opacity",focusable:0,fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",glyphRef:"glyphRef",gradientTransform:"gradientTransform",gradientUnits:"gradientUnits",hanging:0,horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",ideographic:0,imageRendering:"image-rendering",in:0,in2:0,intercept:0,k:0,k1:0,k2:0,k3:0,k4:0,kernelMatrix:"kernelMatrix",kernelUnitLength:"kernelUnitLength",kerning:0,keyPoints:"keyPoints",keySplines:"keySplines",keyTimes:"keyTimes",lengthAdjust:"lengthAdjust",letterSpacing:"letter-spacing",lightingColor:"lighting-color",limitingConeAngle:"limitingConeAngle",local:0,markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",markerHeight:"markerHeight",markerUnits:"markerUnits",markerWidth:"markerWidth",mask:0,maskContentUnits:"maskContentUnits",maskUnits:"maskUnits",mathematical:0,mode:0,numOctaves:"numOctaves",offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pathLength:"pathLength",patternContentUnits:"patternContentUnits",patternTransform:"patternTransform",patternUnits:"patternUnits",pointerEvents:"pointer-events",points:0,pointsAtX:"pointsAtX",pointsAtY:"pointsAtY",pointsAtZ:"pointsAtZ",preserveAlpha:"preserveAlpha",preserveAspectRatio:"preserveAspectRatio",primitiveUnits:"primitiveUnits",r:0,radius:0,refX:"refX",refY:"refY",renderingIntent:"rendering-intent",repeatCount:"repeatCount",repeatDur:"repeatDur",requiredExtensions:"requiredExtensions",requiredFeatures:"requiredFeatures",restart:0,result:0,rotate:0,rx:0,ry:0,scale:0,seed:0,shapeRendering:"shape-rendering",slope:0,spacing:0,specularConstant:"specularConstant",specularExponent:"specularExponent",speed:0,spreadMethod:"spreadMethod",startOffset:"startOffset",stdDeviation:"stdDeviation",stemh:0,stemv:0,stitchTiles:"stitchTiles",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",string:0,stroke:0,strokeDasharray:"stroke-dasharray",strokeDashoffset:"stroke-dashoffset",strokeLinecap:"stroke-linecap",strokeLinejoin:"stroke-linejoin",strokeMiterlimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",surfaceScale:"surfaceScale",systemLanguage:"systemLanguage",tableValues:"tableValues",targetX:"targetX",targetY:"targetY",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",textLength:"textLength",to:0,transform:0,u1:0,u2:0,underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicode:0,unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",values:0,vectorEffect:"vector-effect",version:0,vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",viewBox:"viewBox",viewTarget:"viewTarget",visibility:0,widths:0,wordSpacing:"word-spacing",writingMode:"writing-mode",x:0,xHeight:"x-height",x1:0,x2:0,xChannelSelector:"xChannelSelector",xlinkActuate:"xlink:actuate",xlinkArcrole:"xlink:arcrole",xlinkHref:"xlink:href",xlinkRole:"xlink:role",xlinkShow:"xlink:show",xlinkTitle:"xlink:title",xlinkType:"xlink:type",xmlBase:"xml:base",xmlns:0,xmlnsXlink:"xmlns:xlink",xmlLang:"xml:lang",xmlSpace:"xml:space",y:0,y1:0,y2:0,yChannelSelector:"yChannelSelector",z:0,zoomAndPan:"zoomAndPan"},o={Properties:{},DOMAttributeNamespaces:{xlinkActuate:r.xlink,xlinkArcrole:r.xlink,xlinkHref:r.xlink,xlinkRole:r.xlink,xlinkShow:r.xlink,xlinkTitle:r.xlink,xlinkType:r.xlink,xmlBase:r.xml,xmlLang:r.xml,xmlSpace:r.xml},DOMAttributeNames:{}};Object.keys(i).forEach(function(e){o.Properties[e]=0,i[e]&&(o.DOMAttributeNames[e]=i[e])}),e.exports=o},function(e,t,n){"use strict";function r(e){if("selectionStart"in e&&u.hasSelectionCapabilities(e))return{start:e.selectionStart,end:e.selectionEnd};if(window.getSelection){var t=window.getSelection();return{anchorNode:t.anchorNode,anchorOffset:t.anchorOffset,focusNode:t.focusNode,focusOffset:t.focusOffset}}if(document.selection){var n=document.selection.createRange();return{parentElement:n.parentElement(),text:n.text,top:n.boundingTop,left:n.boundingLeft}}}function i(e,t){if(y||null==m||m!==c())return null;var n=r(m);if(!g||!f(g,n)){g=n;var i=l.getPooled(d.select,v,e,t);return i.type="select",i.target=m,o.accumulateTwoPhaseDispatches(i),i}return null}var o=n(123),a=n(25),s=n(14),u=n(458),l=n(51),c=n(379),p=n(468),f=n(208),h=a.canUseDOM&&"documentMode"in document&&document.documentMode<=11,d={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:["topBlur","topContextMenu","topFocus","topKeyDown","topKeyUp","topMouseDown","topMouseUp","topSelectionChange"]}},m=null,v=null,g=null,y=!1,_=!1,b={eventTypes:d,extractEvents:function(e,t,n,r){if(!_)return null;var o=t?s.getNodeFromInstance(t):window;switch(e){case"topFocus":(p(o)||"true"===o.contentEditable)&&(m=o,v=t,g=null);break;case"topBlur":m=null,v=null,g=null;break;case"topMouseDown":y=!0;break;case"topContextMenu":case"topMouseUp":return y=!1,i(n,r);case"topSelectionChange":if(h)break;case"topKeyDown":case"topKeyUp":return i(n,r)}return null},didPutListener:function(e,t,n){"onSelect"===t&&(_=!0)}};e.exports=b},function(e,t,n){"use strict";function r(e){return"."+e._rootNodeID}function i(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}var o=n(11),a=n(377),s=n(123),u=n(14),l=n(1052),c=n(1053),p=n(51),f=n(1056),h=n(1058),d=n(160),m=n(1055),v=n(1059),g=n(1060),y=n(125),_=n(1061),b=n(32),x=n(250),w=(n(8),{}),k={};["abort","animationEnd","animationIteration","animationStart","blur","canPlay","canPlayThrough","click","contextMenu","copy","cut","doubleClick","drag","dragEnd","dragEnter","dragExit","dragLeave","dragOver","dragStart","drop","durationChange","emptied","encrypted","ended","error","focus","input","invalid","keyDown","keyPress","keyUp","load","loadedData","loadedMetadata","loadStart","mouseDown","mouseMove","mouseOut","mouseOver","mouseUp","paste","pause","play","playing","progress","rateChange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeUpdate","touchCancel","touchEnd","touchMove","touchStart","transitionEnd","volumeChange","waiting","wheel"].forEach(function(e){var t=e[0].toUpperCase()+e.slice(1),n="on"+t,r="top"+t,i={phasedRegistrationNames:{bubbled:n,captured:n+"Capture"},dependencies:[r]};w[e]=i,k[r]=i});var E={},S={eventTypes:w,extractEvents:function(e,t,n,r){var i=k[e];if(!i)return null;var a;switch(e){case"topAbort":case"topCanPlay":case"topCanPlayThrough":case"topDurationChange":case"topEmptied":case"topEncrypted":case"topEnded":case"topError":case"topInput":case"topInvalid":case"topLoad":case"topLoadedData":case"topLoadedMetadata":case"topLoadStart":case"topPause":case"topPlay":case"topPlaying":case"topProgress":case"topRateChange":case"topReset":case"topSeeked":case"topSeeking":case"topStalled":case"topSubmit":case"topSuspend":case"topTimeUpdate":case"topVolumeChange":case"topWaiting":a=p;break;case"topKeyPress":if(0===x(n))return null;case"topKeyDown":case"topKeyUp":a=h;break;case"topBlur":case"topFocus":a=f;break;case"topClick":if(2===n.button)return null;case"topDoubleClick":case"topMouseDown":case"topMouseMove":case"topMouseUp":case"topMouseOut":case"topMouseOver":case"topContextMenu":a=d;break;case"topDrag":case"topDragEnd":case"topDragEnter":case"topDragExit":case"topDragLeave":case"topDragOver":case"topDragStart":case"topDrop":a=m;break;case"topTouchCancel":case"topTouchEnd":case"topTouchMove":case"topTouchStart":a=v;break;case"topAnimationEnd":case"topAnimationIteration":case"topAnimationStart":a=l;break;case"topTransitionEnd":a=g;break;case"topScroll":a=y;break;case"topWheel":a=_;break;case"topCopy":case"topCut":case"topPaste":a=c}a||o("86",e);var u=a.getPooled(i,t,n,r);return s.accumulateTwoPhaseDispatches(u),u},didPutListener:function(e,t,n){if("onClick"===t&&!i(e._tag)){var o=r(e),s=u.getNodeFromInstance(e);E[o]||(E[o]=a.listen(s,"click",b))}},willDeleteListener:function(e,t){if("onClick"===t&&!i(e._tag)){var n=r(e);E[n].remove(),delete E[n]}}};e.exports=S},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={animationName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={dataTransfer:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o={relatedTarget:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={data:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(250),a=n(1066),s=n(251),u={key:a,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:s,charCode:function(e){return"keypress"===e.type?o(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?o(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}};i.augmentClass(r,u),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(125),o=n(251),a={touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:o};i.augmentClass(r,a),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(51),o={propertyName:null,elapsedTime:null,pseudoElement:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){return i.call(this,e,t,n,r)}var i=n(160),o={deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null};i.augmentClass(r,o),e.exports=r},function(e,t,n){"use strict";function r(e){for(var t=1,n=0,r=0,o=e.length,a=-4&o;r<a;){for(var s=Math.min(r+4096,a);r<s;r+=4)n+=(t+=e.charCodeAt(r))+(t+=e.charCodeAt(r+1))+(t+=e.charCodeAt(r+2))+(t+=e.charCodeAt(r+3));t%=i,n%=i}for(;r<o;r++)n+=t+=e.charCodeAt(r);return t%=i,n%=i,t|n<<16}var i=65521;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r){if(null==t||"boolean"==typeof t||""===t)return"";var i=isNaN(t);if(r||i||0===t||o.hasOwnProperty(e)&&o[e])return""+t;if("string"==typeof t){t=t.trim()}return t+"px"}var i=n(450),o=(n(10),i.isUnitlessNumber);e.exports=r},function(e,t,n){"use strict";function r(e){if(null==e)return null;if(1===e.nodeType)return e;var t=a.get(e);if(t)return t=s(t),t?o.getNodeFromInstance(t):null;"function"==typeof e.render?i("44"):i("45",Object.keys(e))}var i=n(11),o=(n(52),n(14)),a=n(124),s=n(464);n(8),n(10);e.exports=r},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){if(e&&"object"==typeof e){var i=e,o=void 0===i[n];o&&null!=t&&(i[n]=t)}}function i(e,t){if(null==e)return e;var n={};return o(e,r,n),n}var o=(n(244),n(470));n(10);void 0!==t&&n.i({NODE_ENV:"production",WEBPACK_INLINE_STYLES:!1}),e.exports=i}).call(t,n(33))},function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var i=n(250),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t,n){"use strict";function r(e){var t=e&&(i&&e[i]||e[o]);if("function"==typeof t)return t}var i="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=r},function(e,t,n){"use strict";function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function i(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var n=r(e),o=0,a=0;n;){if(3===n.nodeType){if(a=o+n.textContent.length,o<=t&&a>=t)return{node:n,offset:t-o};o=a}n=r(i(n))}}e.exports=o},function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function i(e){if(s[e])return s[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in u)return s[e]=t[n];return""}var o=n(25),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},s={},u={};o.canUseDOM&&(u=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),e.exports=i},function(e,t,n){"use strict";function r(e){return'"'+i(e)+'"'}var i=n(162);e.exports=r},function(e,t,n){"use strict";var r=n(459);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){!function(e,r){r(t,n(0),n(7))}(0,function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t=t&&"default"in t?t.default:t;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e){function t(){return r(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.state||{};return!(this.updateOnProps||Object.keys(a({},e,this.props))).every(function(r){return n.is(e[r],t.props[r])})||!(this.updateOnStates||Object.keys(a({},r,i))).every(function(e){return n.is(r[e],i[e])})}}]),t}(t.Component);e.ImmutablePureComponent=u,e.default=u,Object.defineProperty(e,"__esModule",{value:!0})})},function(e,t,n){"use strict";function r(e){return{doc:new B,blocks:M,blockStarts:T,tip:this.doc,oldtip:this.doc,currentLine:"",lineNumber:0,offset:0,column:0,nextNonspace:0,nextNonspaceColumn:0,indent:0,indented:!1,blank:!1,allClosed:!0,lastMatchedContainer:this.doc,refmap:{},lastLineLength:0,inlineParser:new u(e),findNextNonspace:R,advanceOffset:P,advanceNextNonspace:I,breakOutOfLists:E,addLine:S,addChild:C,incorporateLine:j,finalize:F,processInlines:N,closeUnmatchedBlocks:O,parse:L,options:e||{}}}var i=n(256),o=n(91).unescapeString,a=n(91).OPENTAG,s=n(91).CLOSETAG,u=n(1077),l=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i,new RegExp("^(?:"+a+"|"+s+")s*$","i")],c=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],p=/^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/,f=/^[#`~*+_=<>0-9-]/,h=/[^ \t\f\v\r\n]/,d=/^[*+-]/,m=/^(\d{1,9})([.)])/,v=/^#{1,6}(?: +|$)/,g=/^`{3,}(?!.*`)|^~{3,}(?!.*~)/,y=/^(?:`{3,}|~{3,})(?= *$)/,_=/^(?:=+|-+) *$/,b=/\r\n|\n|\r/,x=function(e){return!h.test(e)},w=function(e,t){return t<e.length?e.charCodeAt(t):-1},k=function(e){for(;e;){if(e._lastLineBlank)return!0;var t=e.type;if("List"!==t&&"Item"!==t)break;e=e._lastChild}return!1},E=function(e){var t=e,n=null;do{"List"===t.type&&(n=t),t=t._parent}while(t);if(n){for(;e!==n;)this.finalize(e,this.lineNumber),e=e._parent;this.finalize(n,this.lineNumber),this.tip=n._parent}},S=function(){this.tip._string_content+=this.currentLine.slice(this.offset)+"\n"},C=function(e,t){for(;!this.blocks[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=new i(e,[[this.lineNumber,n],[0,0]]);return r._string_content="",this.tip.appendChild(r),this.tip=r,r},A=function(e){var t,n,r,i,o=e.currentLine.slice(e.nextNonspace),a={type:null,tight:!0,bulletChar:null,start:null,delimiter:null,padding:null,markerOffset:e.indent};if(t=o.match(d))a.type="Bullet",a.bulletChar=t[0][0];else{if(!(t=o.match(m)))return null;a.type="Ordered",a.start=parseInt(t[1]),a.delimiter=t[2]}if(-1!==(n=w(e.currentLine,e.nextNonspace+t[0].length))&&9!==n&&32!==n)return null;e.advanceNextNonspace(),e.advanceOffset(t[0].length,!0),r=e.column,i=e.offset;do{e.advanceOffset(1,!0),n=w(e.currentLine,e.offset)}while(e.column-r<5&&(32===n||9===n));var s=-1===w(e.currentLine,e.offset),u=e.column-r;return u>=5||u<1||s?(a.padding=t[0].length+1,e.column=r,e.offset=i,32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!0)):a.padding=t[0].length+u,a},D=function(e,t){return e.type===t.type&&e.delimiter===t.delimiter&&e.bulletChar===t.bulletChar},O=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip._parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},M={Document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},List:{continue:function(){return 0},finalize:function(e,t){for(var n=t._firstChild;n;){if(k(n)&&n._next){t._listData.tight=!1;break}for(var r=n._firstChild;r;){if(k(r)&&(n._next||r._next)){t._listData.tight=!1;break}r=r._next}n=n._next}},canContain:function(e){return"Item"===e},acceptsLines:!1},BlockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==w(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(t,e.offset)&&e.offset++,0)},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Item:{continue:function(e,t){if(e.blank&&null!==t._firstChild)e.advanceNextNonspace();else{if(!(e.indent>=t._listData.markerOffset+t._listData.padding))return 1;e.advanceOffset(t._listData.markerOffset+t._listData.padding,!0)}return 0},finalize:function(){},canContain:function(e){return"Item"!==e},acceptsLines:!1},Heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},ThematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},CodeBlock:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t._isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t._fenceChar&&n.slice(e.nextNonspace).match(y);if(i&&i[0].length>=t._fenceLength)return e.finalize(t,e.lineNumber),2;for(var o=t._fenceOffset;o>0&&32===w(n,e.offset);)e.advanceOffset(1,!1),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){if(t._isFenced){var n=t._string_content,r=n.indexOf("\n"),i=n.slice(0,r),a=n.slice(r+1);t.info=o(i.trim()),t._literal=a}else t._literal=t._string_content.replace(/(\n *)+$/,"\n");t._string_content=null},canContain:function(){return!1},acceptsLines:!0},HtmlBlock:{continue:function(e,t){return!e.blank||6!==t._htmlBlockType&&7!==t._htmlBlockType?0:1},finalize:function(e,t){t._literal=t._string_content.replace(/(\n *)+$/,""),t._string_content=null},canContain:function(){return!1},acceptsLines:!0},Paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){for(var n,r=!1;91===w(t._string_content,0)&&(n=e.inlineParser.parseReference(t._string_content,e.refmap));)t._string_content=t._string_content.slice(n),r=!0;r&&x(t._string_content)&&t.unlink()},canContain:function(){return!1},acceptsLines:!0}},T=[function(e){return e.indented||62!==w(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),32===w(e.currentLine,e.offset)&&e.advanceOffset(1,!1),e.closeUnmatchedBlocks(),e.addChild("BlockQuote",e.nextNonspace),1)},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(v))){e.advanceNextNonspace(),e.advanceOffset(t[0].length,!1),e.closeUnmatchedBlocks();var n=e.addChild("Heading",e.nextNonspace);return n.level=t[0].trim().length,n._string_content=e.currentLine.slice(e.offset).replace(/^ *#+ *$/,"").replace(/ +#+ *$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(g))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("CodeBlock",e.nextNonspace);return r._isFenced=!0,r._fenceLength=n,r._fenceChar=t[0][0],r._fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===w(e.currentLine,e.nextNonspace)){var n,r=e.currentLine.slice(e.nextNonspace);for(n=1;n<=7;n++)if(l[n].test(r)&&(n<7||"Paragraph"!==t.type)){e.closeUnmatchedBlocks();var i=e.addChild("HtmlBlock",e.offset);return i._htmlBlockType=n,2}}return 0},function(e,t){var n;if(!e.indented&&"Paragraph"===t.type&&(n=e.currentLine.slice(e.nextNonspace).match(_))){e.closeUnmatchedBlocks();var r=new i("Heading",t.sourcepos);return r.level="="===n[0][0]?1:2,r._string_content=t._string_content,t.insertAfter(r),t.unlink(),e.tip=r,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0},function(e){return!e.indented&&p.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("ThematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n;return e.indented&&"List"!==t.type||!(n=A(e))?0:(e.closeUnmatchedBlocks(),"List"===e.tip.type&&D(t._listData,n)||(t=e.addChild("List",e.nextNonspace),t._listData=n),t=e.addChild("Item",e.nextNonspace),t._listData=n,1)},function(e){return e.indented&&"Paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("CodeBlock",e.offset),2):0}],P=function(e,t){for(var n,r,i=0,o=this.currentLine;e>0&&(r=o[this.offset]);)"\t"===r?(n=4-this.column%4,this.column+=n,this.offset+=1,e-=t?n:1):(i+=1,this.offset+=1,this.column+=1,e-=1)},I=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn},R=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},j=function(e){var t,n=!0,r=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var i;(i=r._lastChild)&&i._open;){switch(r=i,this.findNextNonspace(),this.blocks[r.type].continue(this,r)){case 0:break;case 1:n=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw"continue returned illegal value, must be 0, 1, or 2"}if(!n){r=r._parent;break}}this.allClosed=r===this.oldtip,this.lastMatchedContainer=r,this.blank&&r._lastLineBlank&&(this.breakOutOfLists(r),r=this.tip);for(var o="Paragraph"!==r.type&&M[r.type].acceptsLines,a=this.blockStarts,s=a.length;!o;){if(this.findNextNonspace(),!this.indented&&!f.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var u=0;u<s;){var l=a[u](this,r);if(1===l){r=this.tip;break}if(2===l){r=this.tip,o=!0;break}u++}if(u===s){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"Paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&r.lastChild&&(r.lastChild._lastLineBlank=!0),t=r.type;for(var p=this.blank&&!("BlockQuote"===t||"CodeBlock"===t&&r._isFenced||"Item"===t&&!r._firstChild&&r.sourcepos[0][0]===this.lineNumber),h=r;h;)h._lastLineBlank=p,h=h._parent;this.blocks[t].acceptsLines?(this.addLine(),"HtmlBlock"===t&&r._htmlBlockType>=1&&r._htmlBlockType<=5&&c[r._htmlBlockType].test(this.currentLine.slice(this.offset))&&this.finalize(r,this.lineNumber)):this.offset<e.length&&!this.blank&&(r=this.addChild("Paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},F=function(e,t){var n=e._parent;e._open=!1,e.sourcepos[1]=[t,this.lastLineLength],this.blocks[e.type].finalize(this,e),this.tip=n},N=function(e){var t,n,r,i=e.walker();for(this.inlineParser.refmap=this.refmap,this.inlineParser.options=this.options;n=i.next();)t=n.node,r=t.type,n.entering||"Paragraph"!==r&&"Heading"!==r||this.inlineParser.parse(t)},B=function(){return new i("Document",[[1,1],[0,0]])},L=function(e){this.doc=new B,this.tip=this.doc,this.refmap={},this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",this.options.time&&console.time("preparing input");var t=e.split(b),n=t.length;10===e.charCodeAt(e.length-1)&&(n-=1),this.options.time&&console.timeEnd("preparing input"),this.options.time&&console.time("block parsing");for(var r=0;r<n;r++)this.incorporateLine(t[r]);for(;this.tip;)this.finalize(this.tip,n);return this.options.time&&console.timeEnd("block parsing"),this.options.time&&console.time("inline parsing"),this.processInlines(this.doc),this.options.time&&console.timeEnd("inline parsing"),this.doc};e.exports=r},function(e,t,n){"use strict";/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L368

Insecure DOM Manipulation (XSS) in ForceBlocks.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ForceBlocks.js:368
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- n = sn.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1660

Insecure DOM Manipulation (XSS) in firebug-lite.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/firebug-lite.js:1660
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- if(el.left.dom.container.environment.getElement().innerHTML==""){
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L8

Insecure DOM Manipulation (XSS) in image.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advimage/js/image.js:8
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L47

Insecure DOM Manipulation (XSS) in advlink.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/advlink/js/advlink.js:47
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById("anchorlistcontainer").innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L5

Insecure DOM Manipulation (XSS) in media.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/js/media.js:5
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L87

Insecure DOM Manipulation (XSS) in media.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/media/js/media.js:87
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- get("linklistcontainer").innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L267

Insecure DOM Manipulation (XSS) in editor_plugin_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js:267
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- h += n.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L42

Insecure DOM Manipulation (XSS) in props.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/style/js/props.js:42
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L11

Insecure DOM Manipulation (XSS) in cell.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/table/js/cell.js:11
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in editor_plugin.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/editor_plugin.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L360

Insecure DOM Manipulation (XSS) in charmap.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/charmap.js:360
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- elmB.innerHTML = '&amp;' + codeA;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L217

Insecure DOM Manipulation (XSS) in color_picker.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/themes/advanced/js/color_picker.js:217
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = h;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1299

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:1299
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- elm.innerHTML = text;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4298

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:4298
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = '<br />' + html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L6849

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:6849
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = "<a href='#'></a>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L14295

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:14295
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- aft.innerHTML = aft.firstChild.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L14324

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:14324
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- e.innerHTML = isOpera ? '\u00a0' : '<br />'; // Extra space for Opera so that the caret can move there
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4289

Insecure DOM Manipulation (XSS) in tiny_mce_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_src.js:4289
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L11589

Insecure DOM Manipulation (XSS) in tiny_mce_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_src.js:11589
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L13990

Insecure DOM Manipulation (XSS) in tiny_mce_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_src.js:13990
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- fmt.inner.innerHTML = '\uFEFF';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L189

Insecure DOM Manipulation (XSS) in ext-tree.js

CWE-79
File Location: lib/web/extjs/ext-tree.js:189
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- Ext.Editor=function(_1,_2){Ext.Editor.superclass.constructor.call(this,_2);this.field=_1;this.addEvents({"beforestartedit":true,"startedit":true,"beforecomplete":true,"complete":true,"specialkey":true});};Ext.extend(Ext.Editor,Ext.Component,{value:"",alignment:"c-c?",shadow:"frame",updateEl:false,onRender:function(ct,_4){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:3,id:this.id});this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");this.field.render(this.el);if(Ext.isGecko){this.field.el.dom.setAttribute("autocomplete","off");}this.field.show();this.field.on("blur",this.onBlur,this);this.relayEvents(this.field,["specialkey"]);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1});}},startEdit:function(el,_6){if(this.editing){this.completeEdit();}this.boundEl=Ext.get(el);var v=_6!==undefined?_6:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body);}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return;}this.startValue=v;this.field.setValue(v);if(this.autoSize){var sz=this.boundEl.getSize();switch(this.autoSize){case "width":this.setSize(sz.width,"");break;case "height":this.setSize("",sz.height);break;default:this.setSize(sz.width,sz.height);}}this.el.alignTo(this.boundEl,this.alignment);this.editing=true;if(Ext.QuickTips){Ext.QuickTips.disable();}this.show();},setSize:function(w,h){this.field.setSize(w,h);if(this.el){this.el.sync();}},realign:function(){this.el.alignTo(this.boundEl,this.alignment);},completeEdit:function(_b){if(!this.editing){return;}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true);}if(String(v)==String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return;}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v);}if(_b!==true){this.hide();}this.fireEvent("complete",this,v,this.startValue);}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide();}this.field.show();this.field.focus();this.fireEvent("startedit",this.boundEl,this.startValue);},cancelEdit:function(_d){if(this.editing){this.setValue(this.startValue);if(_d!==true){this.hide();}}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit();}},onHide:function(){if(this.editing){this.completeEdit();return;}this.field.blur();if(this.field.collapse){this.field.collapse();}this.el.hide();if(this.hideEl!==false){this.boundEl.show();}if(Ext.QuickTips){Ext.QuickTips.enable();}},setValue:function(v){this.field.setValue(v);},getValue:function(){return this.field.getValue();}});
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2677

Insecure DOM Manipulation (XSS) in jquery.js

CWE-79
File Location: lib/web/jquery.js:2677
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = "<a href='#'></a>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L5220

Insecure DOM Manipulation (XSS) in knockout.js

CWE-79
File Location: lib/web/knockoutjs/knockout.js:5220
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- templateData.textData = templateData.containerData.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1935

Insecure DOM Manipulation (XSS) in prototype.js

CWE-79
File Location: lib/web/prototype/prototype.js:1935
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = "<option value=\"test\">test</option>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2027

Insecure DOM Manipulation (XSS) in prototype.js

CWE-79
File Location: lib/web/prototype/prototype.js:2027
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = content.stripScripts();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4794

Insecure DOM Manipulation (XSS) in prototype.js

CWE-79
File Location: lib/web/prototype/prototype.js:4794
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1864

Insecure DOM Manipulation (XSS) in window.js

CWE-79
File Location: lib/web/prototype/window.js:1864
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- tmpObj.innerHTML = content;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: lib/web/tiny_mce_4/plugins/help/plugin.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(){return e}};function l(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var n,r,o,a,i,c,u=t(!1),s=t(!0),m=u,f=s,d=function(){return p},p=(a={fold:function(e,t){return e()},is:m,isSome:m,isNone:f,getOr:o=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:o,orThunk:r,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:m,forall:f,filter:d,equals:n=function(e){return e.isNone()},equals_:n,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(a),a),y=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return y(e(n))},ap:function(e){return e.fold(d,function(e){return y(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:p},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(m,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},h={some:y,none:d,from:function(e){return null===e||e===undefined?p:y(e)}},g=(i="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===i}),k=(Array.prototype.slice,(c=Array.prototype.indexOf)===undefined?function(e,t){return x(e,t)}:function(e,t){return c.call(e,t)}),v=function(e,t){return-1<k(e,t)},b=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var a=e[o];r[o]=t(a,o,e)}return r},x=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},A=(g(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.I18n")),C=tinymce.util.Tools.resolve("tinymce.Env"),w=C.mac?"\u2318":"Ctrl",S=C.mac?"Ctrl + Alt":"Shift + Alt",O={shortcuts:[{shortcut:w+" + B",action:"Bold"},{shortcut:w+" + I",action:"Italic"},{shortcut:w+" + U",action:"Underline"},{shortcut:w+" + A",action:"Select all"},{shortcut:w+" + Y or "+w+" + Shift + Z",action:"Redo"},{shortcut:w+" + Z",action:"Undo"},{shortcut:S+" + 1",action:"Header 1"},{shortcut:S+" + 2",action:"Header 2"},{shortcut:S+" + 3",action:"Header 3"},{shortcut:S+" + 4",action:"Header 4"},{shortcut:S+" + 5",action:"Header 5"},{shortcut:S+" + 6",action:"Header 6"},{shortcut:S+" + 7",action:"Paragraph"},{shortcut:S+" + 8",action:"Div"},{shortcut:S+" + 9",action:"Address"},{shortcut:"Alt + F9",action:"Focus to menubar"},{shortcut:"Alt + F10",action:"Focus to toolbar"},{shortcut:"Alt + F11",action:"Focus to element path"},{shortcut:"Ctrl + F9",action:"Focus to contextual toolbar"},{shortcut:w+" + K",action:"Insert link (if link plugin activated)"},{shortcut:w+" + S",action:"Save (if save plugin activated)"},{shortcut:w+" + F",action:"Find (if searchreplace plugin activated)"}]},T=function(){var e=b(O.shortcuts,function(e){return'<tr data-mce-tabstop="1" tabindex="-1" aria-label="Action: '+(t=e).action+", Shortcut: "+t.shortcut.replace(/Ctrl/g,"Control")+'"><td>'+A.translate(e.action)+"</td><td>"+e.shortcut+"</td></tr>";var t}).join("");return{title:"Handy Shortcuts",type:"container",style:"overflow-y: auto; overflow-x: hidden; max-height: 250px",items:[{type:"container",html:'<div><table class="mce-table-striped"><thead><th>'+A.translate("Action")+"</th><th>"+A.translate("Shortcut")+"</th></thead>"+e+"</table></div>"}]}},P=Object.keys,_=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"compat3x",name:"3.x Compatibility"},{key:"contextmenu",name:"Context Menu"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"}],H=l(function(e,o){return e.replace(/\$\{([^{}]*)\}/g,function(e,t){var n,r=o[t];return"string"==(n=typeof r)||"number"===n?r.toString():e})},'<a href="${url}" target="_blank" rel="noopener">${name}</a>'),F=function(t,n){return function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return h.some(o)}return h.none()}(_,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?H(e()):n},function(e){return H({name:e.name,url:"https://www.tinymce.com/docs/plugins/"+e.key})})},M=function(t){var e,n,r,o=(r=P((e=t).plugins),e.settings.forced_plugins===undefined?r:function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var a=e[r];t(a,r,e)&&n.push(a)}return n}(r,(n=l(v,e.settings.forced_plugins),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}))),a=b(o,function(e){return"<li>"+F(t,e)+"</li>"}),i=a.length,c=a.join("");return"<p><b>"+A.translate(["Plugins installed ({0}):",i])+"</b></p><ul>"+c+"</ul>"},E=function(e){return{title:"Plugins",type:"container",style:"overflow-y: auto; overflow-x: hidden;",layout:"flex",padding:10,spacing:10,items:[(t=e,{type:"container",html:'<div style="overflow-y: auto; overflow-x: hidden; max-height: 230px; height: 230px;" data-mce-tabstop="1" tabindex="-1">'+M(t)+"</div>",flex:1}),{type:"container",html:'<div style="padding: 10px; background: #e3e7f4; height: 100%;" data-mce-tabstop="1" tabindex="-1"><p><b>'+A.translate("Premium plugins:")+'</b></p><ul><li>PowerPaste</li><li>Spell Checker Pro</li><li>Accessibility Checker</li><li>Advanced Code Editor</li><li>Enhanced Media Embed</li><li>Link Checker</li></ul><br /><p style="float: right;"><a href="https://www.tinymce.com/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+A.translate("Learn more...")+"</a></p></div>",flex:1}]};var t},I=tinymce.util.Tools.resolve("tinymce.EditorManager"),j=function(){var e,t,n='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(e=I.majorVersion,t=I.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"</a>";return[{type:"label",html:A.translate(["You are using {0}",n])},{type:"spacer",flex:1},{text:"Close",onclick:function(){this.parent().parent().close()}}]},L=function(e,t){return function(){e.windowManager.open({title:"Help",bodyType:"tabpanel",layout:"flex",body:[T(),E(e)],buttons:j(),onPostRender:function(){this.getEl("title").innerHTML='<img src="'+t+'/img/logo.png" alt="TinyMCE Logo" style="display: inline-block; width: 200px; height: 50px">'}})}},B=function(e,t){e.addCommand("mceHelp",L(e,t))},N=function(e,t){e.addButton("help",{icon:"help",onclick:L(e,t)}),e.addMenuItem("help",{text:"Help",icon:"help",context:"help",onclick:L(e,t)})};e.add("help",function(e,t){N(e,t),B(e,t),e.shortcuts.add("Alt+0","Open help dialog","mceHelp")})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: lib/web/tiny_mce_4/plugins/lists/plugin.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(u){"use strict";var e,n,t,r,o,i,a,s,c=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),d=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),l=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),g=function(e){return e&&"BR"===e.nodeName},h=function(e){return e&&3===e.nodeType},y=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},N=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},S=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},C=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},O=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},b=g,T=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},D=function(e,n){return e&&e.nodeName in n},L=function(e,n){return!!g(n)&&!(!e.isBlock(n.nextSibling)||g(n.previousSibling))},E=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},w=function(e,n){return e.isChildOf(n,e.getRoot())},k=function(e,n){if(h(e))return{container:e,offset:n};var t=f.getNode(e,n);return h(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&h(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&h(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},A=function(e){var n=e.cloneRange(),t=k(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=k(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},x=m.DOM,R=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=x.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):x.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},I=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,x.remove(r),!n.hasChildNodes()&&x.isBlock(n)&&n.appendChild(x.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=x.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),A(n)},_=function(e){return function(){return e}},B=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},P=_(!1),M=_(!0),U=P,F=M,j=function(){return H},H=(r={fold:function(e,n){return e()},is:U,isSome:U,isNone:F,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:j,ap:j,each:function(){},bind:j,flatten:j,exists:U,forall:F,filter:j,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:_("none()")},Object.freeze&&Object.freeze(r),r),$=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:F,isNone:U,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return $(e(t))},ap:function(e){return e.fold(j,function(e){return $(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:H},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(U,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},q={some:$,none:j,from:function(e){return null===e||e===undefined?H:$(e)}},W=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}},V=W("string"),z=W("boolean"),K=W("function"),X=W("number"),Q=Array.prototype.slice,Y=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o,e)}return r},G=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t,e)},J=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r,e)&&t.push(i)}return t},Z=function(e,n,t){return G(e,function(e){t=n(t,e)}),t},ee=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return q.some(o)}return q.none()},ne=Array.prototype.push,te=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Array.prototype.isPrototypeOf(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);ne.apply(n,e[t])}return n}(Y(e,n))},re=function(e){return 0===e.length?q.none():q.some(e[0])},oe=function(e){return 0===e.length?q.none():q.some(e[e.length-1])},ie=(K(Array.from)&&Array.from,"undefined"!=typeof u.window?u.window:Function("return this;")()),ue=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:ie,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},ae=function(e,n){var t=ue(e,n);if(t===undefined||null===t)throw e+" not available on this browser";return t},se=function(e){var n,t=ue("ownerDocument.defaultView",e);return(n=t,ae("HTMLElement",n)).prototype.isPrototypeOf(e)},ce=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),fe=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",le(e,n))},de=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return v.grep((t=e,n=o,r=v.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",le(t,e));return n||e}),ce.unique(r)),function(e){return C(e)})},le=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},me=function(e,n){var t=e.dom.getParents(n,"ol,ul",le(e,n));return oe(t)},ge=function(n,e){var t=Y(e,function(e){return me(n,e).getOr(e)});return ce.unique(t)},pe={isList:function(e){var n=fe(e);return se(n)},getParentList:fe,getSelectedSubLists:function(e){var n,t,r,o=fe(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,v.grep(n.querySelectorAll("ol,ul,dl"),function(e){return y(e)})):v.grep(i,function(e){return y(e)&&o!==e})},getSelectedListItems:de,getClosestListRootElm:le,getSelectedDlItems:function(e){return J(de(e),S)},getSelectedListRoots:function(e){var n,t,r,o=(t=me(n=e,n.selection.getStart()),r=J(n.selection.getSelectedBlocks(),N),t.toArray().concat(r));return ge(e,o)}},ve=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:_(e)}},he={fromHtml:function(e,n){var t=(n||u.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw u.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ve(t.childNodes[0])},fromTag:function(e,n){var t=(n||u.document).createElement(e);return ve(t)},fromText:function(e,n){var t=(n||u.document).createTextNode(e);return ve(t)},fromDom:ve,fromPoint:function(e,n,t){var r=e.dom();return q.from(r.elementFromPoint(n,t)).map(ve)}},ye=function(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return q.none();t.push(o.getOrDie())}return q.some(n.apply(null,t))},Ne=Object.keys,Se=function(){return ae("Node")},Ce=function(e,n,t){return 0!=(e.compareDocumentPosition(n)&t)},Oe=function(e,n){return Ce(e,n,Se().DOCUMENT_POSITION_CONTAINED_BY)},be=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return De(r(1),r(2))},Te=function(){return De(0,0)},De=function(e,n){return{major:e,minor:n}},Le={nu:De,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?Te():be(e,t)},unknown:Te},Ee="Firefox",we=function(e,n){return function(){return n===e}},ke=function(e){var n=e.current;return{current:n,version:e.version,isEdge:we("Edge",n),isChrome:we("Chrome",n),isIE:we("IE",n),isOpera:we("Opera",n),isFirefox:we(Ee,n),isSafari:we("Safari",n)}},Ae={unknown:function(){return ke({current:undefined,version:Le.unknown()})},nu:ke,edge:_("Edge"),chrome:_("Chrome"),ie:_("IE"),opera:_("Opera"),firefox:_(Ee),safari:_("Safari")},xe="Windows",Re="Android",Ie="Solaris",_e="FreeBSD",Be=function(e,n){return function(){return n===e}},Pe=function(e){var n=e.current;return{current:n,version:e.version,isWindows:Be(xe,n),isiOS:Be("iOS",n),isAndroid:Be(Re,n),isOSX:Be("OSX",n),isLinux:Be("Linux",n),isSolaris:Be(Ie,n),isFreeBSD:Be(_e,n)}},Me={unknown:function(){return Pe({current:undefined,version:Le.unknown()})},nu:Pe,windows:_(xe),ios:_("iOS"),android:_(Re),linux:_("Linux"),osx:_("OSX"),solaris:_(Ie),freebsd:_(_e)},Ue=function(e,n){var t=String(n).toLowerCase();return ee(e,function(e){return e.search(t)})},Fe=function(e,t){return Ue(e,t).map(function(e){var n=Le.detect(e.versionRegexes,t);return{current:e.name,version:n}})},je=function(e,t){return Ue(e,t).map(function(e){var n=Le.detect(e.versionRegexes,t);return{current:e.name,version:n}})},He=function(e,n){return-1!==e.indexOf(n)},$e=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,qe=function(n){return function(e){return He(e,n)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return He(e,"edge/")&&He(e,"chrome")&&He(e,"safari")&&He(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,$e],search:function(e){return He(e,"chrome")&&!He(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return He(e,"msie")||He(e,"trident")}},{name:"Opera",versionRegexes:[$e,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:qe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:qe("firefox")},{name:"Safari",versionRegexes:[$e,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(He(e,"safari")||He(e,"mobile/"))&&He(e,"applewebkit")}}],Ve=[{name:"Windows",search:qe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return He(e,"iphone")||He(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:qe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:qe("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:qe("linux"),versionRegexes:[]},{name:"Solaris",search:qe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:qe("freebsd"),versionRegexes:[]}],ze={browsers:_(We),oses:_(Ve)},Ke=function(e){var n,t,r,o,i,u,a,s,c,f,d,l=ze.browsers(),m=ze.oses(),g=Fe(l,e).fold(Ae.unknown,Ae.nu),p=je(m,e).fold(Me.unknown,Me.nu);return{browser:g,os:p,deviceType:(t=g,r=e,o=(n=p).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,s=o||u||a&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),f=c&&!s,d=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:_(o),isiPhone:_(i),isTablet:_(s),isPhone:_(f),isTouch:_(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:_(d)})}},Xe={detect:(o=function(){var e=u.navigator.userAgent;return Ke(e)},a=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a||(a=!0,i=o.apply(null,e)),i})},Qe=(u.Node.ATTRIBUTE_NODE,u.Node.CDATA_SECTION_NODE,u.Node.COMMENT_NODE,u.Node.DOCUMENT_NODE,u.Node.DOCUMENT_TYPE_NODE,u.Node.DOCUMENT_FRAGMENT_NODE,u.Node.ELEMENT_NODE),Ye=(u.Node.TEXT_NODE,u.Node.PROCESSING_INSTRUCTION_NODE,u.Node.ENTITY_REFERENCE_NODE,u.Node.ENTITY_NODE,u.Node.NOTATION_NODE,Qe),Ge=function(e,n){return e.dom()===n.dom()},Je=Xe.detect().browser.isIE()?function(e,n){return Oe(e.dom(),n.dom())}:function(e,n){var t=e.dom(),r=n.dom();return t!==r&&t.contains(r)},Ze=function(e,n){var t=e.dom();if(t.nodeType!==Ye)return!1;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},en=function(e){var n=e.dom();return q.from(n.parentNode).map(he.fromDom)},nn=function(e){var n=e.dom();return Y(n.childNodes,he.fromDom)},tn=function(e,n){var t=e.dom().childNodes;return q.from(t[n]).map(he.fromDom)},rn=function(e){return tn(e,0)},on=function(e){return tn(e,e.dom().childNodes.length-1)},un=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(n,t){en(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}),an=function(e,n){e.dom().appendChild(n.dom())},sn=function(n,e){G(e,function(e){an(n,e)})},cn=function(e){var n=e.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},fn=function(e){return e.dom().nodeName.toLowerCase()},dn=function(e,n){var t=e.dom();!function(e,n){for(var t=Ne(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i,e)}}(n,function(e,n){!function(e,n,t){if(!(V(t)||z(t)||X(t)))throw u.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},ln=function(e){return Z(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})},mn=function(e,n,t){if(!V(t))throw u.console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);var r;(r=e).style!==undefined&&K(r.style.getPropertyValue)&&e.style.setProperty(n,t)},gn=function(e){return n=e,t=!0,he.fromDom(n.dom().cloneNode(t));var n,t},pn=function(e,n){var t,r,o,i,u=(t=e,r=n,o=he.fromTag(r),i=ln(t),dn(o,i),o);un(e,u);var a=nn(e);return sn(u,a),cn(e),u},vn=function(e,n){an(e.item,n.list)},hn=function(f,e,d){var n=e.slice(0,d.depth);return oe(n).each(function(e){var n,t,r,o,i,u,a,s,c=(n=f,t=d.itemAttributes,r=d.content,o=he.fromTag("li",n),dn(o,t),sn(o,r),o);u=c,an((i=e).list,u),i.item=u,s=d,fn((a=e).list)!==s.listType&&(a.list=pn(a.list,s.listType)),dn(a.list,s.listAttributes)}),n},yn=function(e,n,t){var r,o=function(e,n,t){for(var r,o,i,u=[],a=0;a<t;a++)u.push((r=e,o=n.listType,i={list:he.fromTag(o,r),item:he.fromTag("li",r)},an(i.list,i.item),i));return u}(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)vn(e[n-1],e[n])}(o),function(e,n){for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",u=r.dom(),mn(u,o,i);var r,o,i,u;oe(e).each(function(e){dn(e.list,n.listAttributes),dn(e.item,n.itemAttributes),sn(e.item,n.content)})}(o,t),r=o,ye([oe(n),re(r)],vn),n.concat(o)},Nn=function(e){return Ze(e,"OL,UL")},Sn=function(e){return rn(e).map(Nn).getOr(!1)},Cn=function(e){return 0<e.depth},On=function(e){return e.isSelected},bn=function(e){var n=nn(e),t=on(e).map(Nn).getOr(!1)?n.slice(0,-1):n;return Y(t,gn)},Tn=Object.prototype.hasOwnProperty,Dn=(s=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Tn.call(o,i)&&(t[i]=s(t[i],o[i]))}return t}),Ln=function(n){G(n,function(r,e){(function(e,n){for(var t=e[n].depth,r=n-1;0<=r;r--){if(e[r].depth===t)return q.some(e[r]);if(e[r].depth<t)break}return q.none()})(n,e).each(function(e){var n,t;t=e,(n=r).listType=t.listType,n.listAttributes=Dn({},t.listAttributes)})})},En=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return En(t())}}},wn=function(i,u,a,s){return rn(s).filter(Nn).fold(function(){u.each(function(e){Ge(e.start,s)&&a.set(!0)});var n,t,r,e=(n=s,t=i,r=a.get(),en(n).map(function(e){return{depth:t,isSelected:r,content:bn(n),itemAttributes:ln(n),listAttributes:ln(e),listType:fn(e)}}));u.each(function(e){Ge(e.end,s)&&a.set(!1)});var o=on(s).filter(Nn).map(function(e){return kn(i,u,a,e)}).getOr([]);return e.toArray().concat(o)},function(e){return kn(i,u,a,e)})},kn=function(n,t,r,e){return te(nn(e),function(e){return(Nn(e)?kn:wn)(n+1,t,r,e)})},An=tinymce.util.Tools.resolve("tinymce.Env"),xn=function(e,n){var t,r,o,i,u=e.dom,a=e.schema.getBlockElements(),s=u.createFragment();if(e.settings.forced_root_block&&(o=e.settings.forced_root_block),o&&((r=u.create(o)).tagName===e.settings.forced_root_block&&u.setAttribs(r,e.settings.forced_root_block_attrs),D(n.firstChild,a)||s.appendChild(r)),n)for(;t=n.firstChild;){var c=t.nodeName;i||"SPAN"===c&&"bookmark"===t.getAttribute("data-mce-type")||(i=!0),D(t,a)?(s.appendChild(t),r=null):o?(r||(r=u.create(o),s.appendChild(r)),r.appendChild(t)):s.appendChild(t)}return e.settings.forced_root_block?i||An.ie&&!(10<An.ie)||r.appendChild(u.create("br",{"data-mce-bogus":"1"})):s.appendChild(u.create("br")),s},Rn=function(i,e){return Y(e,function(e){var n,t,r,o=(n=e.content,r=(t||u.document).createDocumentFragment(),G(n,function(e){r.appendChild(e.dom())}),he.fromDom(r));return he.fromDom(xn(i,o.dom()))})},In=function(e,n){return Ln(n),(t=e.contentDocument,r=n,o=Z(r,function(e,n){return n.depth>e.length?yn(t,e,n):hn(t,e,n)},[]),re(o).map(function(e){return e.list})).toArray();var t,r,o},_n=function(e){var n,t,r=Y(pe.getSelectedListItems(e),he.fromDom);return ye([ee(r,B(Sn)),ee((n=r,t=Q.call(n,0),t.reverse(),t),B(Sn))],function(e,n){return{start:e,end:n}})},Bn=function(a,e,s){var n,t,r,o=(n=e,t=_n(a),r=En(!1),Y(n,function(e){return{sourceList:e,entries:kn(0,t,r,e)}}));G(o,function(e){var n,t,r,o,i,u;n=e.entries,t=s,G(J(n,On),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)}),r=e.sourceList,i=a,u=e.entries,o=te(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var a=e[i],s=n(a);s!==t&&(r.push(o),o=[]),t=s,o.push(a)}return 0!==o.length&&r.push(o),r}(u,Cn),function(e){return re(e).map(Cn).getOr(!1)?In(i,e):Rn(i,e)}),G(o,function(e){un(r,e)}),cn(e.sourceList)})},Pn=m.DOM,Mn=function(e,n,t){var r,o,i,u,a,s;for(i=Pn.select('span[data-mce-type="bookmark"]',n),a=xn(e,t),(r=Pn.createRng()).setStartAfter(t),r.setEndAfter(n),u=(o=r.extractContents()).firstChild;u;u=u.firstChild)if("LI"===u.nodeName&&e.dom.isEmpty(u)){Pn.remove(u);break}e.dom.isEmpty(o)||Pn.insertAfter(o,n),Pn.insertAfter(a,n),E(e.dom,t.parentNode)&&(s=t.parentNode,v.each(i,function(e){s.parentNode.insertBefore(e,t.parentNode)}),Pn.remove(s)),Pn.remove(t),E(e.dom,n)&&Pn.remove(n)},Un=function(e){Ze(e,"DT")&&pn(e,"DD")},Fn=function(r,e,n){G(n,"Indent"===e?Un:function(e){return n=r,void(Ze(t=e,"DD")?pn(t,"DT"):Ze(t,"DT")&&en(t).each(function(e){return Mn(n,e.dom(),t.dom())}));var n,t})},jn=function(e,n){var t=Y(pe.getSelectedListRoots(e),he.fromDom),r=Y(pe.getSelectedDlItems(e),he.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();Bn(e,t,n),Fn(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(A(e.selection.getRng())),e.nodeChanged(),o=!0}return o},Hn=function(e){return jn(e,"Indent")},$n=function(e){return jn(e,"Outdent")},qn=function(e){return jn(e,"Flatten")},Wn=function(t,e){v.each(e,function(e,n){t.setAttribute(n,e)})},Vn=function(e,n,t){var r,o,i,u,a,s,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),a=e,Wn(s=n,(c=t)["list-attributes"]),v.each(a.select("li",s),function(e){Wn(e,c["list-item-attributes"])})},zn=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&b(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(T(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Kn=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(!0),m="LI",t=pe.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=R(n),v.each(function(t,e,r){for(var o,i=[],u=t.dom,n=zn(t,e,!0,r),a=zn(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return v.each(s,function(e){if(T(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||b(e))return b(e)&&u.remove(e),void(o=null);var n=e.nextSibling;p.isBookmarkNode(e)&&(T(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,a,s,c;(t=e.previousSibling)&&y(t)&&t.nodeName===d&&(r=t,o=l,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=g.rename(e,m),t.appendChild(e)):(n=g.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=g.rename(e,m)),a=g,s=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(c,function(e){var n;return a.setStyle(s,((n={})[e]="",n))}),Vn(g,n,l),Qn(f.dom,n)}),f.selection.setRng(I(e)))},Xn=function(e,n,t){return s=t,(a=n)&&s&&y(a)&&a.nodeName===s.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,a,s},Qn=function(e,n){var t,r;if(t=n.nextSibling,Xn(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,Xn(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},Yn=function(n,e,t,r,o){if(e.nodeName!==r||Gn(o)){var i=R(n.selection.getRng(!0));v.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.rename(n,t);Vn(e,o,r)}else Vn(e,n,r)}(n.dom,e,r,o)}),n.selection.setRng(I(i))}else qn(n)},Gn=function(e){return"list-style-type"in e},Jn={toggleList:function(e,n,t){var r=pe.getParentList(e),o=pe.getSelectedSubLists(e);t=t||{},r&&0<o.length?Yn(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||Gn(r)){var o=R(e.selection.getRng(!0));Vn(e.dom,n,r),Qn(e.dom,e.dom.rename(n,t)),e.selection.setRng(I(o))}else qn(e);else Kn(e,t,r)}(e,r,n,t)},mergeWithAdjacentLists:Qn},Zn=m.DOM,et=function(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),E(e,r)&&Zn.remove(r)):Zn.setStyle(r,"listStyleType","none")),y(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)},nt=function(n,e){v.each(v.grep(n.select("ol,ul",e)),function(e){et(n,e)})},tt=function(e,n,t,r){var o,i,u=n.startContainer,a=n.startOffset;if(3===u.nodeType&&(t?a<u.data.length:0<a))return u;for(o=e.schema.getNonEmptyElements(),1===u.nodeType&&(u=f.getNode(u,a)),i=new d(u,r),t&&L(e.dom,u)&&i.next();u=i[t?"next":"prev2"]();){if("LI"===u.nodeName&&!u.hasChildNodes())return u;if(o[u.nodeName])return u;if(3===u.nodeType&&0<u.data.length)return u}},rt=function(e,n){var t=n.childNodes;return 1===t.length&&!y(t[0])&&e.isBlock(t[0])},ot=function(e,n,t){var r,o,i,u;if(o=rt(e,t)?t.firstChild:t,rt(i=e,u=n)&&i.remove(u.firstChild,!0),!E(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)},it=function(n,e,t){var r,o,i=e.parentNode;if(w(n,e)&&w(n,t)){y(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&b(i.previousSibling)&&n.remove(i.previousSibling),(r=t.lastChild)&&b(r)&&e.hasChildNodes()&&n.remove(r),E(n,t,!0)&&n.$(t).empty(),ot(n,e,t),o&&t.appendChild(o);var u=Je(he.fromDom(t),he.fromDom(e))?n.getParents(e,y,t):[];n.remove(e),G(u,function(e){E(n,e)&&e!==n.getRoot()&&n.remove(e)})}},ut=function(e,n,t,r){var o,i,u,a=e.dom;if(a.isEmpty(r))i=t,u=r,(o=e).dom.$(u).empty(),it(o.dom,i,u),o.selection.setCursorLocation(u);else{var s=R(n);it(a,t,r),e.selection.setRng(I(s))}},at=function(e,n){var t,r,o,i=e.dom,u=e.selection,a=u.getStart(),s=pe.getClosestListRootElm(e,a),c=i.getParent(u.getStart(),"LI",s);if(c){if((t=c.parentNode)===e.getBody()&&E(i,t))return!0;if(r=A(u.getRng(!0)),(o=i.getParent(tt(e,r,n,s),"LI",s))&&o!==c)return n?ut(e,r,o,c):function(e,n,t,r){var o=R(n);it(e.dom,t,r);var i=I(o);e.selection.setRng(i)}(e,r,c,o),!0;if(!o&&!n)return qn(e),!0}return!1},st=function(e,n){return at(e,n)||function(o,i){var u=o.dom,e=o.selection.getStart(),a=pe.getClosestListRootElm(o,e),s=u.getParent(e,u.isBlock,a);if(s&&u.isEmpty(s)){var n=A(o.selection.getRng(!0)),c=u.getParent(tt(o,n,i,a),"LI",a);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=s,t=a,r=(e=u).getParent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),Jn.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,n)},ct=function(e,n){return e.selection.isCollapsed()?st(e,n):(r=(t=e).selection.getStart(),o=pe.getClosestListRootElm(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<pe.getSelectedListItems(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),nt(t.dom,t.getBody())}),!0));var t,r,o},ft=function(n){n.on("keydown",function(e){e.keyCode===l.BACKSPACE?ct(n,!1)&&e.preventDefault():e.keyCode===l.DELETE&&ct(n,!0)&&e.preventDefault()})},dt=ct,lt=function(n){return{backspaceDelete:function(e){dt(n,e)}}},mt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},gt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?Hn(t):"outdent"===n&&$n(t)}),t.addCommand("InsertUnorderedList",function(e,n){Jn.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){Jn.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){Jn.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){qn(t)}),t.addQueryStateHandler("InsertUnorderedList",mt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",mt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",mt(t,"DL"))},pt=function(e){return e.getParam("lists_indent_on_tab",!0)},vt=function(e){var n;pt(e)&&(n=e).on("keydown",function(e){e.keyCode!==l.TAB||l.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?$n(n):Hn(n))&&e.preventDefault()})}),ft(e)},ht=function(n,i){return function(e){var o=e.control;n.on("NodeChange",function(e){var n=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(e.parents,O),t=-1!==n?e.parents.slice(0,n):e.parents,r=v.grep(t,y);o.active(0<r.length&&r[0].nodeName===i)})}},yt=function(e){var n,t,r;t="advlist",r=(n=e).settings.plugins?n.settings.plugins:"",-1===v.inArray(r.split(/[ ,]/),t)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ht(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ht(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent"})};c.add("lists",function(e){return vt(e),yt(e),gt(e),lt(e)})}(window);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: lib/web/tiny_mce_4/plugins/paste/plugin.min.js:1
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(v){"use strict";var g=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return g(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!e.get("powerpaste")||("undefined"!=typeof v.window.console&&v.window.console.log&&v.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(t,e){return{clipboard:t,quirks:e}},f=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},d=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},u=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},n=function(t,e){return t.fire("paste",{ieFake:e})},m={shouldPlainTextInform:function(t){return t.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}},r=function(t,e,n){var r,o,i;"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),u(t,!1)):(e.pasteFormat.set("text"),u(t,!0),i=t,!1===n.get()&&m.shouldPlainTextInform(i)&&(o="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=t).notificationManager.open({text:r.translate(o),type:"info"}),n.set(!0))),t.focus()},l=function(t,n,e){t.addCommand("mceTogglePlainTextPaste",function(){r(t,n,e)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},p=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),t="x-tinymce/html",i="\x3c!-- "+t+" --\x3e",c=function(t){return i+t},b=function(t){return t.replace(i,"")},x=function(t){return-1!==t.indexOf(i)},P=function(){return t},w=tinymce.util.Tools.resolve("tinymce.html.Entities"),_=function(t){return t.replace(/\r?\n/g,"<br>")},T=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+w.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=y.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:y.map(a,function(t){return o+t+i}).join("")},D=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},C=function(t,e,n){return e?T(t,e,n):_(t)},k=tinymce.util.Tools.resolve("tinymce.html.DomParser"),S=tinymce.util.Tools.resolve("tinymce.html.Node"),O=tinymce.util.Tools.resolve("tinymce.html.Schema"),R=tinymce.util.Tools.resolve("tinymce.html.Serializer");function F(e,t){return y.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var E={filter:F,innerText:function(e){var n=O(),r=k({},n),o="",i=n.getShortEndedElements(),a=y.makeMap("script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return e=F(e,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(i[n]&&(o+=" "),a[n])o+=" ";else{if(3===e.type&&(o+=e.value),!e.shortEnded&&(e=e.firstChild))for(;t(e),e=e.next;);s[n]&&r.next&&(o+="\n","p"===n&&(o+="\n"))}}else o+="\n"}(r.parse(e)),o},trimHtml:function(t){return t=F(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==v.navigator.userAgent.indexOf(" Edge/")}};function A(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),y.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function I(t){var i,a,s=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function u(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!u(t,e))return!1}while(t=t.next);return!0}function e(e,n,r){var o=e._listLevel||s;o!==s&&(o<s?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===n?i.append(e):(a=a||i,i=new S(n,1),1<r&&i.attr("start",""+r),e.wrap(i)),e.name="li",s<o&&a&&a.lastChild.append(i),s=o,function t(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)for(;t(e),e=e.next;);}(e),u(e,/^\u00a0+/),u(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),u(e,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var l=0;l<r.length;l++)if("p"===(t=r[l]).name&&t.firstChild){var c=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){e(t,"ul");continue}if(A(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function M(n,r,o,i){var a,s={},t=n.dom.parseStyle(i);return y.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(s[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[e])&&(s[e]=t):o.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],o.wrap(new S("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],o.wrap(new S("i",1))),(s=n.dom.serializeStyle(s,o.name))||null}var B,H,j,L,N,$={preProcess:function(t,e){return m.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=m.getRetainStyleProps(r))&&(o=y.makeMap(e.split(/[, ]/))),t=E.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=O({valid_elements:n,valid_children:"-li[p]"});y.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push("class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var a=k({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",M(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),a.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),a.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),a.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var s=a.parse(t);return m.shouldConvertWordFakeLists(r)&&I(s),t=R({validate:r.settings.validate},i).serialize(s)}(t,e):e},isWordContent:function(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},W=function(t,e){return{content:t,cancelled:e}},z=function(t,e,n,r){var o,i,a,s,u,l,c=f(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(o=t,i=c.content,a=n,s=r,u=o.dom.create("div",{style:"display:none"},i),l=d(o,u,a,s),W(l.node.innerHTML,l.isDefaultPrevented())):W(c.content,c.isDefaultPrevented())},U=function(t,e,n){var r=$.isWordContent(e),o=r?$.preProcess(t,e):e;return z(t,o,n,r)},V=function(t,e){var n,r;return t.insertContent((n=e,r=t.dom.create("body",{},n),y.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:m.shouldMergeFormats(t),paste:!0}),!0},q=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},K=function(t){return q(t)&&/.(gif|jpe?g|png)$/.test(t)},G=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!q(e)||(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),0));var r,o,i},X=function(t,e,n){return!!K(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},Y=function(t,e){var n,r;!1===m.isSmartPasteEnabled(t)?V(t,e):(n=t,r=e,y.each([G,X,V],function(t){return!0!==t(n,r,V)}))},Z=function(t){return function(){return t}},J=Z(!1),Q=Z(!0),tt=J,et=Q,nt=function(){return rt},rt=(L={fold:function(t,e){return t()},is:tt,isSome:tt,isNone:et,getOr:j=function(t){return t},getOrThunk:H=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:j,orThunk:H,map:nt,ap:nt,each:function(){},bind:nt,flatten:nt,exists:tt,forall:et,filter:nt,equals:B=function(t){return t.isNone()},equals_:B,toArray:function(){return[]},toString:Z("none()")},Object.freeze&&Object.freeze(L),L),ot=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:et,isNone:tt,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return ot(t(n))},ap:function(t){return t.fold(nt,function(t){return ot(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:rt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(tt,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},it={some:ot,none:nt,from:function(t){return null===t||t===undefined?rt:ot(t)}},at=(N="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===N}),st=Array.prototype.slice,ut=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o,t)}return r},lt=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)},ct=at(Array.from)?Array.from:function(t){return st.call(t)},ft=function(t){var n=it.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){lt(t,a)},a=function(e){n.each(function(t){v.setTimeout(function(){e(t)},0)})};return t(function(t){n=it.some(t),i(e),e=[]}),{get:r,map:function(n){return ft(function(e){r(function(t){e(n(t))})})},isReady:o}},dt={nu:ft,pure:function(e){return ft(function(t){t(e)})}},mt=function(e){var t=function(t){var r;e((r=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;v.setTimeout(function(){r.apply(n,t)},0)}))},n=function(){return dt.nu(t)};return{map:function(r){return mt(function(n){t(function(t){var e=r(t);n(e)})})},bind:function(n){return mt(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return mt(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return mt(function(t){null===e&&(e=n()),e.get(t)})},get:t}},gt={nu:mt,pure:function(e){return mt(function(t){t(e)})}},pt=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):lt(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},vt=function(t,e){var n=ut(t,e);return pt(n,gt.nu)},ht=function(t,e,n){var r=n||x(e),o=U(t,b(e),r);!1===o.cancelled&&Y(t,o.content)},yt=function(t,e){e=t.dom.encode(e).replace(/\r\n/g,"\n"),e=C(e,t.settings.forced_root_block,t.settings.forced_root_block_attrs),ht(t,e,!1)},bt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e},xt=function(t,e){return e in t&&0<t[e].length},Pt=function(t){return xt(t,"text/html")||xt(t,"text/plain")},wt=E.createIdGenerator("mceclip"),_t=function(e,t,n){var r,o,i,a,s="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&s){var u=(i=(o=s).items?ut(ct(o.items),function(t){return t.getAsFile()}):[],a=o.files?ct(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<u.length)return t.preventDefault(),(r=u,vt(r,function(r){return gt.nu(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),lt(t,function(t){!function(t,e){var n,r,o,i,a,s,u,l=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),c=wt(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):c,d=new v.Image;if(d.src=e.uri,s=t.settings,u=d,!s.images_dataimg_filter||s.images_dataimg_filter(u)){var m,g=t.editorUpload.blobCache,p=void 0;(m=g.findFirst(function(t){return t.base64()===l}))?p=m:(p=g.create(c,e.blob,l,f),g.add(p)),ht(t,'<img src="'+p.blobUri()+'">',!1)}else ht(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},Tt=function(t){return o.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},Dt=function(u,l,c){var e,f,d=(e=g(it.none()),{clear:function(){e.set(it.none())},set:function(t){e.set(it.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}});function m(t,e,n,r){var o,i;xt(t,"text/html")?o=t["text/html"]:(o=l.getHtml(),r=r||x(o),l.isDefaultContent(o)&&(n=!0)),o=E.trimHtml(o),l.remove(),i=!1===r&&D(o),o.length&&!i||(n=!0),n&&(o=xt(t,"text/plain")&&i?t["text/plain"]:E.innerText(o)),l.isDefaultContent(o)?e||u.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?yt(u,o):ht(u,o,r)}u.on("keydown",function(t){function e(t){Tt(t)&&!t.isDefaultPrevented()&&l.remove()}if(Tt(t)&&!t.isDefaultPrevented()){if((f=t.shiftKey&&86===t.keyCode)&&p.webkit&&-1!==v.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),d.set(t),window.setTimeout(function(){d.clear()},100),p.ie&&f)return t.preventDefault(),void n(u,!0);l.remove(),l.create(),u.once("keyup",e),u.once("paste",function(){u.off("keyup",e)})}}),u.on("paste",function(t){var e,n,r,o=d.isSet(),i=(e=u,n=bt(t.clipboardData||e.getDoc().dataTransfer),E.isMsEdge()?y.extend(n,{"text/html":""}):n),a="text"===c.get()||f,s=xt(i,P());f=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==v.navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?l.remove():Pt(i)||!_t(u,t,l.getLastRng()||u.selection.getRng())?(o||t.preventDefault(),!p.ie||o&&!t.ieFake||xt(i,"text/html")||(l.create(),u.dom.bind(l.getEl(),"paste",function(t){t.stopPropagation()}),u.getDoc().execCommand("Paste",!1,null),i["text/html"]=l.getHtml()),xt(i,"text/html")?(t.preventDefault(),s||(s=x(i["text/html"])),m(i,o,a,s)):h.setEditorTimeout(u,function(){m(i,o,a,s)},0)):l.remove()})},Ct=function(t){return p.ie&&t.inline?v.document.body:t.getBody()},kt=function(e,t,n){var r;Ct(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Rt(e,n)||e.fire("paste")})},St=function(t){return t.dom.get("mcepastebin")},Ot=function(t,e){return e===t},Rt=function(t,e){var n,r=St(t);return(n=r)&&"mcepastebin"===n.id&&Ot(e,r.innerHTML)},Ft=function(a){var s=g(null),u="%MCEPASTEBIN%";return{create:function(){return e=s,n=u,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Ct(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(p.ie||p.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),kt(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(St(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(a,s)},getEl:function(){return St(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=y.grep(Ct(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),y.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return s.get()},isDefault:function(){return Rt(a,u)},isDefaultContent:function(t){return Ot(u,t)}}},Et=function(n,t){var e=Ft(n);return n.on("preInit",function(){return Dt(a=n,e,t),void a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||s===p.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(s=t[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==s.indexOf("data:")||o(t[i]))});var a,s}),{pasteFormat:t,pasteHtml:function(t,e){return ht(n,t,e)},pasteText:function(t){return yt(n,t)},pasteImageData:function(t,e){return _t(n,t,e)},getDataTransferItems:bt,hasHtmlOrText:Pt,hasContentType:xt}},At=function(){},It=function(t,e,n){if(r=t,!1!==p.iOS||r===undefined||"function"!=typeof r.setData||!0===E.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(P(),e),!0}catch(o){return!1}var r},Mt=function(t,e,n,r){It(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)},Bt=function(s){return function(t,e){var n=c(t),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),s.dom.add(s.getBody(),r);var i=s.selection.getRng();o.focus();var a=s.dom.createRng();a.selectNodeContents(o),s.selection.setRng(a),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Ht=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},jt=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},Lt=function(t){var e,n;t.on("cut",(e=t,function(t){jt(e)&&Mt(t,Ht(e),Bt(e),function(){setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){jt(n)&&Mt(t,Ht(n),Bt(n),At)}))},Nt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),$t=function(t,e){return Nt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},Wt=function(t,e){t.focus(),t.selection.setRng(e)},zt=function(a,s,u){m.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),m.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=$t(a,t),!t.isDefaultPrevented()&&!u.get()){e=s.getDataTransferItems(t.dataTransfer);var r,o=s.hasContentType(e,P());if((s.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(t,n))&&n&&m.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),h.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),Wt(a,n),i=E.trimHtml(i),e["text/html"]?s.pasteHtml(i,o):s.pasteText(i)})}))}}}),a.on("dragstart",function(t){u.set(!0)}),a.on("dragover dragend",function(t){m.shouldPasteDataImages(a)&&!1===u.get()&&(t.preventDefault(),Wt(a,$t(a,t))),"dragend"===t.type&&u.set(!1)})},Ut=function(t){var e=t.plugins.paste,n=m.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=m.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function Vt(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function qt(t,e){if(!$.isWordContent(e))return e;var n=[];y.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br>&nbsp;[\\s\\r\\n]+|<br>)*","g");return e=E.filter(e,[[r,"$1"]]),e=E.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function Kt(t,e,n,r){if(r||n)return e;var l,o=m.getWebkitStyles(t);if(!1===m.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(l=o.split(/[, ]/)),l){var c=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=c.parseStyle(c.decode(n)),i={};if("none"===l)return e+r;for(var a=0;a<l.length;a++){var s=o[l[a]],u=c.getStyle(f,l[a],!0);/color/.test(l[a])&&(s=c.toHex(s),u=c.toHex(u)),u!==s&&(i[l[a]]=s)}return(i=c.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function Gt(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var Xt=function(t){var e,n;p.webkit&&Vt(t,Kt),p.ie&&(Vt(t,qt),n=Gt,(e=t).on("PastePostProcess",function(t){n(e,t.node)}))},Yt=function(t,e,n){var r=n.control;r.active("text"===e.pasteFormat.get()),t.on("PastePlainTextToggle",function(t){r.active(t.state)})},Zt=function(t,e){var n=function(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}(Yt,t,e);t.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),t.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:e.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};e.add("paste",function(t){if(!1===a(t)){var e=g(!1),n=g(!1),r=g(m.isPasteAsTextEnabled(t)?"text":"html"),o=Et(t,r),i=Xt(t);return Zt(t,o),l(t,o,e),Ut(t),Lt(t),zt(t,o,n),s(o,i)}})}(window);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L8

Insecure DOM Manipulation (XSS) in angular-sanitize.min.js

CWE-79
File Location: setup/pub/angular-sanitize/angular-sanitize.min.js:8
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- ["$$sanitizeUri",function(a){y&&k(n,z);return function(e){var c=[];G(e,w(c,function(b,c){return!/^unsafe:/.test(a(b,c))}));return c.join("")}}];this.enableSvg=function(a){return E(a)?(y=a,this):y};C=d.bind;k=d.extend;D=d.forEach;E=d.isDefined;p=d.lowercase;B=d.noop;G=function(a,e){null===a||void 0===a?a="":"string"!==typeof a&&(a=""+a);var c=u(a);if(!c)return"";var b=5;do{if(0===b)throw x("uinput");b--;a=c.innerHTML;c=u(a)}while(a!==c.innerHTML);for(b=c.firstChild;b;){switch(b.nodeType){case 1:e.start(b.nodeName.toLowerCase(),
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L8977

Insecure DOM Manipulation (XSS) in angular.js

CWE-79
File Location: setup/pub/angular/angular.js:8977
Security Score:
75 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- specialAttrHolder.innerHTML = '<span ' + attrName + '>';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L225

Insecure DOM Manipulation (XSS) in configure.js

CWE-79
File Location: app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js:225
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.blockMsgError.innerHTML = response.message;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L235

Insecure DOM Manipulation (XSS) in addresses.js

CWE-79
File Location: app/code/Magento/Customer/view/adminhtml/web/edit/tab/js/addresses.js:235
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- itemContainer[0].innerHTML = tmpl;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L29

Insecure DOM Manipulation (XSS) in translator.js

CWE-79
File Location: app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/lang/translator.js:29
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- elem.innerHTML = $this._tryTranslate(elem.innerHTML);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L369

Insecure DOM Manipulation (XSS) in ForceBlocks.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/ForceBlocks.js:369
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- sn.innerHTML = '';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1163

Insecure DOM Manipulation (XSS) in DOMUtils.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/DOMUtils.js:1163
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L835

Insecure DOM Manipulation (XSS) in Sizzle.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Sizzle.js:835
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- form.innerHTML = "<a name='" + id + "'/>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L939

Insecure DOM Manipulation (XSS) in Sizzle.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/dom/Sizzle.js:939
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1501

Insecure DOM Manipulation (XSS) in firebug-lite.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/firebug/firebug-lite.js:1501
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- source = script.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L200

Insecure DOM Manipulation (XSS) in fullpage.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js:200
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L202

Insecure DOM Manipulation (XSS) in fullpage.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js:202
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L203

Insecure DOM Manipulation (XSS) in fullpage.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/fullpage/js/fullpage.js:203
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in editor_plugin.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/layer/editor_plugin.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (function(){function a(b){do{if(b.className&&b.className.indexOf("mceItemLayer")!=-1){return b}}while(b=b.parentNode)}tinymce.create("tinymce.plugins.Layer",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceInsertLayer",d._insertLayer,d);b.addCommand("mceMoveForward",function(){d._move(1)});b.addCommand("mceMoveBackward",function(){d._move(-1)});b.addCommand("mceMakeAbsolute",function(){d._toggleAbsolute()});b.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});b.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});b.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});b.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});b.onInit.add(function(){var e=b.dom;if(tinymce.isIE){b.getDoc().execCommand("2D-Position",false,true)}});b.onMouseUp.add(function(f,h){var g=a(h.target);if(g){f.dom.setAttrib(g,"data-mce-style","")}});b.onMouseDown.add(function(f,j){var h=j.target,i=f.getDoc(),g;if(tinymce.isGecko){if(a(h)){if(i.designMode!=="on"){i.designMode="on";h=i.body;g=h.parentNode;g.removeChild(h);g.appendChild(h)}}else{if(i.designMode=="on"){i.designMode="off"}}}});b.onNodeChange.add(d._nodeChange,d);b.onVisualAid.add(d._visualAid,d)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(c,b,f){var d,e;d=this._getParentLayer(f);e=c.dom.getParent(f,"DIV,P,IMG");if(!e){b.setDisabled("absolute",1);b.setDisabled("moveforward",1);b.setDisabled("movebackward",1)}else{b.setDisabled("absolute",0);b.setDisabled("moveforward",!d);b.setDisabled("movebackward",!d);b.setActive("absolute",d&&d.style.position.toLowerCase()=="absolute")}},_visualAid:function(b,d,c){var f=b.dom;tinymce.each(f.select("div,p",d),function(g){if(/^(absolute|relative|fixed)$/i.test(g.style.position)){if(c){f.addClass(g,"mceItemVisualAid")}else{f.removeClass(g,"mceItemVisualAid")}f.addClass(g,"mceItemLayer")}})},_move:function(j){var c=this.editor,g,h=[],f=this._getParentLayer(c.selection.getNode()),e=-1,k=-1,b;b=[];tinymce.walk(c.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){b.push(d)}},"childNodes");for(g=0;g<b.length;g++){h[g]=b[g].style.zIndex?parseInt(b[g].style.zIndex):0;if(e<0&&b[g]==f){e=g}}if(j<0){for(g=0;g<h.length;g++){if(h[g]<h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{if(h[e]>0){b[e].style.zIndex=h[e]-1}}}else{for(g=0;g<h.length;g++){if(h[g]>h[e]){k=g;break}}if(k>-1){b[e].style.zIndex=h[k];b[k].style.zIndex=h[e]}else{b[e].style.zIndex=h[e]+1}}c.execCommand("mceRepaint")},_getParentLayer:function(b){return this.editor.dom.getParent(b,function(c){return c.nodeType==1&&/^(absolute|relative|static)$/i.test(c.style.position)})},_insertLayer:function(){var c=this.editor,e=c.dom,d=e.getPos(e.getParent(c.selection.getNode(),"*")),b=c.getBody();c.dom.add(b,"div",{style:{position:"absolute",left:d.x,top:(d.y>20?d.y:20),width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},c.selection.getContent()||c.getLang("layer.content"));if(tinymce.isIE){e.setHTML(b,b.innerHTML)}},_toggleAbsolute:function(){var b=this.editor,c=this._getParentLayer(b.selection.getNode());if(!c){c=b.dom.getParent(b.selection.getNode(),"DIV,P,IMG")}if(c){if(c.style.position.toLowerCase()=="absolute"){b.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""});b.dom.removeClass(c,"mceItemVisualAid");b.dom.removeClass(c,"mceItemLayer")}else{if(c.style.left==""){c.style.left=20+"px"}if(c.style.top==""){c.style.top=20+"px"}if(c.style.width==""){c.style.width=c.width?(c.width+"px"):"100px"}if(c.style.height==""){c.style.height=c.height?(c.height+"px"):"100px"}c.style.position="absolute";b.dom.setAttrib(c,"data-mce-style","");b.addVisual(b.getBody())}b.execCommand("mceRepaint");b.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in editor_plugin.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- (function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:o.encode(r).replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<p>"+o.encode(r).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1"]]);d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(g){var d=this.editor,e=b(d,"paste_text_linebreaktype"),i=b(d,"paste_text_replacements"),f=tinymce.is;function h(j){c(j,function(k){if(k.constructor==RegExp){g=g.replace(k,"")}else{g=g.replace(k[0],k[1])}})}if((typeof(g)==="string")&&(g.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(g)){h([/[\n\r]+/g])}else{h([/\r+/g])}h([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]);g=d.dom.decode(tinymce.html.Entities.encodeRaw(g));if(f(i,"array")){h(i)}else{if(f(i,"string")){h(new RegExp(i,"gi"))}}if(e=="none"){h([[/\n+/g," "]])}else{if(e=="br"){h([[/\n/g,"<br />"]])}else{if(e=="p"){h([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]])}else{h([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]])}}}d.execCommand("mceInsertContent",false,g)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L670

Insecure DOM Manipulation (XSS) in editor_plugin_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js:670
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L713

Insecure DOM Manipulation (XSS) in editor_plugin_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/paste/editor_plugin_src.js:713
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- html = p.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L322

Insecure DOM Manipulation (XSS) in editor_plugin_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/spellchecker/editor_plugin_src.js:322
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- var word = wordSpan.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L8

Insecure DOM Manipulation (XSS) in template.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/plugins/template/js/template.js:8
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4513

Insecure DOM Manipulation (XSS) in tiny_mce_jquery_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js:4513
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = '<br />' + html;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L10765

Insecure DOM Manipulation (XSS) in tiny_mce_jquery_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js:10765
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L12618

Insecure DOM Manipulation (XSS) in tiny_mce_jquery_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_jquery_src.js:12618
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L7532

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:7532
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- doc.body.innerHTML = content;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L11615

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:11615
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L14018

Insecure DOM Manipulation (XSS) in tiny_mce_prototype_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_prototype_src.js:14018
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- parent.innerHTML = '\uFEFF';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1272

Insecure DOM Manipulation (XSS) in tiny_mce_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_src.js:1272
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- elm.innerHTML = text;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L12519

Insecure DOM Manipulation (XSS) in tiny_mce_src.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/tiny_mce_src.js:12519
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- content = self.getBody().innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L42

Insecure DOM Manipulation (XSS) in insert-form.js

CWE-79
File Location: app/code/Magento/Ui/view/base/web/js/form/components/insert-form.js:42
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = elem;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L3

Insecure DOM Manipulation (XSS) in jquery.min.js

CWE-79
File Location: lib/web/jquery/jquery.min.js:3
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],d!=="__proto__"&&g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L883

Insecure DOM Manipulation (XSS) in knockout.js

CWE-79
File Location: lib/web/knockoutjs/knockout.js:883
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- div.innerHTML = markup;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L4

Insecure DOM Manipulation (XSS) in modernizr.2.0.6.js

CWE-79
File Location: lib/web/modernizr/modernizr.2.0.6.js:4
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- ;window.Modernizr=function(a,b,c){function C(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+o.join(c+" ")+c).split(" ");return B(d,b)}function B(a,b){for(var d in a)if(k[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function A(a,b){return!!~(""+a).indexOf(b)}function z(a,b){return typeof a===b}function y(a,b){return x(n.join(a+";")+(b||""))}function x(a){k.cssText=a}var d="2.0.6",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l,m=Object.prototype.toString,n=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),o="Webkit Moz O ms Khtml".split(" "),p={},q={},r={},s=[],t=function(a,c,d,e){var f,h,j,k=b.createElement("div");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:i+(d+1),k.appendChild(j);f=["&shy;","<style>",a,"</style>"].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},u,v={}.hasOwnProperty,w;!z(v,c)&&!z(v.call,c)?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],c)};var D=function(a,c){var d=a.join(""),f=c.length;t(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=i.csstransforms3d.offsetLeft===9},f,c)}([,["@media (",n.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join("")],[,"csstransforms3d"]);p.csstransforms=function(){return!!B(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},p.csstransforms3d=function(){var a=!!B(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d);return a};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));x(""),j=l=null,e._version=d,e._prefixes=n,e._domPrefixes=o,e.testProp=function(a){return B([a])},e.testAllProps=C,e.testStyles=t,e.prefixed=function(a){return C(a,"pfx")},g.className=g.className.replace(/\bno-js\b/,"")+(f?" js "+s.join(" "):"");return e}(this,this.document);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L20

Insecure DOM Manipulation (XSS) in modernizr.details.js

CWE-79
File Location: lib/web/modernizr/modernizr.details.js:20
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- el.innerHTML = '<summary>a</summary>b';
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2031

Insecure DOM Manipulation (XSS) in prototype.js

CWE-79
File Location: lib/web/prototype/prototype.js:2031
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- element.innerHTML = content.stripScripts();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: lib/web/tiny_mce_4/plugins/table/plugin.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(m){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){},x=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},C=function(e){return function(){return e}},o=function(e){return e};function b(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var t,n,r,i,u,g=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},c=function(e){return e()},f=C(!1),a=C(!0),l=f,s=a,d=function(){return h},h=(i={fold:function(e,t){return e()},is:l,isSome:l,isNone:s,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:r,orThunk:n,map:d,ap:d,each:function(){},bind:d,flatten:d,exists:l,forall:s,filter:d,equals:t=function(e){return e.isNone()},equals_:t,toArray:function(){return[]},toString:C("none()")},Object.freeze&&Object.freeze(i),i),p=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:l,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},ap:function(e){return e.fold(d,function(e){return p(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:h},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(l,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},S={some:p,none:d,from:function(e){return null===e||e===undefined?h:p(e)}},v=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===t}},w=v("string"),R=v("array"),T=v("boolean"),D=v("function"),O=v("number"),E=Array.prototype.slice,N=(u=Array.prototype.indexOf)===undefined?function(e,t){return j(e,t)}:function(e,t){return u.call(e,t)},k=function(e,t){return-1<N(e,t)},A=function(e,t){return L(e,t).isSome()},P=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},I=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},B=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},W=function(e,t,n){return function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){n=t(n,e)}),n},M=function(e,t,n){return I(e,function(e){n=t(n,e)}),n},_=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return S.some(o)}return S.none()},L=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return S.some(n);return S.none()},j=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},F=Array.prototype.push,z=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);F.apply(t,e[n])}return t},H=function(e,t){var n=P(e,t);return z(n)},U=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},q=function(e){var t=E.call(e,0);return t.reverse(),t},V=(D(Array.from)&&Array.from,Object.keys),G=function(e,t){for(var n=V(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},Y=function(e,r){return X(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},X=function(r,o){var i={};return G(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},K=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return I(t,function(e,t){r[e]=C(n[t])}),r}},J=function(e){return e.slice(0).sort()},$=function(e,t){throw new Error("All required keys ("+J(e).join(", ")+") were not specified. Specified keys were: "+J(t).join(", ")+".")},Q=function(e){throw new Error("Unsupported keys for object: "+J(e).join(", "))},Z=function(t,e){if(!R(e))throw new Error("The "+t+" fields must be an array. Was: "+e+".");I(e,function(e){if(!w(e))throw new Error("The value "+e+" in the "+t+" fields was not a string.")})},ee=function(e){var n=J(e);_(n,function(e,t){return t<n.length-1&&e===n[t+1]}).each(function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})},te=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return Z("required",o),Z("optional",i),ee(u),function(t){var n=V(t);U(o,function(e){return k(n,e)})||$(o,n);var e=B(n,function(e){return!k(u,e)});0<e.length&&Q(e);var r={};return I(o,function(e){r[e]=C(t[e])}),I(i,function(e){r[e]=C(Object.prototype.hasOwnProperty.call(t,e)?S.some(t[e]):S.none())}),r}},ne=(m.Node.ATTRIBUTE_NODE,m.Node.CDATA_SECTION_NODE,m.Node.COMMENT_NODE),re=m.Node.DOCUMENT_NODE,oe=(m.Node.DOCUMENT_TYPE_NODE,m.Node.DOCUMENT_FRAGMENT_NODE,m.Node.ELEMENT_NODE),ie=m.Node.TEXT_NODE,ue=(m.Node.PROCESSING_INSTRUCTION_NODE,m.Node.ENTITY_REFERENCE_NODE,m.Node.ENTITY_NODE,m.Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),ae=function(e){return e.dom().nodeType},ce=function(t){return function(e){return ae(e)===t}},le=function(e){return ae(e)===ne||"#comment"===ue(e)},fe=ce(oe),se=ce(ie),de=ce(re),me=function(e,t,n){if(!(w(n)||T(n)||O(n)))throw m.console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},ge=function(e,t,n){me(e.dom(),t,n)},he=function(e,t){var n=e.dom();G(t,function(e,t){me(n,t,e)})},pe=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},ve=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},be=function(e,t){e.dom().removeAttribute(t)},we=function(e){return M(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},ye=function(e,t){return-1!==e.indexOf(t)},xe=function(e){return e.style!==undefined&&D(e.style.getPropertyValue)},Ce=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Se=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:C(e)}},Re={fromHtml:function(e,t){var n=(t||m.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw m.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Se(n.childNodes[0])},fromTag:function(e,t){var n=(t||m.document).createElement(e);return Se(n)},fromText:function(e,t){var n=(t||m.document).createTextNode(e);return Se(n)},fromDom:Se,fromPoint:function(e,t,n){var r=e.dom();return S.from(r.elementFromPoint(t,n)).map(Se)}},Te=function(e){var t=se(e)?e.dom().parentNode:e.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)},De=Ce(function(){return Oe(Re.fromDom(m.document))}),Oe=function(e){var t=e.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return Re.fromDom(t)},Ee=function(e,t,n){if(!w(n))throw m.console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);xe(e)&&e.style.setProperty(t,n)},Ne=function(e,t,n){var r=e.dom();Ee(r,t,n)},ke=function(e,t){var n=e.dom();G(t,function(e,t){Ee(n,t,e)})},Ae=function(e,t){var n=e.dom(),r=m.window.getComputedStyle(n).getPropertyValue(t),o=""!==r||Te(e)?r:Pe(n,t);return null===o?undefined:o},Pe=function(e,t){return xe(e)?e.style.getPropertyValue(t):""},Ie=function(e,t){var n=e.dom(),r=Pe(n,t);return S.from(r).filter(function(e){return 0<e.length})},Be=function(e,t){var n,r,o=e.dom();r=t,xe(n=o)&&n.style.removeProperty(r),ve(e,"style")&&""===pe(e,"style").replace(/^\s+|\s+$/g,"")&&be(e,"style")},We="undefined"!=typeof m.window?m.window:Function("return this;")(),Me=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:We,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},_e=function(e,t){var n=Me(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n},Le=function(){return _e("Node")},je=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Fe=function(e,t){return je(e,t,Le().DOCUMENT_POSITION_CONTAINED_BY)},ze=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return Ue(r(1),r(2))},He=function(){return Ue(0,0)},Ue=function(e,t){return{major:e,minor:t}},qe={nu:Ue,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?He():ze(e,n)},unknown:He},Ve="Firefox",Ge=function(e,t){return function(){return t===e}},Ye=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Ge("Edge",t),isChrome:Ge("Chrome",t),isIE:Ge("IE",t),isOpera:Ge("Opera",t),isFirefox:Ge(Ve,t),isSafari:Ge("Safari",t)}},Xe={unknown:function(){return Ye({current:undefined,version:qe.unknown()})},nu:Ye,edge:C("Edge"),chrome:C("Chrome"),ie:C("IE"),opera:C("Opera"),firefox:C(Ve),safari:C("Safari")},Ke="Windows",Je="Android",$e="Solaris",Qe="FreeBSD",Ze=function(e,t){return function(){return t===e}},et=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Ze(Ke,t),isiOS:Ze("iOS",t),isAndroid:Ze(Je,t),isOSX:Ze("OSX",t),isLinux:Ze("Linux",t),isSolaris:Ze($e,t),isFreeBSD:Ze(Qe,t)}},tt={unknown:function(){return et({current:undefined,version:qe.unknown()})},nu:et,windows:C(Ke),ios:C("iOS"),android:C(Je),linux:C("Linux"),osx:C("OSX"),solaris:C($e),freebsd:C(Qe)},nt=function(e,t){var n=String(t).toLowerCase();return _(e,function(e){return e.search(n)})},rt=function(e,n){return nt(e,n).map(function(e){var t=qe.detect(e.versionRegexes,n);return{current:e.name,version:t}})},ot=function(e,n){return nt(e,n).map(function(e){var t=qe.detect(e.versionRegexes,n);return{current:e.name,version:t}})},it=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ut=function(t){return function(e){return ye(e,t)}},at=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return ye(e,"edge/")&&ye(e,"chrome")&&ye(e,"safari")&&ye(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,it],search:function(e){return ye(e,"chrome")&&!ye(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return ye(e,"msie")||ye(e,"trident")}},{name:"Opera",versionRegexes:[it,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ut("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ut("firefox")},{name:"Safari",versionRegexes:[it,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(ye(e,"safari")||ye(e,"mobile/"))&&ye(e,"applewebkit")}}],ct=[{name:"Windows",search:ut("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return ye(e,"iphone")||ye(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ut("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ut("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ut("linux"),versionRegexes:[]},{name:"Solaris",search:ut("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ut("freebsd"),versionRegexes:[]}],lt={browsers:C(at),oses:C(ct)},ft=function(e){var t,n,r,o,i,u,a,c,l,f,s,d=lt.browsers(),m=lt.oses(),g=rt(d,e).fold(Xe.unknown,Xe.nu),h=ot(m,e).fold(tt.unknown,tt.nu);return{browser:g,os:h,deviceType:(n=g,r=e,o=(t=h).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,u=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,c=o||u||a&&!0===/mobile/i.test(r),l=t.isiOS()||t.isAndroid(),f=l&&!c,s=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:C(o),isiPhone:C(i),isTablet:C(c),isPhone:C(f),isTouch:C(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:C(s)})}},st={detect:Ce(function(){var e=m.navigator.userAgent;return ft(e)})},dt=oe,mt=re,gt=function(e,t){var n=e.dom();if(n.nodeType!==dt)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},ht=function(e){return e.nodeType!==dt&&e.nodeType!==mt||0===e.childElementCount},pt=function(e,t){return e.dom()===t.dom()},vt=st.detect().browser.isIE()?function(e,t){return Fe(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},bt=gt,wt=function(e){return Re.fromDom(e.dom().ownerDocument)},yt=function(e){var t=e.dom();return S.from(t.parentNode).map(Re.fromDom)},xt=function(e,t){for(var n=D(t)?t:C(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=Re.fromDom(i);if(o.push(u),!0===n(u))break;r=i}return o},Ct=function(e){var t=e.dom();return S.from(t.previousSibling).map(Re.fromDom)},St=function(e){var t=e.dom();return S.from(t.nextSibling).map(Re.fromDom)},Rt=function(e){var t=e.dom();return P(t.childNodes,Re.fromDom)},Tt=function(e,t){var n=e.dom().childNodes;return S.from(n[t]).map(Re.fromDom)},Dt=(K("element","offset"),function(t,n){yt(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})}),Ot=function(e,t){St(e).fold(function(){yt(e).each(function(e){Nt(e,t)})},function(e){Dt(e,t)})},Et=function(t,n){Tt(t,0).fold(function(){Nt(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},Nt=function(e,t){e.dom().appendChild(t.dom())},kt=function(e,t){Dt(e,t),Nt(t,e)},At=function(r,o){I(o,function(e,t){var n=0===t?r:o[t-1];Ot(n,e)})},Pt=function(t,e){I(e,function(e){Nt(t,e)})},It=function(e){e.dom().textContent="",I(Rt(e),function(e){Bt(e)})},Bt=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Wt=function(e){var t,n=Rt(e);0<n.length&&(t=e,I(n,function(e){Dt(t,e)})),Bt(e)},Mt=(K("width","height"),K("width","height"),K("rows","columns")),_t=K("row","column"),Lt=(K("x","y"),K("element","rowspan","colspan")),jt=K("element","rowspan","colspan","isNew"),Ft=K("element","rowspan","colspan","row","column"),zt=K("element","cells","section"),Ht=K("element","isNew"),Ut=K("element","cells","section","isNew"),qt=K("cells","section"),Vt=K("details","section"),Gt=K("startRow","startCol","finishRow","finishCol"),Yt=function(e,t){var n=[];return I(Rt(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Yt(e,t))}),n},Xt=function(e,t,n){return r=function(e){return gt(e,t)},B(xt(e,n),r);var r},Kt=function(e,t){return n=function(e){return gt(e,t)},B(Rt(e),n);var n},Jt=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),ht(o)?[]:P(o.querySelectorAll(n),Re.fromDom);var n,r,o};function $t(e,t,n,r,o){return e(n,r)?S.some(n):D(o)&&o(n)?S.none():t(n,r,o)}var Qt,Zt,en,tn,nn,rn=function(e,t,n){for(var r=e.dom(),o=D(n)?n:C(!1);r.parentNode;){r=r.parentNode;var i=Re.fromDom(r);if(t(i))return S.some(i);if(o(i))break}return S.none()},on=function(e,t,n){return rn(e,function(e){return gt(e,t)},n)},un=function(e,t){return n=function(e){return gt(e,t)},_(e.dom().childNodes,x(n,Re.fromDom)).map(Re.fromDom);var n},an=function(e,t){return n=t,o=(r=e)===undefined?m.document:r.dom(),ht(o)?S.none():S.from(o.querySelector(n)).map(Re.fromDom);var n,r,o},cn=function(e,t,n){return $t(gt,on,e,t,n)},ln=function(e,t,n){return H(Rt(e),function(e){return gt(e,t)?n(e)?[e]:[]:ln(e,t,n)})},fn={firstLayer:function(e,t){return ln(e,t,C(!0))},filterFirstLayer:ln},sn=function(e,t,n){return void 0===n&&(n=f),n(t)?S.none():k(e,ue(t))?S.some(t):on(t,e.join(","),function(e){return gt(e,"table")||n(e)})},dn=function(t,e){return yt(e).map(function(e){return Kt(e,t)})},mn=b(dn,"th,td"),gn=b(dn,"tr"),hn=function(e,t){return parseInt(pe(e,t),10)},pn={cell:function(e,t){return sn(["td","th"],e,t)},firstCell:function(e){return an(e,"th,td")},cells:function(e){return fn.firstLayer(e,"th,td")},neighbourCells:mn,table:function(e,t){return cn(e,"table",t)},row:function(e,t){return sn(["tr"],e,t)},rows:function(e){return fn.firstLayer(e,"tr")},notCell:function(e,t){return sn(["caption","tr","tbody","tfoot","thead"],e,t)},neighbourRows:gn,attr:hn,grid:function(e,t,n){var r=hn(e,t),o=hn(e,n);return Mt(r,o)}},vn=function(e){var t=pn.rows(e);return P(t,function(e){var t=e,n=yt(t).map(function(e){var t=ue(e);return"tfoot"===t||"thead"===t||"tbody"===t?t:"tbody"}).getOr("tbody"),r=P(pn.cells(e),function(e){var t=ve(e,"rowspan")?parseInt(pe(e,"rowspan"),10):1,n=ve(e,"colspan")?parseInt(pe(e,"colspan"),10):1;return Lt(e,t,n)});return zt(t,r,n)})},bn=function(e,n){return P(e,function(e){var t=P(pn.cells(e),function(e){var t=ve(e,"rowspan")?parseInt(pe(e,"rowspan"),10):1,n=ve(e,"colspan")?parseInt(pe(e,"colspan"),10):1;return Lt(e,t,n)});return zt(e,t,n.section())})},wn=function(e,t){return e+","+t},yn=function(e,t){var n=H(e.all(),function(e){return e.cells()});return B(n,t)},xn={generate:function(e){var l={},t=[],n=e.length,f=0;I(e,function(e,a){var c=[];I(e.cells(),function(e){for(var t=0;l[wn(a,t)]!==undefined;)t++;for(var n=Ft(e.element(),e.rowspan(),e.colspan(),a,t),r=0;r<e.colspan();r++)for(var o=0;o<e.rowspan();o++){var i=t+r,u=wn(a+o,i);l[u]=n,f=Math.max(f,i+1)}c.push(n)}),t.push(zt(e.element(),c,e.section()))});var r=Mt(n,f);return{grid:C(r),access:C(l),all:C(t)}},getAt:function(e,t,n){var r=e.access()[wn(t,n)];return r!==undefined?S.some(r):S.none()},findItem:function(e,t,n){var r=yn(e,function(e){return n(t,e.element())});return 0<r.length?S.some(r[0]):S.none()},filterItems:yn,justCells:function(e){var t=P(e.all(),function(e){return e.cells()});return z(t)}},Cn=K("minRow","minCol","maxRow","maxCol"),Sn=function(e,t){var n,i,r,u,a,c,l,o,f,s,d=function(e){return gt(e.element(),t)},m=vn(e),g=xn.generate(m),h=(i=d,r=(n=g).grid().columns(),u=n.grid().rows(),a=r,l=c=0,G(n.access(),function(e){if(i(e)){var t=e.row(),n=t+e.rowspan()-1,r=e.column(),o=r+e.colspan()-1;t<u?u=t:c<n&&(c=n),r<a?a=r:l<o&&(l=o)}}),Cn(u,a,c,l)),p="th:not("+t+"),td:not("+t+")",v=fn.filterFirstLayer(e,"th,td",function(e){return gt(e,p)});return I(v,Bt),function(e,t,n,r){for(var o,i,u,a=t.grid().columns(),c=t.grid().rows(),l=0;l<c;l++)for(var f=!1,s=0;s<a;s++)l<n.minRow()||l>n.maxRow()||s<n.minCol()||s>n.maxCol()||(xn.getAt(t,l,s).filter(r).isNone()?(o=f,i=e[l].element(),u=Re.fromTag("td"),Nt(u,Re.fromTag("br")),(o?Nt:Et)(i,u)):f=!0)}(m,g,h,d),o=e,f=h,s=B(fn.firstLayer(o,"tr"),function(e){return 0===e.dom().childElementCount}),I(s,Bt),f.minCol()!==f.maxCol()&&f.minRow()!==f.maxRow()||I(fn.firstLayer(o,"th,td"),function(e){be(e,"rowspan"),be(e,"colspan")}),be(o,"width"),be(o,"height"),Be(o,"width"),Be(o,"height"),e},Rn=(Qt=se,Zt="text",en=function(e){return Qt(e)?S.from(e.dom().nodeValue):S.none()},tn=st.detect().browser,{get:function(e){if(!Qt(e))throw new Error("Can only get "+Zt+" value of a "+Zt+" node");return nn(e).getOr("")},getOption:nn=tn.isIE()&&10===tn.version.major?function(e){try{return en(e)}catch(t){return S.none()}}:en,set:function(e,t){if(!Qt(e))throw new Error("Can only set raw "+Zt+" value of a "+Zt+" node");e.dom().nodeValue=t}}),Tn=function(e){return Rn.get(e)},Dn=function(e){return Rn.getOption(e)},On=function(e,t){Rn.set(e,t)},En=function(e){return"img"===ue(e)?1:Dn(e).fold(function(){return Rt(e).length},function(e){return e.length})},Nn=["img","br"],kn=function(e){return Dn(e).filter(function(e){return 0!==e.trim().length||-1<e.indexOf("\xa0")}).isSome()||k(Nn,ue(e))},An=function(e){return r=kn,(o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(Re.fromDom(e.childNodes[t])))return S.some(Re.fromDom(e.childNodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return S.none()})(e.dom());var r,o},Pn=function(e){return In(e,kn)},In=function(e,i){var u=function(e){for(var t=Rt(e),n=t.length-1;0<=n;n--){var r=t[n];if(i(r))return S.some(r);var o=u(r);if(o.isSome())return o}return S.none()};return u(e)},Bn=function(e,t){return Re.fromDom(e.dom().cloneNode(t))},Wn=function(e){return Bn(e,!1)},Mn=function(e){return Bn(e,!0)},_n=function(e,t){var n,r,o,i,u=(n=e,r=t,o=Re.fromTag(r),i=we(n),he(o,i),o),a=Rt(Mn(e));return Pt(u,a),u},Ln=function(){var e=Re.fromTag("td");return Nt(e,Re.fromTag("br")),e},jn=function(e,t,n){var r=_n(e,t);return G(n,function(e,t){null===e?be(r,t):ge(r,t,e)}),r},Fn=function(e){return e},zn=function(e){return function(){return Re.fromTag("tr",e.dom())}},Hn=function(d,e,m){return{row:zn(e),cell:function(e){var r,o,i,t,n,u,a,c=wt(e.element()),l=Re.fromTag(ue(e.element()),c.dom()),f=m.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),s=0<f.length?(r=e.element(),o=l,i=f,An(r).map(function(e){var t=i.join(","),n=Xt(e,t,function(e){return pt(e,r)});return W(n,function(e,t){var n=Wn(t);return be(n,"contenteditable"),Nt(e,n),n},o)}).getOr(o)):l;return Nt(s,Re.fromTag("br")),t=e.element(),n=l,u=t.dom(),a=n.dom(),xe(u)&&xe(a)&&(a.style.cssText=u.style.cssText),Be(l,"height"),1!==e.colspan()&&Be(e.element(),"width"),d(e.element(),l),l},replace:jn,gap:Ln}},Un=function(e){return{row:zn(e),cell:Ln,replace:Fn,gap:Ln}},qn=function(e,t){return t.column()>=e.startCol()&&t.column()+t.colspan()-1<=e.finishCol()&&t.row()>=e.startRow()&&t.row()+t.rowspan()-1<=e.finishRow()},Vn=function(e,t){var n=t.column(),r=t.column()+t.colspan()-1,o=t.row(),i=t.row()+t.rowspan()-1;return n<=e.finishCol()&&r>=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},Gn=function(e,t){for(var n=!0,r=b(qn,t),o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)n=n&&xn.getAt(e,o,i).exists(r);return n?S.some(t):S.none()},Yn=function(e,t,n){var r=xn.findItem(e,t,pt),o=xn.findItem(e,n,pt);return r.bind(function(r){return o.map(function(e){return t=r,n=e,Gt(Math.min(t.row(),n.row()),Math.min(t.column(),n.column()),Math.max(t.row()+t.rowspan()-1,n.row()+n.rowspan()-1),Math.max(t.column()+t.colspan()-1,n.column()+n.colspan()-1));var t,n})})},Xn=Yn,Kn=function(t,e,n){return Yn(t,e,n).bind(function(e){return Gn(t,e)})},Jn=function(r,e,o,i){return xn.findItem(r,e,pt).bind(function(e){var t=0<o?e.row()+e.rowspan()-1:e.row(),n=0<i?e.column()+e.colspan()-1:e.column();return xn.getAt(r,t+o,n+i).map(function(e){return e.element()})})},$n=function(n,e,t){return Xn(n,e,t).map(function(e){var t=xn.filterItems(n,b(Vn,e));return P(t,function(e){return e.element()})})},Qn=function(e,t){return xn.findItem(e,t,function(e,t){return vt(t,e)}).map(function(e){return e.element()})},Zn=function(e){var t=vn(e);return xn.generate(t)},er=function(n,r,o){return pn.table(n).bind(function(e){var t=Zn(e);return Jn(t,n,r,o)})},tr=function(e,t,n){var r=Zn(e);return $n(r,t,n)},nr=function(e,t,n,r,o){var i=Zn(e),u=pt(e,n)?S.some(t):Qn(i,t),a=pt(e,o)?S.some(r):Qn(i,r);return u.bind(function(t){return a.bind(function(e){return $n(i,t,e)})})},rr=function(e,t,n){var r=Zn(e);return Kn(r,t,n)},or=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function ir(){return{up:C({selector:on,closest:cn,predicate:rn,all:xt}),down:C({selector:Jt,predicate:Yt}),styles:C({get:Ae,getRaw:Ie,set:Ne,remove:Be}),attrs:C({get:pe,set:ge,remove:be,copyTo:function(e,t){var n=we(e);he(t,n)}}),insert:C({before:Dt,after:Ot,afterAll:At,append:Nt,appendAll:Pt,prepend:Et,wrap:kt}),remove:C({unwrap:Wt,remove:Bt}),create:C({nu:Re.fromTag,clone:function(e){return Re.fromDom(e.dom().cloneNode(!1))},text:Re.fromText}),query:C({comparePosition:function(e,t){return e.dom().compareDocumentPosition(t.dom())},prevSibling:Ct,nextSibling:St}),property:C({children:Rt,name:ue,parent:yt,document:function(e){return e.dom().ownerDocument},isText:se,isComment:le,isElement:fe,getText:Tn,setText:On,isBoundary:function(e){return!!fe(e)&&("body"===ue(e)||k(or,ue(e)))},isEmptyTag:function(e){return!!fe(e)&&k(["br","img","hr","input"],ue(e))}}),eq:pt,is:bt}}var ur=K("left","right"),ar=K("first","second","splits"),cr=function(e,t,n){var r=e.property().children(t);return L(r,b(e.eq,n)).map(function(e){return{before:C(r.slice(0,e)),after:C(r.slice(e+1))}})},lr=function(r,o,e,t){var n=o(r,e);return W(t,function(e,t){var n=o(r,t);return fr(r,e,n)},n)},fr=function(t,e,n){return e.bind(function(e){return n.filter(b(t.eq,e))})},sr=function(e,t){return b(e.eq,t)},dr=function(t,e,n,r){void 0===r&&(r=f);var o=[e].concat(t.up().all(e)),i=[n].concat(t.up().all(n)),u=function(t){return L(t,r).fold(function(){return t},function(e){return t.slice(0,e+1)})},a=u(o),c=u(i),l=_(a,function(e){return A(c,sr(t,e))});return{firstpath:C(a),secondpath:C(c),shared:C(l)}},mr={sharedOne:function(e,t,n){return 0<n.length?lr(e,t,(r=n)[0],r.slice(1)):S.none();var r},subset:function(t,e,n){var r=dr(t,e,n);return r.shared().bind(function(e){return function(o,i,e,t){var u=o.property().children(i);if(o.eq(i,e[0]))return S.some([e[0]]);if(o.eq(i,t[0]))return S.some([t[0]]);var n=function(e){var t=q(e),n=L(t,sr(o,i)).getOr(-1),r=n<t.length-1?t[n+1]:t[n];return L(u,sr(o,r))},r=n(e),a=n(t);return r.bind(function(r){return a.map(function(e){var t=Math.min(r,e),n=Math.max(r,e);return u.slice(t,n+1)})})}(t,e,r.firstpath(),r.secondpath())})},ancestors:dr,breakToLeft:function(n,r,o){return cr(n,r,o).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.before().concat([o])),n.insert().appendAll(r,e.after()),n.insert().before(r,t),ur(t,r)})},breakToRight:function(n,r,e){return cr(n,r,e).map(function(e){var t=n.create().clone(r);return n.insert().appendAll(t,e.after()),n.insert().after(r,t),ur(r,t)})},breakPath:function(i,e,u,a){var c=function(e,t,o){var n=ar(e,S.none(),o);return u(e)?ar(e,t,o):i.property().parent(e).bind(function(r){return a(i,r,e).map(function(e){var t=[{first:e.left,second:e.right}],n=u(r)?r:e.left();return c(n,S.some(e.right()),o.concat(t))})}).getOr(n)};return c(e,S.none(),[])}},gr=ir(),hr={sharedOne:function(n,e){return mr.sharedOne(gr,function(e,t){return n(t)},e)},subset:function(e,t){return mr.subset(gr,e,t)},ancestors:function(e,t,n){return mr.ancestors(gr,e,t,n)},breakToLeft:function(e,t){return mr.breakToLeft(gr,e,t)},breakToRight:function(e,t){return mr.breakToRight(gr,e,t)},breakPath:function(e,t,r){return mr.breakPath(gr,e,t,function(e,t,n){return r(t,n)})}},pr={create:te(["boxes","start","finish"],[])},vr=function(e){return on(e,"table")},br=function(a,c,r){var l=function(t){return function(e){return r!==undefined&&r(e)||pt(e,t)}};return pt(a,c)?S.some(pr.create({boxes:S.some([a]),start:a,finish:c})):vr(a).bind(function(u){return vr(c).bind(function(i){if(pt(u,i))return S.some(pr.create({boxes:tr(u,a,c),start:a,finish:c}));if(vt(u,i)){var e=0<(t=Xt(c,"td,th",l(u))).length?t[t.length-1]:c;return S.some(pr.create({boxes:nr(u,a,u,c,i),start:a,finish:e}))}if(vt(i,u)){var t,n=0<(t=Xt(a,"td,th",l(i))).length?t[t.length-1]:a;return S.some(pr.create({boxes:nr(i,a,u,c,i),start:a,finish:n}))}return hr.ancestors(a,c).shared().bind(function(e){return cn(e,"table",r).bind(function(e){var t=Xt(c,"td,th",l(e)),n=0<t.length?t[t.length-1]:c,r=Xt(a,"td,th",l(e)),o=0<r.length?r[r.length-1]:a;return S.some(pr.create({boxes:nr(e,a,u,c,i),start:o,finish:n}))})})})})},wr=br,yr=function(e,t){var n=Jt(e,t);return 0<n.length?S.some(n):S.none()},xr=function(e,t,n,r,o){return(i=e,u=o,_(i,function(e){return gt(e,u)})).bind(function(e){return er(e,t,n).bind(function(e){return n=r,on(t=e,"table").bind(function(e){return an(e,n).bind(function(e){return br(e,t).bind(function(t){return t.boxes().map(function(e){return{boxes:C(e),start:C(t.start()),finish:C(t.finish())}})})})});var t,n})});var i,u},Cr=function(e,t,r){return an(e,t).bind(function(n){return an(e,r).bind(function(t){return hr.sharedOne(vr,[n,t]).map(function(e){return{first:C(n),last:C(t),table:C(e)}})})})},Sr=function(e,t){return yr(e,t)},Rr=function(o,e,t){return Cr(o,e,t).bind(function(n){var e=function(e){return pt(o,e)},t=on(n.first(),"thead,tfoot,tbody,table",e),r=on(n.last(),"thead,tfoot,tbody,table",e);return t.bind(function(t){return r.bind(function(e){return pt(t,e)?rr(n.table(),n.first(),n.last()):S.none()})})})},Tr="data-mce-selected",Dr="data-mce-first-selected",Or="data-mce-last-selected",Er={selected:C(Tr),selectedSelector:C("td[data-mce-selected],th[data-mce-selected]"),attributeSelector:C("[data-mce-selected]"),firstSelected:C(Dr),firstSelectedSelector:C("td[data-mce-first-selected],th[data-mce-first-selected]"),lastSelected:C(Or),lastSelectedSelector:C("td[data-mce-last-selected],th[data-mce-last-selected]")},Nr=function(u){if(!R(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],n={};return I(u,function(e,r){var t=V(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!R(i))throw new Error("case arguments must be an array");a.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=V(e);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!U(a,function(e){return k(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return e[o].apply(null,n)},log:function(e){m.console.log(e,{constructors:a,constructor:o,params:n})}}}}),n},kr=Nr([{none:[]},{multiple:["elements"]},{single:["selection"]}]),Ar={cata:function(e,t,n,r){return e.fold(t,n,r)},none:kr.none,multiple:kr.multiple,single:kr.single},Pr=function(e,t){return Ar.cata(t.get(),C([]),o,C([e]))},Ir=function(n,e){return Ar.cata(e.get(),S.none,function(t,e){return 0===t.length?S.none():Rr(n,Er.firstSelectedSelector(),Er.lastSelectedSelector()).bind(function(e){return 1<t.length?S.some({bounds:C(e),cells:C(t)}):S.none()})},S.none)},Br=function(e,t){var n=Pr(e,t);return 0<n.length&&U(n,function(e){return ve(e,"rowspan")&&1<parseInt(pe(e,"rowspan"),10)||ve(e,"colspan")&&1<parseInt(pe(e,"colspan"),10)})?S.some(n):S.none()},Wr=Pr,Mr=function(e){return{element:C(e),mergable:S.none,unmergable:S.none,selection:C([e])}},_r=K("element","clipboard","generators"),Lr={noMenu:Mr,forMenu:function(e,t,n){return{element:C(n),mergable:C(Ir(t,e)),unmergable:C(Br(n,e)),selection:C(Wr(n,e))}},notCell:function(e){return Mr(e)},paste:_r,pasteRows:function(e,t,n,r,o){return{element:C(n),mergable:S.none,unmergable:S.none,selection:C(Wr(n,e)),clipboard:C(r),generators:C(o)}}},jr=function(f,e,s,d){f.on("BeforeGetContent",function(n){!0===n.selection&&Ar.cata(e.get(),y,function(e){var t;n.preventDefault(),(t=e,pn.table(t[0]).map(Mn).map(function(e){return[Sn(e,Er.attributeSelector())]})).each(function(e){var t;n.content="text"===n.format?P(e,function(e){return e.dom().innerText}).join(""):(t=f,P(e,function(e){return t.selection.serializer.serialize(e.dom(),{})}).join(""))})},y)}),f.on("BeforeSetContent",function(l){!0===l.selection&&!0===l.paste&&S.from(f.dom.getParent(f.selection.getStart(),"th,td")).each(function(e){var c=Re.fromDom(e);pn.table(c).each(function(t){var e,n,r,o=B((e=l.content,(r=(n||m.document).createElement("div")).innerHTML=e,Rt(Re.fromDom(r))),function(e){return"meta"!==ue(e)});if(1===o.length&&"table"===ue(o[0])){l.preventDefault();var i=Re.fromDom(f.getDoc()),u=Un(i),a=Lr.paste(c,o[0],u);s.pasteCells(t,a).each(function(e){f.selection.setRng(e),f.focus(),d.clear(t)})}})})})};function Fr(r,o){var e=function(e){var t=o(e);if(t<=0||null===t){var n=Ae(e,r);return parseFloat(n)||0}return t},i=function(o,e){return M(e,function(e,t){var n=Ae(o,t),r=n===undefined?0:parseInt(n,10);return isNaN(r)?e:e+r},0)};return{set:function(e,t){if(!O(t)&&!t.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+t);var n=e.dom();xe(n)&&(n.style[r]=t+"px")},get:e,getOuter:e,aggregate:i,max:function(e,t,n){var r=i(e,n);return r<t?t-r:0}}}var zr=Fr("height",function(e){var t=e.dom();return Te(e)?t.getBoundingClientRect().height:t.offsetHeight}),Hr=function(e){return zr.get(e)},Ur=function(e){return zr.getOuter(e)},qr=Fr("width",function(e){return e.dom().offsetWidth}),Vr=function(e){return qr.get(e)},Gr=function(e){return qr.getOuter(e)},Yr=st.detect(),Xr=function(e,t,n){return r=Ae(e,t),o=n,i=parseFloat(r),isNaN(i)?o:i;var r,o,i},Kr=function(e){return Yr.browser.isIE()||Yr.browser.isEdge()?(n=Xr(t=e,"padding-top",0),r=Xr(t,"padding-bottom",0),o=Xr(t,"border-top-width",0),i=Xr(t,"border-bottom-width",0),u=t.dom().getBoundingClientRect().height,"border-box"===Ae(t,"box-sizing")?u:u-n-r-(o+i)):Xr(e,"height",Hr(e));var t,n,r,o,i,u},Jr=/(\d+(\.\d+)?)(\w|%)*/,$r=/(\d+(\.\d+)?)%/,Qr=/(\d+(\.\d+)?)px|em/,Zr=function(e,t){Ne(e,"height",t+"px")},eo=function(e,t,n,r){var o,i,u,a,c,l,f,s,d,m=parseInt(e,10);return s=l="%",d=(f=e).length-l.length,""!==s&&(f.length<s.length||f.substr(d,d+s.length)!==s)||"table"===ue(t)?m:(o=t,i=m,u=n,a=r,c=pn.table(o).map(function(e){var t=u(e);return Math.floor(i/100*t)}).getOr(i),a(o,c),c)},to=function(e){var t,n=Ie(t=e,"height").getOrThunk(function(){return Kr(t)+"px"});return n?eo(n,e,Hr,Zr):Hr(e)},no=function(e,t){return ve(e,t)?parseInt(pe(e,t),10):1},ro=function(e){return Ie(e,"width").fold(function(){return S.from(pe(e,"width"))},function(e){return S.some(e)})},oo=function(e,t){return e/t.pixelWidth()*100},io={percentageBasedSizeRegex:C($r),pixelBasedSizeRegex:C(Qr),setPixelWidth:function(e,t){Ne(e,"width",t+"px")},setPercentageWidth:function(e,t){Ne(e,"width",t+"%")},setHeight:Zr,getPixelWidth:function(t,n){return ro(t).fold(function(){return Vr(t)},function(e){return function(e,t,n){var r=Qr.exec(t);if(null!==r)return parseInt(r[1],10);var o=$r.exec(t);if(null!==o){var i=parseFloat(o[1]);return i/100*n.pixelWidth()}return Vr(e)}(t,e,n)})},getPercentageWidth:function(t,n){return ro(t).fold(function(){var e=Vr(t);return oo(e,n)},function(e){return function(e,t,n){var r=$r.exec(t);if(null!==r)return parseFloat(r[1]);var o=Vr(e);return oo(o,n)}(t,e,n)})},getGenericWidth:function(e){return ro(e).bind(function(e){var t=Jr.exec(e);return null!==t?S.some({width:C(parseFloat(t[1])),unit:C(t[3])}):S.none()})},setGenericWidth:function(e,t,n){Ne(e,"width",t+n)},getHeight:function(e){return n="rowspan",to(t=e)/no(t,n);var t,n},getRawWidth:ro},uo=function(n,r){io.getGenericWidth(n).each(function(e){var t=e.width()/2;io.setGenericWidth(n,t,e.unit()),io.setGenericWidth(r,t,e.unit())})},ao=function(n,r){return{left:C(n),top:C(r),translate:function(e,t){return ao(n+e,r+t)}}},co=ao,lo=function(e,t){return e!==undefined?e:t!==undefined?t:0},fo=function(e){var t,n,r=e.dom().ownerDocument,o=r.body,i=(t=Re.fromDom(r),(n=t.dom())===n.window&&t instanceof m.Window?t:de(t)?n.defaultView||n.parentWindow:null),u=r.documentElement,a=lo(i.pageYOffset,u.scrollTop),c=lo(i.pageXOffset,u.scrollLeft),l=lo(u.clientTop,o.clientTop),f=lo(u.clientLeft,o.clientLeft);return so(e).translate(c-f,a-l)},so=function(e){var t,n,r,o=e.dom(),i=o.ownerDocument,u=i.body,a=Re.fromDom(i.documentElement);return u===o?co(u.offsetLeft,u.offsetTop):(t=e,n=a||Re.fromDom(m.document.documentElement),rn(t,b(pt,n)).isSome()?(r=o.getBoundingClientRect(),co(r.left,r.top)):co(0,0))},mo=K("row","y"),go=K("col","x"),ho=function(e){return fo(e).left()+Gr(e)},po=function(e){return fo(e).left()},vo=function(e,t){return go(e,po(t))},bo=function(e,t){return go(e,ho(t))},wo=function(e){return fo(e).top()},yo=function(e,t){return mo(e,wo(t))},xo=function(e,t){return mo(e,wo(t)+Ur(t))},Co=function(n,t,r){if(0===r.length)return[];var e=P(r.slice(1),function(e,t){return e.map(function(e){return n(t,e)})}),o=r[r.length-1].map(function(e){return t(r.length-1,e)});return e.concat([o])},So={height:{delta:o,positions:function(e){return Co(yo,xo,e)},edge:wo},rtl:{delta:function(e){return-e},edge:ho,positions:function(e){return Co(bo,vo,e)}},ltr:{delta:o,edge:po,positions:function(e){return Co(vo,bo,e)}}},Ro={ltr:So.ltr,rtl:So.rtl};function To(t){var n=function(e){return t(e).isRtl()?Ro.rtl:Ro.ltr};return{delta:function(e,t){return n(t).delta(e,t)},edge:function(e){return n(e).edge(e)},positions:function(e,t){return n(t).positions(e,t)}}}var Do=function(e){var t=vn(e);return xn.generate(t).grid()},Oo=function(){return(Oo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Eo=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},No=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()},ko=function(e,t,n,r){n===r?be(e,t):ge(e,t,n)},Ao=function(o,e){var i=[],u=[],t=function(e,t){0<e.length?function(e,t){var n=un(o,t).getOrThunk(function(){var e=Re.fromTag(t,wt(o).dom());return Nt(o,e),e});It(n);var r=P(e,function(e){e.isNew()&&i.push(e.element());var t=e.element();return It(t),I(e.cells(),function(e){e.isNew()&&u.push(e.element()),ko(e.element(),"colspan",e.colspan(),1),ko(e.element(),"rowspan",e.rowspan(),1),Nt(t,e.element())}),t});Pt(n,r)}(e,t):un(o,t).each(Bt)},n=[],r=[],a=[];return I(e,function(e){switch(e.section()){case"thead":n.push(e);break;case"tbody":r.push(e);break;case"tfoot":a.push(e)}}),t(n,"thead"),t(r,"tbody"),t(a,"tfoot"),{newRows:C(i),newCells:C(u)}},Po=function(e){return P(e,function(e){var n=Wn(e.element());return I(e.cells(),function(e){var t=Mn(e.element());ko(t,"colspan",e.colspan(),1),ko(t,"rowspan",e.rowspan(),1),Nt(n,t)}),n})},Io=function(e,t){var n=pe(e,t);return n===undefined||""===n?[]:n.split(" ")},Bo=function(e){return e.dom().classList!==undefined},Wo=function(e,t){return o=t,i=Io(n=e,r="class").concat([o]),ge(n,r,i.join(" ")),!0;var n,r,o,i},Mo=function(e,t){return o=t,0<(i=B(Io(n=e,r="class"),function(e){return e!==o})).length?ge(n,r,i.join(" ")):be(n,r),!1;var n,r,o,i},_o=function(e,t){Bo(e)?e.dom().classList.add(t):Wo(e,t)},Lo=function(e){0===(Bo(e)?e.dom().classList:Io(e,"class")).length&&be(e,"class")},jo=function(e,t){return Bo(e)&&e.dom().classList.contains(t)},Fo=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n},zo=function(t,n){if(n<0||n>=t.length-1)return S.none();var e=t[n].fold(function(){var e=q(t.slice(0,n));return No(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:0})}),r=t[n+1].fold(function(){var e=t.slice(n+1);return No(e,function(e,t){return e.map(function(e){return{value:e,delta:t+1}})})},function(e){return S.some({value:e,delta:1})});return e.bind(function(n){return r.map(function(e){var t=e.delta+n.delta;return Math.abs(e.value-n.value)/t})})},Ho=function(e,t,n){var r=e();return _(r,t).orThunk(function(){return S.from(r[0]).orThunk(n)}).map(function(e){return e.element()})},Uo=function(n){var e=n.grid(),t=Fo(0,e.columns()),r=Fo(0,e.rows());return P(t,function(t){return Ho(function(){return H(r,function(e){return xn.getAt(n,e,t).filter(function(e){return e.column()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return xn.getAt(n,0,t)})})},qo=function(n){var e=n.grid(),t=Fo(0,e.rows()),r=Fo(0,e.columns());return P(t,function(t){return Ho(function(){return H(r,function(e){return xn.getAt(n,t,e).filter(function(e){return e.row()===t}).fold(C([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return xn.getAt(n,t,0)})})},Vo=function(e){var t=e.replace(/\./g,"-");return{resolve:function(e){return t+"-"+e}}},Go={resolve:Vo("ephox-snooker").resolve},Yo=function(e,t,n,r,o){var i=Re.fromTag("div");return ke(i,{position:"absolute",left:t-r/2+"px",top:n+"px",height:o+"px",width:r+"px"}),he(i,{"data-column":e,role:"presentation"}),i},Xo=function(e,t,n,r,o){var i=Re.fromTag("div");return ke(i,{position:"absolute",left:t+"px",top:n-o/2+"px",height:o+"px",width:r+"px"}),he(i,{"data-row":e,role:"presentation"}),i},Ko=Go.resolve("resizer-bar"),Jo=Go.resolve("resizer-rows"),$o=Go.resolve("resizer-cols"),Qo=function(e){var t=Jt(e.parent(),"."+Ko);I(t,Bt)},Zo=function(n,e,r){var o=n.origin();I(e,function(e,t){e.each(function(e){var t=r(o,e);_o(t,Ko),Nt(n.parent(),t)})})},ei=function(e,t,n,r,o,i){var u,a,c,l,f=fo(t),s=0<n.length?o.positions(n,t):[];u=e,a=s,c=f,l=Gr(t),Zo(u,a,function(e,t){var n=Xo(t.row(),c.left()-e.left(),t.y()-e.top(),l,7);return _o(n,Jo),n});var d,m,g,h,p=0<r.length?i.positions(r,t):[];d=e,m=p,g=f,h=Ur(t),Zo(d,m,function(e,t){var n=Yo(t.col(),t.x()-e.left(),g.top()-e.top(),7,h);return _o(n,$o),n})},ti=function(e,t){var n=Jt(e.parent(),"."+Ko);I(n,t)},ni=function(e,t,n,r){Qo(e);var o=vn(t),i=xn.generate(o),u=qo(i),a=Uo(i);ei(e,t,u,a,n,r)},ri=function(e){ti(e,function(e){Ne(e,"display","none")})},oi=function(e){ti(e,function(e){Ne(e,"display","block")})},ii=Qo,ui=function(e){return jo(e,Jo)},ai=function(e){return jo(e,$o)},ci=function(e,t){return qt(t,e.section())},li=function(e,t){return e.cells()[t]},fi={addCell:function(e,t,n){var r=e.cells(),o=r.slice(0,t),i=r.slice(t),u=o.concat([n]).concat(i);return ci(e,u)},setCells:ci,mutateCell:function(e,t,n){e.cells()[t]=n},getCell:li,getCellElement:function(e,t){return li(e,t).element()},mapCells:function(e,t){var n=e.cells(),r=P(n,t);return qt(r,e.section())},cellLength:function(e){return e.cells().length}},si=function(e,t){if(0===e.length)return 0;var n=e[0];return L(e,function(e){return!t(n.element(),e.element())}).fold(function(){return e.length},function(e){return e})},di=function(e,t,n,r){var o,i,u,a,c=(o=e,i=t,o[i]).cells().slice(n),l=si(c,r),f=(u=e,a=n,P(u,function(e){return fi.getCell(e,a)})).slice(t),s=si(f,r);return{colspan:C(l),rowspan:C(s)}},mi=function(o,i){var u=P(o,function(e,t){return P(e.cells(),function(e,t){return!1})});return P(o,function(e,r){var t=H(e.cells(),function(e,t){if(!1===u[r][t]){var n=di(o,r,t,i);return function(e,t,n,r){for(var o=e;o<e+n;o++)for(var i=t;i<t+r;i++)u[o][i]=!0}(r,t,n.rowspan(),n.colspan()),[jt(e.element(),n.rowspan(),n.colspan(),e.isNew())]}return[]});return Vt(t,e.section())})},gi=function(e,t,n){for(var r=[],o=0;o<e.grid().rows();o++){for(var i=[],u=0;u<e.grid().columns();u++){var a=xn.getAt(e,o,u).map(function(e){return Ht(e.element(),n)}).getOrThunk(function(){return Ht(t.gap(),!0)});i.push(a)}var c=qt(i,e.all()[o].section());r.push(c)}return r},hi=function(e,r){return P(e,function(e){var t,n=(t=e.details(),No(t,function(e){return yt(e.element()).map(function(e){var t=yt(e).isNone();return Ht(e,t)})}).getOrThunk(function(){return Ht(r.row(),!0)}));return Ut(n.element(),e.details(),e.section(),n.isNew())})},pi=function(e,t){var n=mi(e,pt);return hi(n,t)},vi=function(e,t){var n=z(P(e.all(),function(e){return e.cells()}));return _(n,function(e){return pt(t,e.element())})},bi=function(a,c,l,f,s){return function(n,r,e,o,i){var t=vn(r),u=xn.generate(t);return c(u,e).map(function(e){var t=gi(u,o,!1),n=a(t,e,pt,s(o)),r=pi(n.grid(),o);return{grid:C(r),cursor:n.cursor}}).fold(function(){return S.none()},function(e){var t=Ao(r,e.grid());return l(r,e.grid(),i),f(r),ni(n,r,So.height,i),S.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})})}},wi=function(t,e){return pn.cell(e.element()).bind(function(e){return vi(t,e)})},yi=function(t,e){var n=P(e.selection(),function(e){return pn.cell(e).bind(function(e){return vi(t,e)})}),r=Eo(n);return 0<r.length?S.some({cells:r,generators:e.generators,clipboard:e.clipboard}):S.none()},xi=function(t,e){var n=P(e.selection(),function(e){return pn.cell(e).bind(function(e){return vi(t,e)})}),r=Eo(n);return 0<r.length?S.some(r):S.none()},Ci=function(n){return{is:function(e){return n===e},isValue:a,isError:f,getOr:C(n),getOrThunk:C(n),getOrDie:C(n),or:function(e){return Ci(n)},orThunk:function(e){return Ci(n)},fold:function(e,t){return t(n)},map:function(e){return Ci(e(n))},mapError:function(e){return Ci(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return S.some(n)}}},Si=function(n){return{is:f,isValue:f,isError:a,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return Si(n)},mapError:function(e){return Si(e(n))},each:y,bind:function(e){return Si(n)},exists:f,forall:a,toOption:S.none}},Ri={value:Ci,error:Si,fromOption:function(e,t){return e.fold(function(){return Si(t)},Ci)}},Ti=function(e,t){return P(e,function(){return Ht(t.cell(),!0)})},Di=function(t,e,n){return t.concat(function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(e,function(e){return fi.setCells(t[t.length-1],Ti(t[t.length-1].cells(),n))}))},Oi=function(e,t,n){return P(e,function(e){return fi.setCells(e,e.cells().concat(Ti(Fo(0,t),n)))})},Ei=function(e,t,n){if(e.row()>=t.length||e.column()>fi.cellLength(t[0]))return Ri.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=t.slice(e.row()),o=r[0].cells().slice(e.column()),i=fi.cellLength(n[0]),u=n.length;return Ri.value({rowDelta:C(r.length-u),colDelta:C(o.length-i)})},Ni=function(e,t){var n=fi.cellLength(e[0]),r=fi.cellLength(t[0]);return{rowDelta:C(0),colDelta:C(n-r)}},ki=function(e,t,n){var r=t.colDelta()<0?Oi:o;return(t.rowDelta()<0?Di:o)(r(e,Math.abs(t.colDelta()),n),Math.abs(t.rowDelta()),n)},Ai=function(e,t,n,r){if(0===e.length)return e;for(var o=t.startRow();o<=t.finishRow();o++)for(var i=t.startCol();i<=t.finishCol();i++)fi.mutateCell(e[o],i,Ht(r(),!1));return e},Pi=function(e,t,n,r){for(var o=!0,i=0;i<e.length;i++)for(var u=0;u<fi.cellLength(e[0]);u++){var a=n(fi.getCellElement(e[i],u),t);!0===a&&!1===o?fi.mutateCell(e[i],u,Ht(r(),!0)):!0===a&&(o=!1)}return e},Ii=function(i,n,u,a){if(0<n&&n<i.length){var e=i[n-1].cells(),t=(r=u,M(e,function(e,t){return A(e,function(e){return r(e.element(),t.element())})?e:e.concat([t])},[]));I(t,function(r){for(var o=S.none(),e=function(n){for(var e=function(t){var e=i[n].cells()[t];u(e.element(),r.element())&&(o.isNone()&&(o=S.some(a())),o.each(function(e){fi.mutateCell(i[n],t,Ht(e,!0))}))},t=0;t<fi.cellLength(i[0]);t++)e(t)},t=n;t<i.length;t++)e(t)})}var r;return i},Bi=function(n,r,o,i,u){return Ei(n,r,o).map(function(e){var t=ki(r,e,i);return function(e,t,n,r,o){for(var i,u,a,c,l,f=e.row(),s=e.column(),d=f+n.length,m=s+fi.cellLength(n[0]),g=f;g<d;g++)for(var h=s;h<m;h++){i=t,u=g,a=h,l=c=void 0,c=b(o,fi.getCell(i[u],a).element()),l=i[u],1<i.length&&1<fi.cellLength(l)&&(0<a&&c(fi.getCellElement(l,a-1))||a<l.cells().length-1&&c(fi.getCellElement(l,a+1))||0<u&&c(fi.getCellElement(i[u-1],a))||u<i.length-1&&c(fi.getCellElement(i[u+1],a)))&&Pi(t,fi.getCellElement(t[g],h),o,r.cell);var p=fi.getCellElement(n[g-f],h-s),v=r.replace(p);fi.mutateCell(t[g],h,Ht(v,!0))}return t}(n,t,o,i,u)})},Wi=function(e,t,n,r,o){Ii(t,e,o,r.cell);var i=Ni(n,t),u=ki(n,i,r),a=Ni(t,u),c=ki(t,a,r);return c.slice(0,e).concat(u).concat(c.slice(e,c.length))},Mi=function(n,r,e,o,i){var t=n.slice(0,r),u=n.slice(r),a=fi.mapCells(n[e],function(e,t){return 0<r&&r<n.length&&o(fi.getCellElement(n[r-1],t),fi.getCellElement(n[r],t))?fi.getCell(n[r],t):Ht(i(e.element(),o),!0)});return t.concat([a]).concat(u)},_i=function(e,n,r,o,i){return P(e,function(e){var t=0<n&&n<fi.cellLength(e)&&o(fi.getCellElement(e,n-1),fi.getCellElement(e,n))?fi.getCell(e,n):Ht(i(fi.getCellElement(e,r),o),!0);return fi.addCell(e,n,t)})},Li=function(e,r,o,i,u){var a=o+1;return P(e,function(e,t){var n=t===r?Ht(u(fi.getCellElement(e,o),i),!0):fi.getCell(e,o);return fi.addCell(e,a,n)})},ji=function(e,t,n,r,o){var i=t+1,u=e.slice(0,i),a=e.slice(i),c=fi.mapCells(e[t],function(e,t){return t===n?Ht(o(e.element(),r),!0):e});return u.concat([c]).concat(a)},Fi=function(e,t,n){return e.slice(0,t).concat(e.slice(n+1))},zi=function(e,n,r){var t=P(e,function(e){var t=e.cells().slice(0,n).concat(e.cells().slice(r+1));return qt(t,e.section())});return B(t,function(e){return 0<e.cells().length})},Hi=function(e,n,r,o){return P(e,function(e){return fi.mapCells(e,function(e){return t=e,A(n,function(e){return r(t.element(),e.element())})?Ht(o(e.element(),r),!0):e;var t})})},Ui=function(e,t,n,r){return fi.getCellElement(e[t],n)!==undefined&&0<t&&r(fi.getCellElement(e[t-1],n),fi.getCellElement(e[t],n))},qi=function(e,t,n){return 0<t&&n(fi.getCellElement(e,t-1),fi.getCellElement(e,t))},Vi=function(n,r,o,e){var t=H(n,function(e,t){return Ui(n,t,r,o)||qi(e,r,o)?[]:[fi.getCell(e,r)]});return Hi(n,t,o,e)},Gi=function(n,r,o,e){var i=n[r],t=H(i.cells(),function(e,t){return Ui(n,r,t,o)||qi(i,t,o)?[]:[e]});return Hi(n,t,o,e)},Yi=Nr([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Xi=Oo({},Yi),Ki=function(e,t,i,u){var n,r,a=e.slice(0),o=(r=t,0===(n=e).length?Xi.none():1===n.length?Xi.only(0):0===r?Xi.left(0,1):r===n.length-1?Xi.right(r-1,r):0<r&&r<n.length-1?Xi.middle(r-1,r,r+1):Xi.none()),c=function(e){return P(e,C(0))},l=C(c(a)),f=function(e,t){if(0<=i){var n=Math.max(u.minCellWidth(),a[t]-i);return c(a.slice(0,e)).concat([i,n-a[t]]).concat(c(a.slice(t+1)))}var r=Math.max(u.minCellWidth(),a[e]+i),o=a[e]-r;return c(a.slice(0,e)).concat([r-a[e],o]).concat(c(a.slice(t+1)))},s=f;return o.fold(l,function(e){return u.singleColumnWidth(a[e],i)},s,function(e,t,n){return f(t,n)},function(e,t){if(0<=i)return c(a.slice(0,t)).concat([i]);var n=Math.max(u.minCellWidth(),a[t]+i);return c(a.slice(0,t)).concat([n-a[t]])})},Ji=function(e,t){return ve(e,t)&&1<parseInt(pe(e,t),10)},$i={hasColspan:function(e){return Ji(e,"colspan")},hasRowspan:function(e){return Ji(e,"rowspan")},minWidth:C(10),minHeight:C(10),getInt:function(e,t){return parseInt(Ae(e,t),10)}},Qi=function(e,t,n){return Ie(e,t).fold(function(){return n(e)+"px"},function(e){return e})},Zi=function(e,t){return Qi(e,"width",function(e){return io.getPixelWidth(e,t)})},eu=function(e){return Qi(e,"height",io.getHeight)},tu=function(e,t,n,r,o){var i=Uo(e),u=P(i,function(e){return e.map(t.edge)});return P(i,function(e,t){return e.filter(g($i.hasColspan)).fold(function(){var e=zo(u,t);return r(e)},function(e){return n(e,o)})})},nu=function(e){return e.map(function(e){return e+"px"}).getOr("")},ru=function(e,t,n,r){var o=qo(e),i=P(o,function(e){return e.map(t.edge)});return P(o,function(e,t){return e.filter(g($i.hasRowspan)).fold(function(){var e=zo(i,t);return r(e)},function(e){return n(e)})})},ou={getRawWidths:function(e,t,n){return tu(e,t,Zi,nu,n)},getPixelWidths:function(e,t,n){return tu(e,t,io.getPixelWidth,function(e){return e.getOrThunk(n.minCellWidth)},n)},getPercentageWidths:function(e,t,n){return tu(e,t,io.getPercentageWidth,function(e){return e.fold(function(){return n.minCellWidth()},function(e){return e/n.pixelWidth()*100})},n)},getPixelHeights:function(e,t){return ru(e,t,io.getHeight,function(e){return e.getOrThunk($i.minHeight)})},getRawHeights:function(e,t){return ru(e,t,eu,nu)}},iu=function(e,t,n){for(var r=0,o=e;o<t;o++)r+=n[o]!==undefined?n[o]:0;return r},uu=function(e,n){var t=xn.justCells(e);return P(t,function(e){var t=iu(e.column(),e.column()+e.colspan(),n);return{element:e.element,width:C(t),colspan:e.colspan}})},au=function(e,n){var t=xn.justCells(e);return P(t,function(e){var t=iu(e.row(),e.row()+e.rowspan(),n);return{element:e.element,height:C(t),rowspan:e.rowspan}})},cu=function(e,n){return P(e.all(),function(e,t){return{element:e.element,height:C(n[t])}})},lu=function(e){var t=o;return{width:C(e),pixelWidth:C(e),getWidths:ou.getPixelWidths,getCellDelta:t,singleColumnWidth:function(e,t){return[Math.max($i.minWidth(),e+t)-e]},minCellWidth:$i.minWidth,setElementWidth:io.setPixelWidth,setTableWidth:function(e,t,n){var r=W(t,function(e,t){return e+t},0);io.setPixelWidth(e,r)}}},fu=function(e,t){var n,r,o,i,u=io.percentageBasedSizeRegex().exec(t);if(null!==u)return n=u[1],r=e,o=parseFloat(n),i=Vr(r),{width:C(o),pixelWidth:C(i),getWidths:ou.getPercentageWidths,getCellDelta:function(e){return e/i*100},singleColumnWidth:function(e,t){return[100-e]},minCellWidth:function(){return $i.minWidth()/i*100},setElementWidth:io.setPercentageWidth,setTableWidth:function(e,t,n){var r=n/100*o;io.setPercentageWidth(e,o+r)}};var a=io.pixelBasedSizeRegex().exec(t);if(null!==a){var c=parseInt(a[1],10);return lu(c)}var l=Vr(e);return lu(l)},su=function(t){return io.getRawWidth(t).fold(function(){var e=Vr(t);return lu(e)},function(e){return fu(t,e)})},du=function(e){return xn.generate(e)},mu=function(e){var t=vn(e);return du(t)},gu=function(e,t,n,r){var o=su(e),i=o.getCellDelta(t),u=mu(e),a=o.getWidths(u,r,o),c=Ki(a,n,i,o),l=P(c,function(e,t){return e+a[t]}),f=uu(u,l);I(f,function(e){o.setElementWidth(e.element(),e.width())}),n===u.grid().columns()-1&&o.setTableWidth(e,l,i)},hu=function(e,n,r,t){var o=mu(e),i=ou.getPixelHeights(o,t),u=P(i,function(e,t){return r===t?Math.max(n+e,$i.minHeight()):e}),a=au(o,u),c=cu(o,u);I(c,function(e){io.setHeight(e.element(),e.height())}),I(a,function(e){io.setHeight(e.element(),e.height())});var l=W(u,function(e,t){return e+t},0);io.setHeight(e,l)},pu=function(e,t,n){var r=su(e),o=du(t),i=r.getWidths(o,n,r),u=uu(o,i);I(u,function(e){r.setElementWidth(e.element(),e.width())}),0<u.length&&r.setTableWidth(e,i,r.getCellDelta(0))},vu=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return vu(n())}}},bu=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return Z("required",o),ee(o),function(t){var n=V(t);U(o,function(e){return k(n,e)})||$(o,n),r(o,n);var e=B(o,function(e){return!i.validate(t[e],e)});return 0<e.length&&function(e,t){throw new Error("All values need to be of type: "+t+". Keys ("+J(e).join(", ")+") were not.")}(e,i.label),t}},wu=function(t,e){var n=B(e,function(e){return!k(t,e)});0<n.length&&Q(n)},yu=function(e){return bu(wu,e,{validate:D,label:"function"})},xu=yu(["cell","row","replace","gap"]),Cu=function(e){var t=ve(e,"colspan")?parseInt(pe(e,"colspan"),10):1,n=ve(e,"rowspan")?parseInt(pe(e,"rowspan"),10):1;return{element:C(e),colspan:C(t),rowspan:C(n)}},Su=function(r,o){void 0===o&&(o=Cu),xu(r);var n=vu(S.none()),i=function(e){var t,n=o(e);return t=n,r.cell(t)},u=function(e){var t=i(e);return n.get().isNone()&&n.set(S.some(t)),a=S.some({item:e,replacement:t}),t},a=S.none();return{getOrInit:function(t,n){return a.fold(function(){return u(t)},function(e){return n(t,e.item)?e.replacement:u(t)})},cursor:n.get}},Ru=function(a,c){return function(r){var o=vu(S.none());xu(r);var i=[],u=function(e){var t={scope:a},n=r.replace(e,c,t);return i.push({item:e,sub:n}),o.get().isNone()&&o.set(S.some(n)),n};return{replaceOrInit:function(t,n){return(r=t,o=n,_(i,function(e){return o(e.item,r)})).fold(function(){return u(t)},function(e){return n(t,e.item)?e.sub:u(t)});var r,o},cursor:o.get}}},Tu=function(n){xu(n);var e=vu(S.none());return{combine:function(t){return e.get().isNone()&&e.set(S.some(t)),function(){var e=n.cell({element:C(t),colspan:C(1),rowspan:C(1)});return Be(e,"width"),Be(t,"width"),e}},cursor:e.get}},Du=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ou=function(e,t){var n=e.property().name(t);return k(Du,n)},Eu=function(e,t){return k(["br","img","hr","input"],e.property().name(t))},Nu=Ou,ku=function(e,t){var n=e.property().name(t);return k(["ol","ul"],n)},Au=Eu,Pu=ir(),Iu=function(e){return Nu(Pu,e)},Bu=function(e){return ku(Pu,e)},Wu=function(e){return Au(Pu,e)},Mu=function(e){var t,i=function(e){return"br"===ue(e)},n=function(o){return Pn(o).bind(function(n){var r=St(n).map(function(e){return!!Iu(e)||!!Wu(e)&&"img"!==ue(e)}).getOr(!1);return yt(n).map(function(e){return!0===r||"li"===ue(t=e)||rn(t,Bu).isSome()||i(n)||Iu(e)&&!pt(o,e)?[]:[Re.fromTag("br")];var t})}).getOr([])},r=0===(t=H(e,function(e){var t=Rt(e);return U(t,function(e){return i(e)||se(e)&&0===Tn(e).trim().length})?[]:t.concat(n(e))})).length?[Re.fromTag("br")]:t;It(e[0]),Pt(e[0],r)},_u=function(e){0===pn.cells(e).length&&Bt(e)},Lu=K("grid","cursor"),ju=function(e,t,n){return Fu(e,t,n).orThunk(function(){return Fu(e,0,0)})},Fu=function(e,t,n){return S.from(e[t]).bind(function(e){return S.from(e.cells()[n]).bind(function(e){return S.from(e.element())})})},zu=function(e,t,n){return Lu(e,Fu(e,t,n))},Hu=function(e){return M(e,function(e,t){return A(e,function(e){return e.row()===t.row()})?e:e.concat([t])},[]).sort(function(e,t){return e.row()-t.row()})},Uu=function(e){return M(e,function(e,t){return A(e,function(e){return e.column()===t.column()})?e:e.concat([t])},[]).sort(function(e,t){return e.column()-t.column()})},qu=function(e,t,n){var r=bn(e,n),o=xn.generate(r);return gi(o,t,!0)},Vu=pu,Gu={insertRowBefore:bi(function(e,t,n,r){var o=t.row(),i=t.row(),u=Mi(e,i,o,n,r.getOrInit);return zu(u,i,t.column())},wi,y,y,Su),insertRowsBefore:bi(function(e,t,n,r){var o=t[0].row(),i=t[0].row(),u=Hu(t),a=M(u,function(e,t){return Mi(e,i,o,n,r.getOrInit)},e);return zu(a,i,t[0].column())},xi,y,y,Su),insertRowAfter:bi(function(e,t,n,r){var o=t.row(),i=t.row()+t.rowspan(),u=Mi(e,i,o,n,r.getOrInit);return zu(u,i,t.column())},wi,y,y,Su),insertRowsAfter:bi(function(e,t,n,r){var o=Hu(t),i=o[o.length-1].row(),u=o[o.length-1].row()+o[o.length-1].rowspan(),a=M(o,function(e,t){return Mi(e,u,i,n,r.getOrInit)},e);return zu(a,u,t[0].column())},xi,y,y,Su),insertColumnBefore:bi(function(e,t,n,r){var o=t.column(),i=t.column(),u=_i(e,i,o,n,r.getOrInit);return zu(u,t.row(),i)},wi,Vu,y,Su),insertColumnsBefore:bi(function(e,t,n,r){var o=Uu(t),i=o[0].column(),u=o[0].column(),a=M(o,function(e,t){return _i(e,u,i,n,r.getOrInit)},e);return zu(a,t[0].row(),u)},xi,Vu,y,Su),insertColumnAfter:bi(function(e,t,n,r){var o=t.column(),i=t.column()+t.colspan(),u=_i(e,i,o,n,r.getOrInit);return zu(u,t.row(),i)},wi,Vu,y,Su),insertColumnsAfter:bi(function(e,t,n,r){var o=t[t.length-1].column(),i=t[t.length-1].column()+t[t.length-1].colspan(),u=Uu(t),a=M(u,function(e,t){return _i(e,i,o,n,r.getOrInit)},e);return zu(a,t[0].row(),i)},xi,Vu,y,Su),splitCellIntoColumns:bi(function(e,t,n,r){var o=Li(e,t.row(),t.column(),n,r.getOrInit);return zu(o,t.row(),t.column())},wi,Vu,y,Su),splitCellIntoRows:bi(function(e,t,n,r){var o=ji(e,t.row(),t.column(),n,r.getOrInit);return zu(o,t.row(),t.column())},wi,y,y,Su),eraseColumns:bi(function(e,t,n,r){var o=Uu(t),i=zi(e,o[0].column(),o[o.length-1].column()),u=ju(i,t[0].row(),t[0].column());return Lu(i,u)},xi,Vu,_u,Su),eraseRows:bi(function(e,t,n,r){var o=Hu(t),i=Fi(e,o[0].row(),o[o.length-1].row()),u=ju(i,t[0].row(),t[0].column());return Lu(i,u)},xi,y,_u,Su),makeColumnHeader:bi(function(e,t,n,r){var o=Vi(e,t.column(),n,r.replaceOrInit);return zu(o,t.row(),t.column())},wi,y,y,Ru("row","th")),unmakeColumnHeader:bi(function(e,t,n,r){var o=Vi(e,t.column(),n,r.replaceOrInit);return zu(o,t.row(),t.column())},wi,y,y,Ru(null,"td")),makeRowHeader:bi(function(e,t,n,r){var o=Gi(e,t.row(),n,r.replaceOrInit);return zu(o,t.row(),t.column())},wi,y,y,Ru("col","th")),unmakeRowHeader:bi(function(e,t,n,r){var o=Gi(e,t.row(),n,r.replaceOrInit);return zu(o,t.row(),t.column())},wi,y,y,Ru(null,"td")),mergeCells:bi(function(e,t,n,r){var o=t.cells();Mu(o);var i=Ai(e,t.bounds(),n,C(o[0]));return Lu(i,S.from(o[0]))},function(e,t){return t.mergable()},y,y,Tu),unmergeCells:bi(function(e,t,n,r){var o=W(t,function(e,t){return Pi(e,t,n,r.combine(t))},e);return Lu(o,S.from(t[0]))},function(e,t){return t.unmergable()},Vu,y,Tu),pasteCells:bi(function(e,n,t,r){var o,i,u,a,c=(o=n.clipboard(),i=n.generators(),u=vn(o),a=xn.generate(u),gi(a,i,!0)),l=_t(n.row(),n.column());return Bi(l,e,c,n.generators(),t).fold(function(){return Lu(e,S.some(n.element()))},function(e){var t=ju(e,n.row(),n.column());return Lu(e,t)})},function(t,n){return pn.cell(n.element()).bind(function(e){return vi(t,e).map(function(e){return Oo({},e,{generators:n.generators,clipboard:n.clipboard})})})},Vu,y,Su),pasteRowsBefore:bi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[0].row(),u=qu(t.clipboard(),t.generators(),o),a=Wi(i,e,u,t.generators(),n),c=ju(a,t.cells[0].row(),t.cells[0].column());return Lu(a,c)},yi,y,y,Su),pasteRowsAfter:bi(function(e,t,n,r){var o=e[t.cells[0].row()],i=t.cells[t.cells.length-1].row()+t.cells[t.cells.length-1].rowspan(),u=qu(t.clipboard(),t.generators(),o),a=Wi(i,e,u,t.generators(),n),c=ju(a,t.cells[0].row(),t.cells[0].column());return Lu(a,c)},yi,y,y,Su)},Yu=function(e){return Re.fromDom(e.getBody())},Xu=function(e){return e.getBoundingClientRect().width},Ku=function(e){return e.getBoundingClientRect().height},Ju=function(t){return function(e){return pt(e,Yu(t))}},$u=function(e){return/^[0-9]+$/.test(e)&&(e+="px"),e},Qu=function(e){var t=Jt(e,"td[data-mce-style],th[data-mce-style]");be(e,"data-mce-style"),I(t,function(e){be(e,"data-mce-style")})},Zu={isRtl:C(!1)},ea={isRtl:C(!0)},ta={directionAt:function(e){return"rtl"==("rtl"===Ae(e,"direction")?"rtl":"ltr")?ea:Zu}},na=["tableprops","tabledelete","|","tableinsertrowbefore","tableinsertrowafter","tabledeleterow","|","tableinsertcolbefore","tableinsertcolafter","tabledeletecol"],ra={"border-collapse":"collapse",width:"100%"},oa={border:"1"},ia=function(e){return e.getParam("table_cell_advtab",!0,"boolean")},ua=function(e){return e.getParam("table_row_advtab",!0,"boolean")},aa=function(e){return e.getParam("table_advtab",!0,"boolean")},ca=function(e){return e.getParam("table_style_by_css",!1,"boolean")},la=function(e){return e.getParam("table_cell_class_list",[],"array")},fa=function(e){return e.getParam("table_row_class_list",[],"array")},sa=function(e){return e.getParam("table_class_list",[],"array")},da=function(e){return!1===e.getParam("table_responsive_width")},ma=function(e,t){return e.fire("newrow",{node:t})},ga=function(e,t){return e.fire("newcell",{node:t})},ha=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},pa=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},va=function(f,e){var t,n=function(e){return"table"===ue(Yu(e))},s=(t=f.getParam("table_clone_elements"),w(t)?S.some(t.split(/[ ,]/)):Array.isArray(t)?S.some(t):S.none()),r=function(u,a,c,l){return function(e,t){Qu(e);var n=l(),r=Re.fromDom(f.getDoc()),o=To(ta.directionAt),i=Hn(c,r,s);return a(e)?u(n,e,t,i,o).bind(function(e){return I(e.newRows(),function(e){ma(f,e.dom())}),I(e.newCells(),function(e){ga(f,e.dom())}),e.cursor().map(function(e){var t=f.dom.createRng();return t.setStart(e.dom(),0),t.setEnd(e.dom(),0),t})}):S.none()}};return{deleteRow:r(Gu.eraseRows,function(e){var t=Do(e);return!1===n(f)||1<t.rows()},y,e),deleteColumn:r(Gu.eraseColumns,function(e){var t=Do(e);return!1===n(f)||1<t.columns()},y,e),insertRowsBefore:r(Gu.insertRowsBefore,a,y,e),insertRowsAfter:r(Gu.insertRowsAfter,a,y,e),insertColumnsBefore:r(Gu.insertColumnsBefore,a,uo,e),insertColumnsAfter:r(Gu.insertColumnsAfter,a,uo,e),mergeCells:r(Gu.mergeCells,a,y,e),unmergeCells:r(Gu.unmergeCells,a,y,e),pasteRowsBefore:r(Gu.pasteRowsBefore,a,y,e),pasteRowsAfter:r(Gu.pasteRowsAfter,a,y,e),pasteCells:r(Gu.pasteCells,a,y,e)}},ba=function(e,t,r){var n=vn(e),o=xn.generate(n);return xi(o,t).map(function(e){var t=gi(o,r,!1).slice(e[0].row(),e[e.length-1].row()+e[e.length-1].rowspan()),n=pi(t,r);return Po(n)})},wa=tinymce.util.Tools.resolve("tinymce.util.Tools"),ya=function(e,t,n){n&&e.formatter.apply("align"+n,{},t)},xa=function(e,t,n){n&&e.formatter.apply("valign"+n,{},t)},Ca=function(t,n){wa.each("left center right".split(" "),function(e){t.formatter.remove("align"+e,{},n)})},Sa=function(t,n){wa.each("top middle bottom".split(" "),function(e){t.formatter.remove("valign"+e,{},n)})},Ra=function(o,e,i){var t;return t=function(e,t){for(var n=0;n<t.length;n++){var r=o.getStyle(t[n],i);if(void 0===e&&(e=r),e!==r)return""}return e}(t,o.select("td,th",e))},Ta=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);i["border-style"]=o.borderStyle,i["border-color"]=o.borderColor,i["background-color"]=o.backgroundColor,i.width=o.width?$u(o.width):"",i.height=o.height?$u(o.height):"",r.find("#style").value(n.serializeStyle(n.parseStyle(n.serializeStyle(i))))},Da=function(e,t){var n=e.dom,r=t.control.rootControl,o=r.toJSON(),i=n.parseStyle(o.style);r.find("#borderStyle").value(i["border-style"]||""),r.find("#borderColor").value(i["border-color"]||""),r.find("#backgroundColor").value(i["background-color"]||""),r.find("#width").value(i.width||""),r.find("#height").value(i.height||"")},Oa={createStyleForm:function(n){var e=function(){var e=n.getParam("color_picker_callback");if(e)return function(t){return e.call(n,function(e){t.control.value(e).fire("change")},t.control.value())}};return{title:"Advanced",type:"form",defaults:{onchange:b(Ta,n)},items:[{label:"Style",name:"style",type:"textbox",onchange:b(Da,n)},{type:"form",padding:0,formItemDefaults:{layout:"grid",alignH:["start","right"]},defaults:{size:7},items:[{label:"Border style",type:"listbox",name:"borderStyle",width:90,onselect:b(Ta,n),values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{label:"Border color",type:"colorbox",name:"borderColor",onaction:e()},{label:"Background color",type:"colorbox",name:"backgroundColor",onaction:e()}]}]}},buildListItems:function(e,r,t){var o=function(e,n){return n=n||[],wa.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=o(e.menu):(t.value=e.value,r&&r(t)),n.push(t)}),n};return o(e,t||[])},updateStyleField:Ta,extractAdvancedStyles:function(e,t){var n=e.parseStyle(e.getAttrib(t,"style")),r={};return n["border-style"]&&(r.borderStyle=n["border-style"]),n["border-color"]&&(r.borderColor=n["border-color"]),n["background-color"]&&(r.backgroundColor=n["background-color"]),r.style=e.serializeStyle(n),r},updateAdvancedFields:Da,syncAdvancedStyleFields:function(e,t){t.control.rootControl.find("#style")[0].getEl().isEqualNode(m.document.activeElement)?Da(e,t):Ta(e,t)}},Ea=function(r,o,e){var i,u=r.dom;function a(e,t,n){(1===o.length||n)&&u.setAttrib(e,t,n)}function c(e,t,n){(1===o.length||n)&&u.setStyle(e,t,n)}ia(r)&&Oa.syncAdvancedStyleFields(r,e),i=e.control.rootControl.toJSON(),r.undoManager.transact(function(){wa.each(o,function(e){var t,n;a(e,"scope",i.scope),1===o.length?a(e,"style",i.style):(t=e,n=i.style,delete t.dataset.mceStyle,t.style.cssText+=";"+n),a(e,"class",i["class"]),c(e,"width",$u(i.width)),c(e,"height",$u(i.height)),i.type&&e.nodeName.toLowerCase()!==i.type&&(e=u.rename(e,i.type)),1===o.length&&(Ca(r,e),Sa(r,e)),i.align&&ya(r,e,i.align),i.valign&&xa(r,e,i.valign)}),r.focus()})},Na=function(t){var e,n,r,o=[];if(o=t.dom.select("td[data-mce-selected],th[data-mce-selected]"),e=t.dom.getParent(t.selection.getStart(),"td,th"),!o.length&&e&&o.push(e),e=e||o[0]){var i,u,a,c;1<o.length?n={width:"",height:"",scope:"","class":"",align:"",valign:"",style:"",type:e.nodeName.toLowerCase()}:(u=e,a=(i=t).dom,c={width:a.getStyle(u,"width")||a.getAttrib(u,"width"),height:a.getStyle(u,"height")||a.getAttrib(u,"height"),scope:a.getAttrib(u,"scope"),"class":a.getAttrib(u,"class"),type:u.nodeName.toLowerCase(),style:"",align:"",valign:""},wa.each("left center right".split(" "),function(e){i.formatter.matchNode(u,"align"+e)&&(c.align=e)}),wa.each("top middle bottom".split(" "),function(e){i.formatter.matchNode(u,"valign"+e)&&(c.valign=e)}),ia(i)&&wa.extend(c,Oa.extractAdvancedStyles(a,u)),n=c),0<la(t).length&&(r={name:"class",type:"listbox",label:"Class",values:Oa.buildListItems(la(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"td",classes:[e.value]})})})});var l={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",layout:"grid",columns:2,labelGapCalc:!1,padding:0,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width",onchange:b(Oa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(Oa.updateStyleField,t)},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"H Align",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"V Align",name:"valign",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}]},r]};ia(t)?t.windowManager.open({title:"Cell properties",bodyType:"tabpanel",data:n,body:[{title:"General",type:"form",items:l},Oa.createStyleForm(t)],onsubmit:b(Ea,t,o)}):t.windowManager.open({title:"Cell properties",data:n,body:l,onsubmit:b(Ea,t,o)})}};function ka(f,s,d,e){var m=f.dom;function g(e,t,n){(1===s.length||n)&&m.setAttrib(e,t,n)}ua(f)&&Oa.syncAdvancedStyleFields(f,e);var h=e.control.rootControl.toJSON();f.undoManager.transact(function(){wa.each(s,function(e){var t,n,r,o,i,u,a,c,l;g(e,"scope",h.scope),g(e,"style",h.style),g(e,"class",h["class"]),t=e,n="height",r=$u(h.height),(1===s.length||r)&&m.setStyle(t,n,r),h.type!==e.parentNode.nodeName.toLowerCase()&&(o=f.dom,i=e,u=h.type,a=o.getParent(i,"table"),c=i.parentNode,(l=o.select(u,a)[0])||(l=o.create(u),a.firstChild?"CAPTION"===a.firstChild.nodeName?o.insertAfter(l,a.firstChild):a.insertBefore(l,a.firstChild):a.appendChild(l)),l.appendChild(i),c.hasChildNodes()||o.remove(c)),h.align!==d.align&&(Ca(f,e),ya(f,e,h.align))}),f.focus()})}var Aa=function(t){var e,n,r,o,i,u,a,c,l,f,s=t.dom,d=[];e=s.getParent(t.selection.getStart(),"table"),n=s.getParent(t.selection.getStart(),"td,th"),wa.each(e.rows,function(t){wa.each(t.cells,function(e){if(s.getAttrib(e,"data-mce-selected")||e===n)return d.push(t),!1})}),(r=d[0])&&(1<d.length?i={height:"",scope:"",style:"","class":"",align:"",type:r.parentNode.nodeName.toLowerCase()}:(c=r,l=(a=t).dom,f={height:l.getStyle(c,"height")||l.getAttrib(c,"height"),scope:l.getAttrib(c,"scope"),"class":l.getAttrib(c,"class"),align:"",style:"",type:c.parentNode.nodeName.toLowerCase()},wa.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),ua(a)&&wa.extend(f,Oa.extractAdvancedStyles(l,c)),i=f),0<fa(t).length&&(o={name:"class",type:"listbox",label:"Class",values:Oa.buildListItems(fa(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"tr",classes:[e.value]})})})}),u={type:"form",columns:2,padding:0,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"Header",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"},o]},ua(t)?t.windowManager.open({title:"Row properties",data:i,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Oa.createStyleForm(t)],onsubmit:b(ka,t,d,i)}):t.windowManager.open({title:"Row properties",data:i,body:u,onsubmit:b(ka,t,d,i)}))},Pa=tinymce.util.Tools.resolve("tinymce.Env"),Ia={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},percentages:!0},Ba=function(e,t,n,r,o){void 0===o&&(o=Ia);var i=Re.fromTag("table");ke(i,o.styles),he(i,o.attributes);var u=Re.fromTag("tbody");Nt(i,u);for(var a=[],c=0;c<e;c++){for(var l=Re.fromTag("tr"),f=0;f<t;f++){var s=c<n||f<r?Re.fromTag("th"):Re.fromTag("td");f<r&&ge(s,"scope","row"),c<n&&ge(s,"scope","col"),Nt(s,Re.fromTag("br")),o.percentages&&Ne(s,"width",100/t+"%"),Nt(l,s)}a.push(l)}return Pt(u,a),i},Wa=function(e,t){e.selection.select(t.dom(),!0),e.selection.collapse(!0)},Ma=function(r,e,t){var n,o,i=r.getParam("table_default_styles",ra,"object"),u={styles:i,attributes:(o=r,o.getParam("table_default_attributes",oa,"object")),percentages:(n=i.width,w(n)&&-1!==n.indexOf("%")&&!da(r))},a=Ba(t,e,0,0,u);ge(a,"data-mce-id","__mce");var c,l,f,s=(c=a,l=Re.fromTag("div"),f=Re.fromDom(c.dom().cloneNode(!0)),Nt(l,f),l.dom().innerHTML);return r.insertContent(s),an(Yu(r),'table[data-mce-id="__mce"]').map(function(e){var t,n;return da(r)&&Ne(e,"width",Ae(e,"width")),be(e,"data-mce-id"),t=r,I(Jt(e,"tr"),function(e){ma(t,e.dom()),I(Jt(e,"th,td"),function(e){ga(t,e.dom())})}),n=r,an(e,"td,th").each(b(Wa,n)),e.dom()}).getOr(null)};function _a(e,t,n,r){if("TD"===t.tagName||"TH"===t.tagName)e.setStyle(t,n,r);else if(t.children)for(var o=0;o<t.children.length;o++)_a(e,t.children[o],n,r)}var La,ja=function(e,t,n){var r,o,i=e.dom;aa(e)&&Oa.syncAdvancedStyleFields(e,n),!1===(o=n.control.rootControl.toJSON())["class"]&&delete o["class"],e.undoManager.transact(function(){t||(t=Ma(e,o.cols||1,o.rows||1)),function(e,t,n){var r,o=e.dom,i={},u={};if(i["class"]=n["class"],u.height=$u(n.height),o.getAttrib(t,"width")&&!ca(e)?i.width=(r=n.width)?r.replace(/px$/,""):"":u.width=$u(n.width),ca(e)?(u["border-width"]=$u(n.border),u["border-spacing"]=$u(n.cellspacing),wa.extend(i,{"data-mce-border-color":n.borderColor,"data-mce-cell-padding":n.cellpadding,"data-mce-border":n.border})):wa.extend(i,{border:n.border,cellpadding:n.cellpadding,cellspacing:n.cellspacing}),ca(e)&&t.children)for(var a=0;a<t.children.length;a++)_a(o,t.children[a],{"border-width":$u(n.border),"border-color":n.borderColor,padding:$u(n.cellpadding)});n.style?wa.extend(u,o.parseStyle(n.style)):u=wa.extend({},o.parseStyle(o.getAttrib(t,"style")),u),i.style=o.serializeStyle(u),o.setAttribs(t,i)}(e,t,o),(r=i.select("caption",t)[0])&&!o.caption&&i.remove(r),!r&&o.caption&&((r=i.create("caption")).innerHTML=Pa.ie?"\xa0":'<br data-mce-bogus="1"/>',t.insertBefore(r,t.firstChild)),Ca(e,t),o.align&&ya(e,t,o.align),e.focus(),e.addVisual()})},Fa=function(t,e){var n,r,o,i,u,a,c,l,f,s,d=t.dom,m={};!0===e?(n=d.getParent(t.selection.getStart(),"table"))&&(c=n,l=(a=t).dom,f={width:l.getStyle(c,"width")||l.getAttrib(c,"width"),height:l.getStyle(c,"height")||l.getAttrib(c,"height"),cellspacing:l.getStyle(c,"border-spacing")||l.getAttrib(c,"cellspacing"),cellpadding:l.getAttrib(c,"data-mce-cell-padding")||l.getAttrib(c,"cellpadding")||Ra(a.dom,c,"padding"),border:l.getAttrib(c,"data-mce-border")||l.getAttrib(c,"border")||Ra(a.dom,c,"border"),borderColor:l.getAttrib(c,"data-mce-border-color"),caption:!!l.select("caption",c)[0],"class":l.getAttrib(c,"class")},wa.each("left center right".split(" "),function(e){a.formatter.matchNode(c,"align"+e)&&(f.align=e)}),aa(a)&&wa.extend(f,Oa.extractAdvancedStyles(l,c)),m=f):(r={label:"Cols",name:"cols"},o={label:"Rows",name:"rows"}),0<sa(t).length&&(m["class"]&&(m["class"]=m["class"].replace(/\s*mce\-item\-table\s*/g,"")),i={name:"class",type:"listbox",label:"Class",values:Oa.buildListItems(sa(t),function(e){e.value&&(e.textStyle=function(){return t.formatter.getCssText({block:"table",classes:[e.value]})})})}),u={type:"form",layout:"flex",direction:"column",labelGapCalc:"children",padding:0,items:[{type:"form",labelGapCalc:!1,padding:0,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:(s=t,s.getParam("table_appearance_options",!0,"boolean")?[r,o,{label:"Width",name:"width",onchange:b(Oa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(Oa.updateStyleField,t)},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"}]:[r,o,{label:"Width",name:"width",onchange:b(Oa.updateStyleField,t)},{label:"Height",name:"height",onchange:b(Oa.updateStyleField,t)}])},{label:"Alignment",name:"align",type:"listbox",text:"None",values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},i]},aa(t)?t.windowManager.open({title:"Table properties",data:m,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},Oa.createStyleForm(t)],onsubmit:b(ja,t,n)}):t.windowManager.open({title:"Table properties",data:m,body:u,onsubmit:b(ja,t,n)})},za=wa.each,Ha=function(a,t,c,l,n){var r=Ju(a),e=function(e){return function(){return S.from(a.dom.getParent(a.selection.getStart(),e)).map(Re.fromDom)}},o=e("caption"),f=e("th,td"),s=function(e){return pn.table(e,r)},d=function(e){return{width:Xu(e.dom()),height:Xu(e.dom())}},i=function(n){f().each(function(t){s(t).each(function(i){var e=Lr.forMenu(l,i,t),u=d(i);n(i,e).each(function(e){var t,n,r,o;t=a,n=u,o=d(r=i),n.width===o.width&&n.height===o.height||(ha(t,r.dom(),n.width,n.height),pa(t,r.dom(),o.width,o.height)),a.selection.setRng(e),a.focus(),c.clear(i),Qu(i)})})})},u=function(e){return f().bind(function(o){return s(o).bind(function(e){var t=Re.fromDom(a.getDoc()),n=Lr.forMenu(l,e,o),r=Hn(y,t,S.none());return ba(e,n,r)})})},m=function(u){n.get().each(function(e){var i=P(e,function(e){return Mn(e)});f().each(function(o){s(o).each(function(t){var e=Re.fromDom(a.getDoc()),n=Un(e),r=Lr.pasteRows(l,t,o,i,n);u(t,r).each(function(e){a.selection.setRng(e),a.focus(),c.clear(t)})})})})};za({mceTableSplitCells:function(){i(t.unmergeCells)},mceTableMergeCells:function(){i(t.mergeCells)},mceTableInsertRowBefore:function(){i(t.insertRowsBefore)},mceTableInsertRowAfter:function(){i(t.insertRowsAfter)},mceTableInsertColBefore:function(){i(t.insertColumnsBefore)},mceTableInsertColAfter:function(){i(t.insertColumnsAfter)},mceTableDeleteCol:function(){i(t.deleteColumn)},mceTableDeleteRow:function(){i(t.deleteRow)},mceTableCutRow:function(e){n.set(u()),i(t.deleteRow)},mceTableCopyRow:function(e){n.set(u())},mceTablePasteRowBefore:function(e){m(t.pasteRowsBefore)},mceTablePasteRowAfter:function(e){m(t.pasteRowsAfter)},mceTableDelete:function(){f().orThunk(o).each(function(e){pn.table(e,r).filter(g(r)).each(function(e){var t=Re.fromText("");Ot(e,t),Bt(e);var n=a.dom.createRng();n.setStart(t.dom(),0),n.setEnd(t.dom(),0),a.selection.setRng(n)})})}},function(e,t){a.addCommand(t,e)}),za({mceInsertTable:b(Fa,a),mceTableProps:b(Fa,a,!0),mceTableRowProps:b(Aa,a),mceTableCellProps:b(Na,a)},function(n,e){a.addCommand(e,function(e,t){n(t)})})},Ua=function(e){var t=S.from(e.dom().documentElement).map(Re.fromDom).getOr(e);return{parent:C(t),view:C(e),origin:C(co(0,0))}},qa=function(e,t){return{parent:C(t),view:C(e),origin:C(co(0,0))}},Va=function(e){var r=K.apply(null,e),o=[];return{bind:function(e){if(e===undefined)throw new Error("Event bind error: undefined handler");o.push(e)},unbind:function(t){o=B(o,function(e){return e!==t})},trigger:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(null,e);I(o,function(e){e(n)})}}},Ga={create:function(e){return{registry:Y(e,function(e){return{bind:e.bind,unbind:e.unbind}}),trigger:Y(e,function(e){return e.trigger})}}},Ya=function(m,g){return function(e){if(m(e)){var t,n,r,o,i,u,a,c=Re.fromDom(e.target),l=function(){e.stopPropagation()},f=function(){e.preventDefault()},s=x(f,l),d=(t=c,n=e.clientX,r=e.clientY,o=l,i=f,u=s,a=e,{target:C(t),x:C(n),y:C(r),stop:o,prevent:i,kill:u,raw:C(a)});g(d)}}},Xa=function(e,t,n,r){return o=e,i=t,u=!1,a=Ya(n,r),o.dom().addEventListener(i,a,u),{unbind:b(Ka,o,i,a,u)};var o,i,u,a},Ka=function(e,t,n,r){e.dom().removeEventListener(t,n,r)},Ja=C(!0),$a=function(e,t,n){return Xa(e,t,Ja,n)},Qa=Object.prototype.hasOwnProperty,Za=(La=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Qa.call(o,i)&&(n[i]=La(n[i],o[i]))}return n}),ec={resolve:Vo("ephox-dragster").resolve},tc=yu(["compare","extract","mutate","sink"]),nc=yu(["element","start","stop","destroy"]),rc=yu(["forceDrop","drop","move","delayDrop"]),oc=tc({compare:function(e,t){return co(t.left()-e.left(),t.top()-e.top())},extract:function(e){return S.some(co(e.x(),e.y()))},sink:function(e,t){var n,r,o,i=(n=t,r=Za({layerClass:ec.resolve("blocker")},n),o=Re.fromTag("div"),ge(o,"role","presentation"),ke(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),_o(o,ec.resolve("blocker")),_o(o,r.layerClass),{element:function(){return o},destroy:function(){Bt(o)}}),u=$a(i.element(),"mousedown",e.forceDrop),a=$a(i.element(),"mouseup",e.drop),c=$a(i.element(),"mousemove",e.move),l=$a(i.element(),"mouseout",e.delayDrop);return nc({element:i.element,start:function(e){Nt(e,i.element())},stop:function(){Bt(i.element())},destroy:function(){i.destroy(),a.unbind(),c.unbind(),l.unbind(),u.unbind()}})},mutate:function(e,t){e.mutate(t.left(),t.top())}});function ic(){var i=S.none(),u=Ga.create({move:Va(["info"])});return{onEvent:function(e,o){o.extract(e).each(function(e){var t,n,r;(t=o,n=e,r=i.map(function(e){return t.compare(e,n)}),i=S.some(n),r).each(function(e){u.trigger.move(e)})})},reset:function(){i=S.none()},events:u.registry}}function uc(){var e={onEvent:y,reset:y},t=ic(),n=e;return{on:function(){n.reset(),n=t},off:function(){n.reset(),n=e},isOn:function(){return n===t},onEvent:function(e,t){n.onEvent(e,t)},events:t.events}}var ac=function(t,n,e){var r,o,i,u=!1,a=Ga.create({start:Va([]),stop:Va([])}),c=uc(),l=function(){d.stop(),c.isOn()&&(c.off(),a.trigger.stop())},f=(r=l,o=200,i=null,{cancel:function(){null!==i&&(m.clearTimeout(i),i=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==i&&m.clearTimeout(i),i=m.setTimeout(function(){r.apply(null,e),i=null},o)}});c.events.move.bind(function(e){n.mutate(t,e.info())});var s=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&n.apply(null,e)}},d=n.sink(rc({forceDrop:l,drop:s(l),move:s(function(e){f.cancel(),c.onEvent(e,n)}),delayDrop:s(f.throttle)}),e);return{element:d.element,go:function(e){d.start(e),c.on(),a.trigger.start()},on:function(){u=!0},off:function(){u=!1},destroy:function(){d.destroy()},events:a.registry}},cc=function(e,t){void 0===t&&(t={});var n=t.mode!==undefined?t.mode:oc;return ac(e,n,t)},lc=function(){var n,r=Ga.create({drag:Va(["xDelta","yDelta","target"])}),o=S.none(),e={mutate:function(e,t){n.trigger.drag(e,t)},events:(n=Ga.create({drag:Va(["xDelta","yDelta"])})).registry};return e.events.drag.bind(function(t){o.each(function(e){r.trigger.drag(t.xDelta(),t.yDelta(),e)})}),{assign:function(e){o=S.some(e)},get:function(){return o},mutate:e.mutate,events:r.registry}},fc=function(e){return"true"===pe(e,"contenteditable")},sc=Go.resolve("resizer-bar-dragging"),dc=function(o,t,i){var n=lc(),r=cc(n,{}),u=S.none(),e=function(e,t){return S.from(pe(e,t))};n.events.drag.bind(function(n){e(n.target(),"data-row").each(function(e){var t=$i.getInt(n.target(),"top");Ne(n.target(),"top",t+n.yDelta()+"px")}),e(n.target(),"data-column").each(function(e){var t=$i.getInt(n.target(),"left");Ne(n.target(),"left",t+n.xDelta()+"px")})});var a=function(e,t){return $i.getInt(e,t)-parseInt(pe(e,"data-initial-"+t),10)};r.events.stop.bind(function(){n.get().each(function(r){u.each(function(n){e(r,"data-row").each(function(e){var t=a(r,"top");be(r,"data-initial-top"),m.trigger.adjustHeight(n,t,parseInt(e,10))}),e(r,"data-column").each(function(e){var t=a(r,"left");be(r,"data-initial-left"),m.trigger.adjustWidth(n,t,parseInt(e,10))}),ni(o,n,i,t)})})});var c=function(e,t){m.trigger.startAdjust(),n.assign(e),ge(e,"data-initial-"+t,parseInt(Ae(e,t),10)),_o(e,sc),Ne(e,"opacity","0.2"),r.go(o.parent())},l=$a(o.parent(),"mousedown",function(e){ui(e.target())&&c(e.target(),"top"),ai(e.target())&&c(e.target(),"left")}),f=function(e){return pt(e,o.view())},s=function(e){return cn(e,"table",f).filter(function(e){return(t=e,n=f,cn(t,"[contenteditable]",n)).exists(fc);var t,n})},d=$a(o.view(),"mouseover",function(e){s(e.target()).fold(function(){Te(e.target())&&ii(o)},function(e){u=S.some(e),ni(o,e,i,t)})}),m=Ga.create({adjustHeight:Va(["table","delta","row"]),adjustWidth:Va(["table","delta","column"]),startAdjust:Va([])});return{destroy:function(){l.unbind(),d.unbind(),r.destroy(),ii(o)},refresh:function(e){ni(o,e,i,t)},on:r.on,off:r.off,hideBars:b(ri,o),showBars:b(oi,o),events:m.registry}},mc=function(e,t){return e.inline?qa(Yu(e),(n=Re.fromTag("div"),ke(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Nt(De(),n),n)):Ua(Re.fromDom(e.getDoc()));var n},gc=function(e,t){e.inline&&Bt(t.parent())},hc=function(c){var u,a,l=S.none(),f=S.none(),s=S.none(),d=/(\d+(\.\d+)?)%/,m=function(e){return"TABLE"===e.nodeName};return c.on("init",function(){var n,r,e,o,t,i=To(ta.directionAt),u=mc(c);if(s=S.some(u),("table"===(t=c.getParam("object_resizing",!0))||t)&&c.getParam("table_resize_bars",!0,"boolean")){var a=(e=dc(u,n=i,r=So.height),o=Ga.create({beforeResize:Va(["table"]),afterResize:Va(["table"]),startDrag:Va([])}),e.events.adjustHeight.bind(function(e){o.trigger.beforeResize(e.table());var t=r.delta(e.delta(),e.table());hu(e.table(),t,e.row(),r),o.trigger.afterResize(e.table())}),e.events.startAdjust.bind(function(e){o.trigger.startDrag()}),e.events.adjustWidth.bind(function(e){o.trigger.beforeResize(e.table());var t=n.delta(e.delta(),e.table());gu(e.table(),t,e.column(),n),o.trigger.afterResize(e.table())}),{on:e.on,off:e.off,hideBars:e.hideBars,showBars:e.showBars,destroy:e.destroy,events:o.registry});a.on(),a.events.startDrag.bind(function(e){l=S.some(c.selection.getRng())}),a.events.beforeResize.bind(function(e){var t=e.table().dom();ha(c,t,Xu(t),Ku(t))}),a.events.afterResize.bind(function(e){var t=e.table(),n=t.dom();Qu(t),l.each(function(e){c.selection.setRng(e),c.focus()}),pa(c,n,Xu(n),Ku(n)),c.undoManager.add()}),f=S.some(a)}}),c.on("ObjectResizeStart",function(e){var t,n=e.target;m(n)&&(u=e.width,t=n,a=c.dom.getStyle(t,"width")||c.dom.getAttrib(t,"width"))}),c.on("ObjectResized",function(e){var t=e.target;if(m(t)){var n=t;if(d.test(a)){var r=parseFloat(d.exec(a)[1]),o=e.width*r/u;c.dom.setStyle(n,"width",o+"%")}else{var i=[];wa.each(n.rows,function(e){wa.each(e.cells,function(e){var t=c.dom.getStyle(e,"width",!0);i.push({cell:e,width:t})})}),wa.each(i,function(e){c.dom.setStyle(e.cell,"width",e.width),c.dom.setAttrib(e.cell,"width",null)})}}}),{lazyResize:function(){return f},lazyWire:function(){return s.getOr(Ua(Re.fromDom(c.getBody())))},destroy:function(){f.each(function(e){e.destroy()}),s.each(function(e){gc(c,e)})}}},pc=Nr([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),vc=Oo({},pc,{none:function(e){return void 0===e&&(e=undefined),pc.none(e)}}),bc=function(n,e){return pn.table(n,e).bind(function(e){var t=pn.cells(e);return L(t,function(e){return pt(n,e)}).map(function(e){return{index:C(e),all:C(t)}})})},wc=function(t,e){return bc(t,e).fold(function(){return vc.none(t)},function(e){return e.index()+1<e.all().length?vc.middle(t,e.all()[e.index()+1]):vc.last(t)})},yc=function(t,e){return bc(t,e).fold(function(){return vc.none()},function(e){return 0<=e.index()-1?vc.middle(t,e.all()[e.index()-1]):vc.first(t)})},xc={create:K("start","soffset","finish","foffset")},Cc=Nr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Sc={before:Cc.before,on:Cc.on,after:Cc.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(o,o,o)}},Rc=Nr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Tc={domRange:Rc.domRange,relative:Rc.relative,exact:Rc.exact,exactFromRange:function(e){return Rc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t,n=e.match({domRange:function(e){return Re.fromDom(e.startContainer)},relative:function(e,t){return Sc.getStart(e)},exact:function(e,t,n,r){return e}});return t=n.dom().ownerDocument.defaultView,Re.fromDom(t)},range:xc.create},Dc=function(e,t){e.selectNodeContents(t.dom())},Oc=function(e,t,n){var r,o,i=e.document.createRange();return r=i,t.fold(function(e){r.setStartBefore(e.dom())},function(e,t){r.setStart(e.dom(),t)},function(e){r.setStartAfter(e.dom())}),o=i,n.fold(function(e){o.setEndBefore(e.dom())},function(e,t){o.setEnd(e.dom(),t)},function(e){o.setEndAfter(e.dom())}),i},Ec=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},Nc=function(e){return{left:C(e.left),top:C(e.top),right:C(e.right),bottom:C(e.bottom),width:C(e.width),height:C(e.height)}},kc=Nr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ac=function(e,t,n){return t(Re.fromDom(n.startContainer),n.startOffset,Re.fromDom(n.endContainer),n.endOffset)},Pc=function(e,t){var o,n,r,i=(o=e,t.match({domRange:function(e){return{ltr:C(e),rtl:S.none}},relative:function(e,t){return{ltr:Ce(function(){return Oc(o,e,t)}),rtl:Ce(function(){return S.some(Oc(o,t,e))})}},exact:function(e,t,n,r){return{ltr:Ce(function(){return Ec(o,e,t,n,r)}),rtl:Ce(function(){return S.some(Ec(o,n,r,e,t))})}}}));return(r=(n=i).ltr()).collapsed?n.rtl().filter(function(e){return!1===e.collapsed}).map(function(e){return kc.rtl(Re.fromDom(e.endContainer),e.endOffset,Re.fromDom(e.startContainer),e.startOffset)}).getOrThunk(function(){return Ac(0,kc.ltr,r)}):Ac(0,kc.ltr,r)},Ic=function(i,e){return Pc(i,e).match({ltr:function(e,t,n,r){var o=i.document.createRange();return o.setStart(e.dom(),t),o.setEnd(n.dom(),r),o},rtl:function(e,t,n,r){var o=i.document.createRange();return o.setStart(n.dom(),r),o.setEnd(e.dom(),t),o}})},Bc=function(e,t,n){return t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom},Wc=function(n,r,e,t,o){var i=function(e){var t=n.dom().createRange();return t.setStart(r.dom(),e),t.collapse(!0),t},u=Tn(r).length,a=function(e,t,n,r,o){if(0===o)return 0;if(t===r)return o-1;for(var i=r,u=1;u<o;u++){var a=e(u),c=Math.abs(t-a.left);if(n<=a.bottom){if(n<a.top||i<c)return u-1;i=c}}return 0}(function(e){return i(e).getBoundingClientRect()},e,t,o.right,u);return i(a)},Mc=function(t,n,r,o){var e=t.dom().createRange();e.selectNode(n.dom());var i=e.getClientRects();return No(i,function(e){return Bc(e,r,o)?S.some(e):S.none()}).map(function(e){return Wc(t,n,r,o,e)})},_c=function(t,e,n,r){var o=t.dom().createRange(),i=Rt(e);return No(i,function(e){return o.selectNode(e.dom()),Bc(o.getBoundingClientRect(),n,r)?Lc(t,e,n,r):S.none()})},Lc=function(e,t,n,r){return(se(t)?Mc:_c)(e,t,n,r)},jc=function(e,t){return t-e.left<e.right-t},Fc=function(e,t,n){var r=e.dom().createRange();return r.selectNode(t.dom()),r.collapse(n),r},zc=function(t,e,n){var r=t.dom().createRange();r.selectNode(e.dom());var o=r.getBoundingClientRect(),i=jc(o,n);return(!0===i?An:Pn)(e).map(function(e){return Fc(t,e,i)})},Hc=function(e,t,n){var r=t.dom().getBoundingClientRect(),o=jc(r,n);return S.some(Fc(e,t,o))},Uc=function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect();return function(e,t,n,r){var o=e.dom().createRange();o.selectNode(t.dom());var i=o.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,n)),a=Math.max(i.top,Math.min(i.bottom,r));return Lc(e,t,u,a)}(e,t,Math.max(i.left,Math.min(i.right,n)),Math.max(i.top,Math.min(i.bottom,r)))},qc=document.caretPositionFromPoint?function(n,e,t){return S.from(n.dom().caretPositionFromPoint(e,t)).bind(function(e){if(null===e.offsetNode)return S.none();var t=n.dom().createRange();return t.setStart(e.offsetNode,e.offset),t.collapse(),S.some(t)})}:document.caretRangeFromPoint?function(e,t,n){return S.from(e.dom().caretRangeFromPoint(t,n))}:function(o,i,t){return Re.fromPoint(o,i,t).bind(function(r){var e=function(){return e=o,n=i,(0===Rt(t=r).length?Hc:zc)(e,t,n);var e,t,n};return 0===Rt(r).length?e():Uc(o,r,i,t).orThunk(e)})},Vc=function(e,t){var n=ue(e);return"input"===n?Sc.after(e):k(["br","img"],n)?0===t?Sc.before(e):Sc.after(e):Sc.on(e,t)},Gc=function(e,t){var n=e.fold(Sc.before,Vc,Sc.after),r=t.fold(Sc.before,Vc,Sc.after);return Tc.relative(n,r)},Yc=function(e,t,n,r){var o=Vc(e,t),i=Vc(n,r);return Tc.relative(o,i)},Xc=function(e,t,n,r){var o,i,u,a,c,l=(i=t,u=n,a=r,(c=wt(o=e).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),f=pt(e,n)&&t===r;return l.collapsed&&!f},Kc=function(e,t){S.from(e.getSelection()).each(function(e){e.removeAllRanges(),e.addRange(t)})},Jc=function(e,t,n,r,o){var i=Ec(e,t,n,r,o);Kc(e,i)},$c=function(s,e){return Pc(s,e).match({ltr:function(e,t,n,r){Jc(s,e,t,n,r)},rtl:function(e,t,n,r){var o,i,u,a,c,l=s.getSelection();if(l.setBaseAndExtent)l.setBaseAndExtent(e.dom(),t,n.dom(),r);else if(l.extend)try{i=e,u=t,a=n,c=r,(o=l).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){Jc(s,n,r,e,t)}else Jc(s,n,r,e,t)}})},Qc=function(e){var o=Tc.getWin(e).dom(),t=function(e,t,n,r){return Ec(o,e,t,n,r)},n=e.match({domRange:function(e){var t=Re.fromDom(e.startContainer),n=Re.fromDom(e.endContainer);return Yc(t,e.startOffset,n,e.endOffset)},relative:Gc,exact:Yc});return Pc(o,n).match({ltr:t,rtl:t})},Zc=function(e){var t=Re.fromDom(e.anchorNode),n=Re.fromDom(e.focusNode);return Xc(t,e.anchorOffset,n,e.focusOffset)?S.some(xc.create(t,e.anchorOffset,n,e.focusOffset)):function(e){if(0<e.rangeCount){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return S.some(xc.create(Re.fromDom(t.startContainer),t.startOffset,Re.fromDom(n.endContainer),n.endOffset))}return S.none()}(e)},el=function(e,t){var n,r,o=(n=t,r=e.document.createRange(),Dc(r,n),r);Kc(e,o)},tl=function(e){return(t=e,S.from(t.getSelection()).filter(function(e){return 0<e.rangeCount}).bind(Zc)).map(function(e){return Tc.exact(e.start(),e.soffset(),e.finish(),e.foffset())});var t},nl=function(e,t){var n,r,o,i=Ic(e,t);return r=(n=i).getClientRects(),0<(o=0<r.length?r[0]:n.getBoundingClientRect()).width||0<o.height?S.some(o).map(Nc):S.none()},rl=function(e,t,n){return r=e,o=t,i=n,u=Re.fromDom(r.document),qc(u,o,i).map(function(e){return xc.create(Re.fromDom(e.startContainer),e.startOffset,Re.fromDom(e.endContainer),e.endOffset)});var r,o,i,u},ol=tinymce.util.Tools.resolve("tinymce.util.VK"),il=function(e,t,n,r){return ll(e,t,wc(n),r)},ul=function(e,t,n,r){return ll(e,t,yc(n),r)},al=function(e,t){var n=Tc.exact(t,0,t,0);return Qc(n)},cl=function(e,t){var n,r=Jt(t,"tr");return(n=r,0===n.length?S.none():S.some(n[n.length-1])).bind(function(e){return an(e,"td,th").map(function(e){return al(0,e)})})},ll=function(r,e,t,o,n){return t.fold(S.none,S.none,function(e,t){return An(t).map(function(e){return al(0,e)})},function(n){return pn.table(n,e).bind(function(e){var t=Lr.noMenu(n);return r.undoManager.transact(function(){o.insertRowsAfter(e,t)}),cl(0,e)})})},fl=["table","li","dl"],sl=function(t,n,r,o){if(t.keyCode===ol.TAB){var i=Yu(n),u=function(e){var t=ue(e);return pt(e,i)||k(fl,t)},e=n.selection.getRng();if(e.collapsed){var a=Re.fromDom(e.startContainer);pn.cell(a,u).each(function(e){t.preventDefault(),(t.shiftKey?ul:il)(n,u,e,r,o).each(function(e){n.selection.setRng(e)})})}}},dl={create:K("selection","kill")},ml=function(e,t,n,r){return{start:C(Sc.on(e,t)),finish:C(Sc.on(n,r))}},gl={convertToRange:function(e,t){var n=Ic(e,t);return xc.create(Re.fromDom(n.startContainer),n.startOffset,Re.fromDom(n.endContainer),n.endOffset)},makeSitus:ml},hl=function(n,e,r,t,o){return pt(r,t)?S.none():wr(r,t,e).bind(function(e){var t=e.boxes().getOr([]);return 0<t.length?(o(n,t,e.start(),e.finish()),S.some(dl.create(S.some(gl.makeSitus(r,0,r,En(r))),!0))):S.none()})},pl={sync:function(n,r,e,t,o,i,u){return pt(e,o)&&t===i?S.none():cn(e,"td,th",r).bind(function(t){return cn(o,"td,th",r).bind(function(e){return hl(n,r,t,e,u)})})},detect:hl,update:function(e,t,n,r,o){return xr(r,e,t,o.firstSelectedSelector(),o.lastSelectedSelector()).map(function(e){return o.clear(n),o.selectRange(n,e.boxes(),e.start(),e.finish()),e.boxes()})}},vl=K("item","mode"),bl=function(e,t,n,r){return void 0===r&&(r=wl),e.property().parent(t).map(function(e){return vl(e,r)})},wl=function(e,t,n,r){return void 0===r&&(r=yl),n.sibling(e,t).map(function(e){return vl(e,r)})},yl=function(e,t,n,r){void 0===r&&(r=yl);var o=e.property().children(t);return n.first(o).map(function(e){return vl(e,r)})},xl=[{current:bl,next:wl,fallback:S.none()},{current:wl,next:yl,fallback:S.some(bl)},{current:yl,next:yl,fallback:S.some(wl)}],Cl=function(t,n,r,o,e){return void 0===e&&(e=xl),_(e,function(e){return e.current===r}).bind(function(e){return e.current(t,n,o,e.next).orThunk(function(){return e.fallback.bind(function(e){return Cl(t,n,e,o)})})})},Sl=function(){return{sibling:function(e,t){return e.query().prevSibling(t)},first:function(e){return 0<e.length?S.some(e[e.length-1]):S.none()}}},Rl=function(){return{sibling:function(e,t){return e.query().nextSibling(t)},first:function(e){return 0<e.length?S.some(e[0]):S.none()}}},Tl=function(t,e,n,r,o,i){return Cl(t,e,r,o).bind(function(e){return i(e.item())?S.none():n(e.item())?S.some(e.item()):Tl(t,e.item(),n,e.mode(),o,i)})},Dl=function(t){return function(e){return 0===t.property().children(e).length}},Ol=function(e,t,n,r){return Tl(e,t,n,wl,Sl(),r)},El=function(e,t,n,r){return Tl(e,t,n,wl,Rl(),r)},Nl=ir(),kl=function(e,t){return r=t,Ol(n=Nl,e,Dl(n),r);var n,r},Al=function(e,t){return r=t,El(n=Nl,e,Dl(n),r);var n,r},Pl=K("element","offset"),Il=(K("element","deltaOffset"),K("element","start","finish"),K("begin","end"),K("element","text"),Nr([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}])),Bl=function(e){return cn(e,"tr")},Wl=Oo({},Il,{verify:function(a,e,t,n,r,c,o){return cn(n,"td,th",o).bind(function(u){return cn(e,"td,th",o).map(function(i){return pt(u,i)?pt(n,u)&&En(u)===r?c(i):Il.none("in same cell"):hr.sharedOne(Bl,[u,i]).fold(function(){return t=i,n=u,r=(e=a).getRect(t),(o=e.getRect(n)).right>r.left&&o.left<r.right?Il.success():c(i);var e,t,n,r,o},function(e){return c(i)})})}).getOr(Il.none("default"))},cata:function(e,t,n,r,o){return e.fold(t,n,r,o)}}),Ml=(K("ancestor","descendants","element","index"),K("parent","children","element","index")),_l=function(e,t){return L(e,b(pt,t))},Ll=function(e){return"br"===ue(e)},jl=function(e,t,n){return t(e,n).bind(function(e){return se(e)&&0===Tn(e).trim().length?jl(e,t,n):S.some(e)})},Fl=function(t,e,n,r){return(o=e,i=n,Tt(o,i).filter(Ll).orThunk(function(){return Tt(o,i-1).filter(Ll)})).bind(function(e){return r.traverse(e).fold(function(){return jl(e,r.gather,t).map(r.relative)},function(e){return(r=e,yt(r).bind(function(t){var n=Rt(t);return _l(n,r).map(function(e){return Ml(t,n,r,e)})})).map(function(e){return Sc.on(e.parent(),e.index())});var r})});var o,i},zl=function(e,t,n,r){var o,i,u;return(Ll(t)?(o=e,i=t,(u=r).traverse(i).orThunk(function(){return jl(i,u.gather,o)}).map(u.relative)):Fl(e,t,n,r)).map(function(e){return{start:C(e),finish:C(e)}})},Hl=function(e){return Wl.cata(e,function(e){return S.none()},function(){return S.none()},function(e){return S.some(Pl(e,0))},function(e){return S.some(Pl(e,En(e)))})},Ul=te(["left","top","right","bottom"],[]),ql={nu:Ul,moveUp:function(e,t){return Ul({left:e.left(),top:e.top()-t,right:e.right(),bottom:e.bottom()-t})},moveDown:function(e,t){return Ul({left:e.left(),top:e.top()+t,right:e.right(),bottom:e.bottom()+t})},moveBottomTo:function(e,t){var n=e.bottom()-e.top();return Ul({left:e.left(),top:t-n,right:e.right(),bottom:t})},moveTopTo:function(e,t){var n=e.bottom()-e.top();return Ul({left:e.left(),top:t,right:e.right(),bottom:t+n})},getTop:function(e){return e.top()},getBottom:function(e){return e.bottom()},translate:function(e,t,n){return Ul({left:e.left()+t,top:e.top()+n,right:e.right()+t,bottom:e.bottom()+n})},toString:function(e){return"("+e.left()+", "+e.top()+") -> ("+e.right()+", "+e.bottom()+")"}},Vl=function(e){return ql.nu({left:e.left,top:e.top,right:e.right,bottom:e.bottom})},Gl=function(e,t){return S.some(e.getRect(t))},Yl=function(e,t,n){return fe(t)?Gl(e,t).map(Vl):se(t)?(r=e,o=t,i=n,0<=i&&i<En(o)?r.getRangedRect(o,i,o,i+1):0<i?r.getRangedRect(o,i-1,o,i):S.none()).map(Vl):S.none();var r,o,i},Xl=function(e,t){return fe(t)?Gl(e,t).map(Vl):se(t)?e.getRangedRect(t,0,t,En(t)).map(Vl):S.none()},Kl=Nr([{none:[]},{retry:["caret"]}]),Jl=function(t,e,r){return(n=e,o=Iu,$t(function(e){return o(e)},rn,n,o,i)).fold(C(!1),function(e){return Xl(t,e).exists(function(e){return n=e,(t=r).left()<n.left()||Math.abs(n.right()-t.left())<1||t.left()>n.right();var t,n})});var n,o,i},$l={point:ql.getTop,adjuster:function(e,t,n,r,o){var i=ql.moveUp(o,5);return Math.abs(n.top()-r.top())<1?Kl.retry(i):n.bottom()<o.top()?Kl.retry(i):n.bottom()===o.top()?Kl.retry(ql.moveUp(o,1)):Jl(e,t,o)?Kl.retry(ql.translate(i,5,0)):Kl.none()},move:ql.moveUp,gather:kl},Ql={point:ql.getBottom,adjuster:function(e,t,n,r,o){var i=ql.moveDown(o,5);return Math.abs(n.bottom()-r.bottom())<1?Kl.retry(i):n.top()>o.bottom()?Kl.retry(i):n.top()===o.bottom()?Kl.retry(ql.moveDown(o,1)):Jl(e,t,o)?Kl.retry(ql.translate(i,5,0)):Kl.none()},move:ql.moveDown,gather:Al},Zl=function(n,r,o,i,u){return 0===u?S.some(i):(c=n,l=i.left(),f=r.point(i),c.elementFromPoint(l,f).filter(function(e){return"table"===ue(e)}).isSome()?(t=i,a=u-1,Zl(n,e=r,o,e.move(t,5),a)):n.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(S.none,function(t){return Xl(n,t).bind(function(e){return r.adjuster(n,t,e,o,i).fold(S.none,function(e){return Zl(n,r,o,e,u-1)})}).orThunk(function(){return S.some(i)})},S.none)}));var e,t,a,c,l,f},ef=function(t,n,e){var r,o,i,u=t.move(e,5),a=Zl(n,t,e,u,100).getOr(u);return(r=t,o=a,i=n,r.point(o)>i.getInnerHeight()?S.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return n.situsFromPoint(a.left(),t.point(a))},function(e){return n.scrollBy(0,e),n.situsFromPoint(a.left(),t.point(a)-e)})},tf={tryUp:b(ef,$l),tryDown:b(ef,Ql),ieTryUp:function(e,t){return e.situsFromPoint(t.left(),t.top()-5)},ieTryDown:function(e,t){return e.situsFromPoint(t.left(),t.bottom()+5)},getJumpSize:C(5)},nf=st.detect(),rf=function(r,o,i,u,a,c){return 0===c?S.none():af(r,o,i,u,a).bind(function(e){var t=r.fromSitus(e),n=Wl.verify(r,i,u,t.finish(),t.foffset(),a.failure,o);return Wl.cata(n,function(){return S.none()},function(){return S.some(e)},function(e){return pt(i,e)&&0===u?of(r,i,u,ql.moveUp,a):rf(r,o,e,0,a,c-1)},function(e){return pt(i,e)&&u===En(e)?of(r,i,u,ql.moveDown,a):rf(r,o,e,En(e),a,c-1)})})},of=function(t,e,n,r,o){return Yl(t,e,n).bind(function(e){return uf(t,o,r(e,tf.getJumpSize()))})},uf=function(e,t,n){return nf.browser.isChrome()||nf.browser.isSafari()||nf.browser.isFirefox()||nf.browser.isEdge()?t.otherRetry(e,n):nf.browser.isIE()?t.ieRetry(e,n):S.none()},af=function(t,e,n,r,o){return Yl(t,n,r).bind(function(e){return uf(t,o,e)})},cf=function(t,n,r){return(o=t,i=n,u=r,o.getSelection().bind(function(r){return zl(i,r.finish(),r.foffset(),u).fold(function(){return S.some(Pl(r.finish(),r.foffset()))},function(e){var t=o.fromSitus(e),n=Wl.verify(o,r.finish(),r.foffset(),t.finish(),t.foffset(),u.failure,i);return Hl(n)})})).bind(function(e){return rf(t,n,e.element(),e.offset(),r,20).map(t.fromSitus)});var o,i,u},lf=st.detect(),ff=function(e,t){return rn(e,function(e){return yt(e).exists(function(e){return pt(e,t)})},n).isSome();var n},sf=function(t,r,o,e,i){return cn(e,"td,th",r).bind(function(n){return cn(n,"table",r).bind(function(e){return ff(i,e)?cf(t,r,o).bind(function(t){return cn(t.finish(),"td,th",r).map(function(e){return{start:C(n),finish:C(e),range:C(t)}})}):S.none()})})},df=function(e,t,n,r,o,i){return lf.browser.isIE()?S.none():i(r,t).orThunk(function(){return sf(e,t,n,r,o).map(function(e){var t=e.range();return dl.create(S.some(gl.makeSitus(t.start(),t.soffset(),t.finish(),t.foffset())),!0)})})},mf=function(e,t,n,r,o,i,u){return sf(e,n,r,o,i).bind(function(e){return pl.detect(t,n,e.start(),e.finish(),u)})},gf=function(e,u){return cn(e,"tr",u).bind(function(i){return cn(i,"table",u).bind(function(e){var t,n,r,o=Jt(e,"tr");return pt(i,o[0])?(t=e,n=function(e){return Pn(e).isSome()},r=u,Ol(Nl,t,n,r)).map(function(e){var t=En(e);return dl.create(S.some(gl.makeSitus(e,t,e,t)),!0)}):S.none()})})},hf=function(e,u){return cn(e,"tr",u).bind(function(i){return cn(i,"table",u).bind(function(e){var t,n,r,o=Jt(e,"tr");return pt(i,o[o.length-1])?(t=e,n=function(e){return An(e).isSome()},r=u,El(Nl,t,n,r)).map(function(e){return dl.create(S.some(gl.makeSitus(e,0,e,0)),!0)}):S.none()})})},pf=function(e,t){return cn(e,"td,th",t)},vf={down:{traverse:St,gather:Al,relative:Sc.before,otherRetry:tf.tryDown,ieRetry:tf.ieTryDown,failure:Wl.failedDown},up:{traverse:Ct,gather:kl,relative:Sc.before,otherRetry:tf.tryUp,ieRetry:tf.ieTryUp,failure:Wl.failedUp}},bf=function(t){return function(e){return e===t}},wf=bf(38),yf=bf(40),xf={ltr:{isBackward:bf(37),isForward:bf(39)},rtl:{isBackward:bf(39),isForward:bf(37)},isUp:wf,isDown:yf,isNavigation:function(e){return 37<=e&&e<=40}},Cf=(st.detect().browser.isSafari(),function(a){return{elementFromPoint:function(e,t){return Re.fromPoint(Re.fromDom(a.document),e,t)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,t,n,r){var o=Tc.exact(e,t,n,r);return nl(a,o).map(function(e){return Y(e,c)})},getSelection:function(){return tl(a).map(function(e){return gl.convertToRange(a,e)})},fromSitus:function(e){var t=Tc.relative(e.start(),e.finish());return gl.convertToRange(a,t)},situsFromPoint:function(e,t){return rl(a,e,t).map(function(e){return ml(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){a.getSelection().removeAllRanges()},setSelection:function(e){var t,n,r,o,i,u;t=a,n=e.start(),r=e.soffset(),o=e.finish(),i=e.foffset(),u=Yc(n,r,o,i),$c(t,u)},setRelativeSelection:function(e,t){var n,r;n=a,r=Gc(e,t),$c(n,r)},selectContents:function(e){el(a,e)},getInnerHeight:function(){return a.innerHeight},getScrollY:function(){var e,t,n,r;return(e=Re.fromDom(a.document),t=e!==undefined?e.dom():m.document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop,co(n,r)).top()},scrollBy:function(e,t){var n,r,o;n=e,r=t,((o=Re.fromDom(a.document))!==undefined?o.dom():m.document).defaultView.scrollBy(n,r)}}}),Sf=K("rows","cols"),Rf={mouse:function(e,t,n,r){var o,i,u,a,c,l,f=Cf(e),s=(o=f,i=t,u=n,a=r,c=S.none(),l=function(){c=S.none()},{mousedown:function(e){a.clear(i),c=pf(e.target(),u)},mouseover:function(e){c.each(function(r){a.clear(i),pf(e.target(),u).each(function(n){wr(r,n,u).each(function(e){var t=e.boxes().getOr([]);(1<t.length||1===t.length&&!pt(r,n))&&(a.selectRange(i,t,e.start(),e.finish()),o.selectContents(n))})})})},mouseup:function(e){c.each(l)}});return{mousedown:s.mousedown,mouseover:s.mouseover,mouseup:s.mouseup}},keyboard:function(e,l,f,s){var d=Cf(e),m=function(){return s.clear(l),S.none()};return{keydown:function(e,t,n,r,o,i){var u=e.raw(),a=u.which,c=!0===u.shiftKey;return yr(l,s.selectedSelector()).fold(function(){return xf.isDown(a)&&c?b(mf,d,l,f,vf.down,r,t,s.selectRange):xf.isUp(a)&&c?b(mf,d,l,f,vf.up,r,t,s.selectRange):xf.isDown(a)?b(df,d,f,vf.down,r,t,hf):xf.isUp(a)?b(df,d,f,vf.up,r,t,gf):S.none},function(t){var e=function(e){return function(){return No(e,function(e){return pl.update(e.rows(),e.cols(),l,t,s)}).fold(function(){return Cr(l,s.firstSelectedSelector(),s.lastSelectedSelector()).map(function(e){var t=xf.isDown(a)||i.isForward(a)?Sc.after:Sc.before;return d.setRelativeSelection(Sc.on(e.first(),0),t(e.table())),s.clear(l),dl.create(S.none(),!0)})},function(e){return S.some(dl.create(S.none(),!0))})}};return xf.isDown(a)&&c?e([Sf(1,0)]):xf.isUp(a)&&c?e([Sf(-1,0)]):i.isBackward(a)&&c?e([Sf(0,-1),Sf(-1,0)]):i.isForward(a)&&c?e([Sf(0,1),Sf(1,0)]):xf.isNavigation(a)&&!1===c?m:S.none})()},keyup:function(n,r,o,i,u){return yr(l,s.selectedSelector()).fold(function(){var e=n.raw(),t=e.which;return 0==(!0===e.shiftKey)?S.none():xf.isNavigation(t)?pl.sync(l,f,r,o,i,u,s.selectRange):S.none()},S.none)}}}},Tf=function(r,e){I(e,function(e){var t,n;n=e,Bo(t=r)?t.dom().classList.remove(n):Mo(t,n),Lo(t)})},Df={byClass:function(o){var t,n,i=(t=o.selected(),function(e){_o(e,t)}),r=(n=[o.selected(),o.lastSelected(),o.firstSelected()],function(e){Tf(e,n)}),u=function(e){var t=Jt(e,o.selectedSelector());I(t,r)};return{clear:u,selectRange:function(e,t,n,r){u(e),I(t,i),_o(n,o.firstSelected()),_o(r,o.lastSelected())},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o){var n=function(e){be(e,o.selected()),be(e,o.firstSelected()),be(e,o.lastSelected())},i=function(e){ge(e,o.selected(),"1")},u=function(e){var t=Jt(e,o.selectedSelector());I(t,n)};return{clear:u,selectRange:function(e,t,n,r){u(e),I(t,i),ge(n,o.firstSelected(),"1"),ge(r,o.lastSelected(),"1")},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},Of=function(e){return!1===jo(Re.fromDom(e.target),"ephox-snooker-resizer-bar")};function Ef(h,p){var v=te(["mousedown","mouseover","mouseup","keyup","keydown"],[]),b=S.none(),w=Df.byAttr(Er);return h.on("init",function(e){var r=h.getWin(),o=Yu(h),t=Ju(h),n=Rf.mouse(r,o,t,w),a=Rf.keyboard(r,o,t,w),c=function(e,t){!0===e.raw().shiftKey&&(t.kill()&&e.kill(),t.selection().each(function(e){var t=Tc.relative(e.start(),e.finish()),n=Ic(r,t);h.selection.setRng(n)}))},i=function(e){var t=f(e);if(t.raw().shiftKey&&xf.isNavigation(t.raw().which)){var n=h.selection.getRng(),r=Re.fromDom(n.startContainer),o=Re.fromDom(n.endContainer);a.keyup(t,r,n.startOffset,o,n.endOffset).each(function(e){c(t,e)})}},u=function(e){var t=f(e);p().each(function(e){e.hideBars()});var n=h.selection.getRng(),r=Re.fromDom(h.selection.getStart()),o=Re.fromDom(n.startContainer),i=Re.fromDom(n.endContainer),u=ta.directionAt(r).isRtl()?xf.rtl:xf.ltr;a.keydown(t,o,n.startOffset,i,n.endOffset,u).each(function(e){c(t,e)}),p().each(function(e){e.showBars()})},l=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},f=function(e){var t=Re.fromDom(e.target),n=function(){e.stopPropagation()},r=function(){e.preventDefault()},o=x(r,n);return{target:C(t),x:C(l(e)?e.x:null),y:C(l(e)?e.y:null),stop:n,prevent:r,kill:o,raw:C(e)}},s=function(e){return 0===e.button},d=function(e){s(e)&&Of(e)&&n.mousedown(f(e))},m=function(e){var t;(t=e).buttons!==undefined&&0==(1&t.buttons)||!Of(e)||n.mouseover(f(e))},g=function(e){s(e)&&Of(e)&&n.mouseup(f(e))};h.on("mousedown",d),h.on("mouseover",m),h.on("mouseup",g),h.on("keyup",i),h.on("keydown",u),h.on("nodechange",function(){var e=h.selection,t=Re.fromDom(e.getStart()),n=Re.fromDom(e.getEnd());hr.sharedOne(pn.table,[t,n]).fold(function(){w.clear(o)},y)}),b=S.some(v({mousedown:d,mouseover:m,mouseup:g,keyup:i,keydown:u}))}),{clear:w.clear,destroy:function(){b.each(function(e){})}}}var Nf=wa.each,kf=function(t){var n=[];function e(e){return function(){t.execCommand(e)}}Nf("inserttable tableprops deletetable | cell row column".split(" "),function(e){"|"===e?n.push({text:"-"}):n.push(t.menuItems[e])}),t.addButton("table",{type:"menubutton",title:"Table",menu:n}),t.addButton("tableprops",{title:"Table properties",onclick:e("mceTableProps"),icon:"table"}),t.addButton("tabledelete",{title:"Delete table",onclick:e("mceTableDelete")}),t.addButton("tablecellprops",{title:"Cell properties",onclick:e("mceTableCellProps")}),t.addButton("tablemergecells",{title:"Merge cells",onclick:e("mceTableMergeCells")}),t.addButton("tablesplitcells",{title:"Split cell",onclick:e("mceTableSplitCells")}),t.addButton("tableinsertrowbefore",{title:"Insert row before",onclick:e("mceTableInsertRowBefore")}),t.addButton("tableinsertrowafter",{title:"Insert row after",onclick:e("mceTableInsertRowAfter")}),t.addButton("tabledeleterow",{title:"Delete row",onclick:e("mceTableDeleteRow")}),t.addButton("tablerowprops",{title:"Row properties",onclick:e("mceTableRowProps")}),t.addButton("tablecutrow",{title:"Cut row",onclick:e("mceTableCutRow")}),t.addButton("tablecopyrow",{title:"Copy row",onclick:e("mceTableCopyRow")}),t.addButton("tablepasterowbefore",{title:"Paste row before",onclick:e("mceTablePasteRowBefore")}),t.addButton("tablepasterowafter",{title:"Paste row after",onclick:e("mceTablePasteRowAfter")}),t.addButton("tableinsertcolbefore",{title:"Insert column before",onclick:e("mceTableInsertColBefore")}),t.addButton("tableinsertcolafter",{title:"Insert column after",onclick:e("mceTableInsertColAfter")}),t.addButton("tabledeletecol",{title:"Delete column",onclick:e("mceTableDeleteCol")})},Af=function(t){var e,n=""===(e=t.getParam("table_toolbar",na))||!1===e?[]:w(e)?e.split(/[ ,]/):R(e)?e:[];0<n.length&&t.addContextToolbar(function(e){return t.dom.is(e,"table")&&t.getBody().contains(e)},n.join(" "))},Pf=function(o,n){var r=S.none(),i=[],u=[],a=[],c=[],l=function(e){e.disabled(!0)},f=function(e){e.disabled(!1)},e=function(){var t=this;i.push(t),r.fold(function(){l(t)},function(e){f(t)})},t=function(){var t=this;u.push(t),r.fold(function(){l(t)},function(e){f(t)})};o.on("init",function(){o.on("nodechange",function(e){var t=S.from(o.dom.getParent(o.selection.getStart(),"th,td"));(r=t.bind(function(e){var t=Re.fromDom(e);return pn.table(t).map(function(e){return Lr.forMenu(n,e,t)})})).fold(function(){I(i,l),I(u,l),I(a,l),I(c,l)},function(t){I(i,f),I(u,f),I(a,function(e){e.disabled(t.mergable().isNone())}),I(c,function(e){e.disabled(t.unmergable().isNone())})})})});var s=function(e,t,n,r){var o,i,u,a,c,l=r.getEl().getElementsByTagName("table")[0],f=r.isRtl()||"tl-tr"===r.parent().rel;for(l.nextSibling.innerHTML=t+1+" x "+(n+1),f&&(t=9-t),i=0;i<10;i++)for(o=0;o<10;o++)a=l.rows[i].childNodes[o].firstChild,c=(f?t<=o:o<=t)&&i<=n,e.dom.toggleClass(a,"mce-active",c),c&&(u=a);return u.parentNode},d=!1===o.getParam("table_grid",!0,"boolean")?{text:"Table",icon:"table",context:"table",onclick:m("mceInsertTable")}:{text:"Table",icon:"table",context:"table",ariaHideMenu:!0,onclick:function(e){e.aria&&(this.parent().hideAll(),e.stopImmediatePropagation(),o.execCommand("mceInsertTable"))},onshow:function(){s(o,0,0,this.menu.items()[0])},onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:function(){var e="";e='<table role="grid" class="mce-grid mce-grid-border" aria-readonly="true">';for(var t=0;t<10;t++){e+="<tr>";for(var n=0;n<10;n++)e+='<td role="gridcell" tabindex="-1"><a id="mcegrid'+(10*t+n)+'" href="#" data-mce-x="'+n+'" data-mce-y="'+t+'"></a></td>';e+="</tr>"}return e+="</table>",e+='<div class="mce-text-center" role="presentation">1 x 1</div>'}(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t,n,r=e.target;"A"===r.tagName.toUpperCase()&&(t=parseInt(r.getAttribute("data-mce-x"),10),n=parseInt(r.getAttribute("data-mce-y"),10),(this.isRtl()||"tl-tr"===this.parent().rel)&&(t=9-t),t===this.lastX&&n===this.lastY||(s(o,t,n,e.control),this.lastX=t,this.lastY=n))},onclick:function(e){var t=this;"A"===e.target.tagName.toUpperCase()&&(e.preventDefault(),e.stopPropagation(),t.parent().cancel(),o.undoManager.transact(function(){Ma(o,t.lastX+1,t.lastY+1)}),o.addVisual())}}]};function m(e){return function(){o.execCommand(e)}}var g={text:"Table properties",context:"table",onPostRender:e,onclick:m("mceTableProps")},h={text:"Delete table",context:"table",onPostRender:e,cmd:"mceTableDelete"},p={text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:t},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:t},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:t},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:t},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:t},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:t},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:t},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:t}]},v={text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:t},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:t},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:t}]},b={separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:t},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:function(){var t=this;a.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.mergable().isNone())})}},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:function(){var t=this;c.push(t),r.fold(function(){l(t)},function(e){t.disabled(e.unmergable().isNone())})}}]};o.addMenuItem("inserttable",d),o.addMenuItem("tableprops",g),o.addMenuItem("deletetable",h),o.addMenuItem("row",p),o.addMenuItem("column",v),o.addMenuItem("cell",b)},If=function(n,r){return{insertTable:function(e,t){return Ma(n,e,t)},setClipboardRows:function(e){return t=r,n=P(e,Re.fromDom),void t.set(S.from(n));var t,n},getClipboardRows:function(){return r.get().fold(function(){},function(e){return P(e,function(e){return e.dom()})})}}};e.add("table",function(t){var n,r=hc(t),e=Ef(t,r.lazyResize),o=va(t,r.lazyWire),i=(n=t,{get:function(){var e=Yu(n);return Sr(e,Er.selectedSelector()).fold(function(){return n.selection.getStart()===undefined?Ar.none():Ar.single(n.selection)},function(e){return Ar.multiple(e)})}}),u=vu(S.none());return Ha(t,o,e,i,u),jr(t,i,o,e),Pf(t,i),kf(t),Af(t),t.on("PreInit",function(){t.serializer.addTempAttr(Er.firstSelected()),t.serializer.addTempAttr(Er.lastSelected())}),t.getParam("table_tab_navigation",!0,"boolean")&&t.on("keydown",function(e){sl(e,t,o,r.lazyWire)}),t.on("remove",function(){r.destroy(),e.destroy()}),If(t,u)})}(window);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in plugin.min.js

CWE-79
File Location: lib/web/tiny_mce_4/plugins/template/plugin.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=tinymce.util.Tools.resolve("tinymce.util.XHR"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=function(e){return e.getParam("template_cdate_classes","cdate")},s=function(e){return e.getParam("template_mdate_classes","mdate")},u=function(e){return e.getParam("template_selected_content_classes","selcontent")},p=function(e){return e.getParam("template_preview_replace_values")},m=function(e){return e.getParam("template_replace_values")},a=function(e){return e.templates},d=function(e){return e.getParam("template_cdate_format",e.getLang("template.cdate_format"))},f=function(e){return e.getParam("template_mdate_format",e.getLang("template.mdate_format"))},g=function(e){return e.getParam("template_popup_width",600)},h=function(e){return Math.min(t.DOM.getViewPort().h,e.getParam("template_popup_height",500))},y=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},v=function(e,t,n){var a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),l="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),c="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",y(n.getMonth()+1,2))).replace("%d",y(n.getDate(),2))).replace("%H",""+y(n.getHours(),2))).replace("%M",""+y(n.getMinutes(),2))).replace("%S",""+y(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(c[n.getMonth()]))).replace("%b",""+e.translate(l[n.getMonth()]))).replace("%A",""+e.translate(r[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")},M=function(e,n,t){return o.each(t,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n},_=function(e,t){var a=e.dom,r=m(e);o.each(a.select("*",t),function(n){o.each(r,function(e,t){a.hasClass(n,t)&&"function"==typeof r[t]&&r[t](n)})})},b=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},n=function(t,n){return function(){var e=a(t);"function"!=typeof e?"string"==typeof e?c.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},T=M,r=_,x=function(t,e,n){var a,r,l=t.dom,c=t.selection.getContent();n=M(0,n,m(t)),a=l.create("div",null,n),(r=l.select(".mceTmpl",a))&&0<r.length&&(a=l.create("div",null)).appendChild(r[0].cloneNode(!0)),o.each(l.select("*",a),function(e){b(e,i(t).replace(/\s+/g,"|"))&&(e.innerHTML=v(t,d(t))),b(e,s(t).replace(/\s+/g,"|"))&&(e.innerHTML=v(t,f(t))),b(e,u(t).replace(/\s+/g,"|"))&&(e.innerHTML=c)}),_(t,a),t.execCommand("mceInsertContent",!1,a.innerHTML),t.addVisual()},l=function(e){e.addCommand("mceInsertTemplate",function(a){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.concat(e);return a.apply(null,n)}}(x,e))},P=function(a){a.on("PreProcess",function(e){var t=a.dom,n=f(a);o.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(o.each(t.select("*",e),function(e){t.hasClass(e,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=v(a,n))}),r(a,e))})})},S=function(t,e,n){if(-1===n.indexOf("<html>")){var a="";o.each(t.contentCSS,function(e){a+='<link type="text/css" rel="stylesheet" href="'+t.documentBaseURI.toAbsolute(e)+'">'});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||""),n="<!DOCTYPE html><html><head>"+a+'</head><body class="'+r+'">'+n+"</body></html>"}n=T(t,n,p(t));var l=e.find("iframe")[0].getEl().contentWindow.document;l.open(),l.write(n),l.close()},D=function(n,e){var a,r,t=[];if(e&&0!==e.length)o.each(e,function(e){t.push({selected:!t.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),(a=n.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:t,onselect:function(e){var t=e.control.value();t.url?c.send({url:t.url,success:function(e){S(n,a,r=e)}}):(r=t.content,S(n,a,r)),a.find("#description")[0].text(e.control.value().description)}}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){x(n,!1,r)},minWidth:g(n),minHeight:h(n)})).find("listbox")[0].fire("select");else{var l=n.translate("No templates defined.");n.notificationManager.open({text:l,type:"info"})}},H=function(t){return function(e){D(t,e)}},w=function(e){e.addButton("template",{title:"Insert template",onclick:n(e.settings,H(e))}),e.addMenuItem("template",{text:"Template",onclick:n(e.settings,H(e)),icon:"template",context:"insert"})};e.add("template",function(e){w(e),l(e),P(e)})}();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in theme.min.js

CWE-79
File Location: lib/web/tiny_mce_4/themes/mobile/theme.min.js:1
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(v){"use strict";var I=function(){},p=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},M=function(n){return function(){return n}},h=function(n){return n};function l(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,o,i,u,c,w=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return!t.apply(null,n)}},a=function(n){return function(){throw new Error(n)}},s=function(n){return n()},f=M(!1),d=M(!0),m=function(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===e}},b=m("string"),g=m("object"),y=m("array"),x=m("boolean"),S=m("function"),O=m("number"),T=Object.prototype.hasOwnProperty,k=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)T.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},C=k(function(n,e){return g(n)&&g(e)?C(n,e):e}),E=k(function(n,e){return e}),D=f,A=d,B=function(){return R},R=(r={fold:function(n,e){return n()},is:D,isSome:D,isNone:A,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:e,map:B,ap:B,each:function(){},bind:B,flatten:B,exists:D,forall:A,filter:B,equals:n=function(n){return n.isNone()},equals_:n,toArray:function(){return[]},toString:M("none()")},Object.freeze&&Object.freeze(r),r),F=function(t){var n=function(){return t},e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:A,isNone:D,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return F(n(t))},ap:function(n){return n.fold(B,function(n){return F(n(t))})},each:function(n){n(t)},bind:r,flatten:n,exists:r,forall:r,filter:function(n){return n(t)?o:R},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(D,function(n){return e(t,n)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},V={some:F,none:B,from:function(n){return null===n||n===undefined?R:F(n)}},N=Object.keys,H=function(n,e){for(var t=N(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i,n)}},z=function(n,r){return j(n,function(n,e,t){return{k:e,v:r(n,e,t)}})},j=function(r,o){var i={};return H(r,function(n,e){var t=o(n,e,r);i[t.k]=t.v}),i},L=function(n,t){var r=[];return H(n,function(n,e){r.push(t(n,e))}),r},P=M("touchstart"),$=M("touchmove"),W=M("touchend"),G=M("mousedown"),_=M("mousemove"),U=M("mouseup"),q=M("mouseover"),Y=M("keydown"),K=M("input"),X=M("change"),J=M("click"),Q=M("transitionend"),Z=M("selectstart"),nn=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},en=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return rn(r(1),r(2))},tn=function(){return rn(0,0)},rn=function(n,e){return{major:n,minor:e}},on={nu:rn,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?tn():en(n,t)},unknown:tn},un="Firefox",cn=function(n,e){return function(){return e===n}},an=function(n){var e=n.current;return{current:e,version:n.version,isEdge:cn("Edge",e),isChrome:cn("Chrome",e),isIE:cn("IE",e),isOpera:cn("Opera",e),isFirefox:cn(un,e),isSafari:cn("Safari",e)}},sn={unknown:function(){return an({current:undefined,version:on.unknown()})},nu:an,edge:M("Edge"),chrome:M("Chrome"),ie:M("IE"),opera:M("Opera"),firefox:M(un),safari:M("Safari")},fn="Windows",ln="Android",dn="Solaris",mn="FreeBSD",gn=function(n,e){return function(){return e===n}},vn=function(n){var e=n.current;return{current:e,version:n.version,isWindows:gn(fn,e),isiOS:gn("iOS",e),isAndroid:gn(ln,e),isOSX:gn("OSX",e),isLinux:gn("Linux",e),isSolaris:gn(dn,e),isFreeBSD:gn(mn,e)}},pn={unknown:function(){return vn({current:undefined,version:on.unknown()})},nu:vn,windows:M(fn),ios:M("iOS"),android:M(ln),linux:M("Linux"),osx:M("OSX"),solaris:M(dn),freebsd:M(mn)},hn=Array.prototype.slice,bn=(o=Array.prototype.indexOf)===undefined?function(n,e){return En(n,e)}:function(n,e){return o.call(n,e)},yn=function(n,e){return-1<bn(n,e)},xn=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o,n)}return r},wn=function(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t,n)},Sn=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r,n)&&t.push(i)}return t},On=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--)e(n[t],t,n)}(n,function(n){t=e(t,n)}),t},Tn=function(n,e,t){return wn(n,function(n){t=e(t,n)}),t},kn=function(n,e){for(var t=0,r=n.length;t<r;t++){var o=n[t];if(e(o,t,n))return V.some(o)}return V.none()},Cn=function(n,e){for(var t=0,r=n.length;t<r;t++)if(e(n[t],t,n))return V.some(t);return V.none()},En=function(n,e){for(var t=0,r=n.length;t<r;++t)if(n[t]===e)return t;return-1},Dn=Array.prototype.push,In=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!Array.prototype.isPrototypeOf(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);Dn.apply(e,n[t])}return e},Mn=function(n,e){var t=xn(n,e);return In(t)},An=function(n,e){for(var t=0,r=n.length;t<r;++t)if(!0!==e(n[t],t,n))return!1;return!0},Bn=function(n){var e=hn.call(n,0);return e.reverse(),e},Rn=function(n){return[n]},Fn=(S(Array.from)&&Array.from,function(n,e){var t=String(e).toLowerCase();return kn(n,function(n){return n.search(t)})}),Vn=function(n,t){return Fn(n,t).map(function(n){var e=on.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Nn=function(n,t){return Fn(n,t).map(function(n){var e=on.detect(n.versionRegexes,t);return{current:n.name,version:e}})},Hn=function(n,e){return-1!==n.indexOf(e)},zn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,jn=function(e){return function(n){return Hn(n,e)}},Ln=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Hn(n,"edge/")&&Hn(n,"chrome")&&Hn(n,"safari")&&Hn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zn],search:function(n){return Hn(n,"chrome")&&!Hn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Hn(n,"msie")||Hn(n,"trident")}},{name:"Opera",versionRegexes:[zn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:jn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:jn("firefox")},{name:"Safari",versionRegexes:[zn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Hn(n,"safari")||Hn(n,"mobile/"))&&Hn(n,"applewebkit")}}],Pn=[{name:"Windows",search:jn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Hn(n,"iphone")||Hn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:jn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:jn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:jn("linux"),versionRegexes:[]},{name:"Solaris",search:jn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:jn("freebsd"),versionRegexes:[]}],$n={browsers:M(Ln),oses:M(Pn)},Wn=function(n){var e,t,r,o,i,u,c,a,s,f,l,d=$n.browsers(),m=$n.oses(),g=Vn(d,n).fold(sn.unknown,sn.nu),v=Nn(m,n).fold(pn.unknown,pn.nu);return{browser:g,os:v,deviceType:(t=g,r=n,o=(e=v).isiOS()&&!0===/ipad/i.test(r),i=e.isiOS()&&!o,u=e.isAndroid()&&3===e.version.major,c=e.isAndroid()&&4===e.version.major,a=o||u||c&&!0===/mobile/i.test(r),s=e.isiOS()||e.isAndroid(),f=s&&!a,l=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),{isiPad:M(o),isiPhone:M(i),isTablet:M(a),isPhone:M(f),isTouch:M(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:M(l)})}},Gn={detect:nn(function(){var n=v.navigator.userAgent;return Wn(n)})},_n={tap:M("alloy.tap")},Un=M("alloy.focus"),qn=M("alloy.blur.post"),Yn=M("alloy.receive"),Kn=M("alloy.execute"),Xn=M("alloy.focus.item"),Jn=_n.tap,Qn=Gn.detect().deviceType.isTouch()?_n.tap:J,Zn=M("alloy.longpress"),ne=M("alloy.system.init"),ee=M("alloy.system.scroll"),te=M("alloy.system.attached"),re=M("alloy.system.detached"),oe=function(n,e){ae(n,n.element(),e,{})},ie=function(n,e,t){ae(n,n.element(),e,t)},ue=function(n){oe(n,Kn())},ce=function(n,e,t){ae(n,e,t,{})},ae=function(n,e,t,r){var o=C({target:e},r);n.getSystem().triggerEvent(t,e,z(o,M))},se=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:M(n)}},fe={fromHtml:function(n,e){var t=(e||v.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw v.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return se(t.childNodes[0])},fromTag:function(n,e){var t=(e||v.document).createElement(n);return se(t)},fromText:function(n,e){var t=(e||v.document).createTextNode(n);return se(t)},fromDom:se,fromPoint:function(n,e,t){var r=n.dom();return V.from(r.elementFromPoint(e,t)).map(se)}},le=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE),de=(v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),me=v.Node.TEXT_NODE,ge=(v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,function(n){return n.dom().nodeName.toLowerCase()}),ve=function(e){return function(n){return n.dom().nodeType===e}},pe=ve(de),he=ve(me),be=function(n){var e=he(n)?n.dom().parentNode:n.dom();return e!==undefined&&null!==e&&e.ownerDocument.body.contains(e)},ye=nn(function(){return xe(fe.fromDom(v.document))}),xe=function(n){var e=n.dom().body;if(null===e||e===undefined)throw new Error("Body is not available yet");return fe.fromDom(e)},we=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return wn(e,function(n,e){r[n]=M(t[e])}),r}},Se=function(n){return n.slice(0).sort()},Oe=function(n,e){throw new Error("All required keys ("+Se(n).join(", ")+") were not specified. Specified keys were: "+Se(e).join(", ")+".")},Te=function(n){throw new Error("Unsupported keys for object: "+Se(n).join(", "))},ke=function(e,n){if(!y(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");wn(n,function(n){if(!b(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})},Ce=function(n){var t=Se(n);kn(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")})},Ee=function(o,i){var u=o.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return ke("required",o),ke("optional",i),Ce(u),function(e){var t=N(e);An(o,function(n){return yn(t,n)})||Oe(o,t);var n=Sn(t,function(n){return!yn(u,n)});0<n.length&&Te(n);var r={};return wn(o,function(n){r[n]=M(e[n])}),wn(i,function(n){r[n]=M(Object.prototype.hasOwnProperty.call(e,n)?V.some(e[n]):V.none())}),r}},De="undefined"!=typeof v.window?v.window:Function("return this;")(),Ie=function(n,e){return function(n,e){for(var t=e!==undefined&&null!==e?e:De,r=0;r<n.length&&t!==undefined&&null!==t;++r)t=t[n[r]];return t}(n.split("."),e)},Me={getOrDie:function(n,e){var t=Ie(n,e);if(t===undefined||null===t)throw n+" not available on this browser";return t}},Ae=de,Be=le,Re=function(n,e){var t=n.dom();if(t.nodeType!==Ae)return!1;if(t.matches!==undefined)return t.matches(e);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(e);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(e);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},Fe=function(n){return n.nodeType!==Ae&&n.nodeType!==Be||0===n.childElementCount},Ve=function(n,e){var t=e===undefined?v.document:e.dom();return Fe(t)?[]:xn(t.querySelectorAll(n),fe.fromDom)},Ne=function(n,e){var t=e===undefined?v.document:e.dom();return Fe(t)?V.none():V.from(t.querySelector(n)).map(fe.fromDom)},He=function(n,e){return n.dom()===e.dom()},ze=(Gn.detect().browser.isIE(),function(n){return fe.fromDom(n.dom().ownerDocument)}),je=function(n){var e=n.dom().ownerDocument.defaultView;return fe.fromDom(e)},Le=function(n){var e=n.dom();return V.from(e.parentNode).map(fe.fromDom)},Pe=function(n){var e=n.dom();return xn(e.childNodes,fe.fromDom)},$e=function(n){return e=0,t=n.dom().childNodes,V.from(t[e]).map(fe.fromDom);var e,t},We=(we("element","offset"),function(e,t){$e(e).fold(function(){Ge(e,t)},function(n){e.dom().insertBefore(t.dom(),n.dom())})}),Ge=function(n,e){n.dom().appendChild(e.dom())},_e=function(e,n){wn(n,function(n){Ge(e,n)})},Ue=function(n){n.dom().textContent="",wn(Pe(n),function(n){qe(n)})},qe=function(n){var e=n.dom();null!==e.parentNode&&e.parentNode.removeChild(e)},Ye=function(n){oe(n,re());var e=n.components();wn(e,Ye)},Ke=function(n){var e=n.components();wn(e,Ke),oe(n,te())},Xe=function(n,e){Je(n,e,Ge)},Je=function(n,e,t){n.getSystem().addToWorld(e),t(n.element(),e.element()),be(n.element())&&Ke(e),n.syncComponents()},Qe=function(n){Ye(n),qe(n.element()),n.getSystem().removeFromWorld(n)},Ze=function(e){var n=Le(e.element()).bind(function(n){return e.getSystem().getByDom(n).fold(V.none,V.some)});Qe(e),n.each(function(n){n.syncComponents()})},nt=function(t){return{is:function(n){return t===n},isValue:d,isError:f,getOr:M(t),getOrThunk:M(t),getOrDie:M(t),or:function(n){return nt(t)},orThunk:function(n){return nt(t)},fold:function(n,e){return e(t)},map:function(n){return nt(n(t))},mapError:function(n){return nt(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOption:function(){return V.some(t)}}},et=function(t){return{is:f,isValue:f,isError:d,getOr:h,getOrThunk:function(n){return n()},getOrDie:function(){return a(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return et(t)},mapError:function(n){return et(n(t))},each:I,bind:function(n){return et(t)},exists:f,forall:d,toOption:V.none}},tt={value:nt,error:et,fromOption:function(n,e){return n.fold(function(){return et(e)},nt)}},rt=function(u){if(!y(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return wn(u,function(n,r){var e=N(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!y(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=N(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!An(c,function(n){return yn(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){v.console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},ot=rt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),it=function(n){return ot.defaultedThunk(M(n))},ut=ot.strict,ct=ot.asOption,at=ot.defaultedThunk,st=ot.mergeWithThunk,ft=(rt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){var e=[],t=[];return wn(n,function(n){n.fold(function(n){e.push(n)},function(n){t.push(n)})}),{errors:e,values:t}}),lt=function(n){return p(tt.error,In)(n)},dt=function(n,e){var t,r,o=ft(n);return 0<o.errors.length?lt(o.errors):(t=o.values,r=e,tt.value(C.apply(undefined,[r].concat(t))))},mt=function(n){var e=ft(n);return 0<e.errors.length?lt(e.errors):tt.value(e.values)},gt=function(e){return function(n){return n.hasOwnProperty(e)?V.from(n[e]):V.none()}},vt=function(n,e){return gt(e)(n)},pt=function(n,e){var t={};return t[n]=e,t},ht=function(n,e){return t=n,r={},wn(e,function(n){t[n]!==undefined&&t.hasOwnProperty(n)&&(r[n]=t[n])}),r;var t,r},bt=function(n,e){return t=e,r={},H(n,function(n,e){yn(t,e)||(r[e]=n)}),r;var t,r},yt=function(n){return gt(n)},xt=function(n,e){return t=n,r=e,function(n){return gt(t)(n).getOr(r)};var t,r},wt=function(n,e){return vt(n,e)},St=function(n,e){return pt(n,e)},Ot=function(n){return e={},wn(n,function(n){e[n.key]=n.value}),e;var e},Tt=function(n,e){return dt(n,e)},kt=function(n,e){return r=e,(t=n).hasOwnProperty(r)&&t[r]!==undefined&&null!==t[r];var t,r},Ct=rt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Et=rt([{field:["name","presence","type"]},{state:["name"]}]),Dt=function(){return Me.getOrDie("JSON")},It=function(n,e,t){return Dt().stringify(n,e,t)},Mt=function(n){return g(n)&&100<N(n).length?" removed due to size":It(n,null,2)},At=function(n,e){return tt.error([{path:n,getErrorInfo:e}])},Bt=rt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Rt=function(t,r,o){return vt(r,o).fold(function(){return n=o,e=r,At(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+Mt(e)});var n,e},tt.value)},Ft=function(n,e,t){var r=vt(n,e).fold(function(){return t(n)},h);return tt.value(r)},Vt=function(o,c,n,a){return n.fold(function(i,e,n,t){var r=function(n){return t.extract(o.concat([i]),a,n).map(function(n){return pt(e,a(n))})},u=function(n){return n.fold(function(){var n=pt(e,a(V.none()));return tt.value(n)},function(n){return t.extract(o.concat([i]),a,n).map(function(n){return pt(e,a(V.some(n)))})})};return n.fold(function(){return Rt(o,c,i).bind(r)},function(n){return Ft(c,i,n).bind(r)},function(){return(n=c,e=i,tt.value(vt(n,e))).bind(u);var n,e},function(n){return(e=c,t=i,r=n,o=vt(e,t).map(function(n){return!0===n?r(e):n}),tt.value(o)).bind(u);var e,t,r,o},function(n){var e=n(c);return Ft(c,i,M({})).map(function(n){return C(e,n)}).bind(r)})},function(n,e){var t=e(c);return tt.value(pt(n,a(t)))})},Nt=function(r){return{extract:function(t,n,e){return r(e,n).fold(function(n){return e=n,At(t,function(){return e});var e},tt.value)},toString:function(){return"val"},toDsl:function(){return Ct.itemOf(r)}}},Ht=function(n){var a=zt(n),s=On(n,function(e,n){return n.fold(function(n){return C(e,St(n,!0))},M(e))},{});return{extract:function(n,e,t){var r,o,i,u=x(t)?[]:(o=N(r=t),Sn(o,function(n){return kt(r,n)})),c=Sn(u,function(n){return!kt(s,n)});return 0===c.length?a.extract(n,e,t):(i=c,At(n,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:a.toString,toDsl:a.toDsl}},zt=function(c){return{extract:function(n,e,t){return r=n,o=t,i=e,u=xn(c,function(n){return Vt(r,o,n,i)}),dt(u,{});var r,o,i,u},toString:function(){return"obj{\n"+xn(c,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return Ct.objOf(xn(c,function(n){return n.fold(function(n,e,t,r){return Et.field(n,t,r)},function(n,e){return Et.state(n)})}))}}},jt=function(t,i){var e=function(n,e){return(o=Nt(t),{extract:function(t,r,n){var e=xn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return mt(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return Ct.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=N(o);return e(t,n).bind(function(n){var e=xn(n,function(n){return Bt.field(n,n,ut(),i)});return zt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return Ct.setOf(t,i)}}},Lt=M(Nt(tt.value)),Pt=Bt.state,$t=Bt.field,Wt=function(t,e,r,o,i){return wt(o,i).fold(function(){return n=o,e=i,At(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Mt(n)});var n,e},function(n){return zt(n).extract(t.concat(["branch: "+i]),e,r)})},Gt=function(o,i){return{extract:function(e,t,r){return wt(r,o).fold(function(){return n=o,At(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Wt(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+N(i)},toDsl:function(){return Ct.choiceOf(o,i)}}},_t=Nt(tt.value),Ut=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return tt.error({input:r,errors:n})},tt.value)},qt=function(n,e,t){return Ut(n,e,M,t)},Yt=function(n){return n.fold(function(n){throw new Error(Jt(n))},h)},Kt=function(n,e,t){return Yt(Ut(n,e,h,t))},Xt=function(n,e,t){return Yt(qt(n,e,t))},Jt=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,xn(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+Mt(n.input);var e,t},Qt=function(n,e){return Gt(n,e)},Zt=M(_t),nr=(i=S,u="function",Nt(function(n){var e=typeof n;return i(n)?tt.value(n):tt.error("Expected type: "+u+" but got: "+e)})),er=function(n){return $t(n,n,ut(),Lt())},tr=function(n,e){return $t(n,n,ut(),e)},rr=function(n){return tr(n,nr)},or=function(n,e){return $t(n,n,ut(),zt(e))},ir=function(n){return $t(n,n,ct(),Lt())},ur=function(n,e){return $t(n,n,ct(),zt(e))},cr=function(n,e){return $t(n,n,ct(),Ht(e))},ar=function(n,e){return $t(n,n,it(e),Lt())},sr=function(n,e,t){return $t(n,n,it(e),t)},fr=function(n,e){return Pt(n,e)},lr=function(n){if(!kt(n,"can")&&!kt(n,"abort")&&!kt(n,"run"))throw new Error("EventHandler defined by: "+It(n,null,2)+" does not have can, abort, or run!");return Kt("Extracting event.handler",Ht([ar("can",M(!0)),ar("abort",M(!1)),ar("run",I)]),n)},dr=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Tn(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return lr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];wn(t,function(n){n.run.apply(undefined,e)})}})},mr=function(n){return Ot(n)},gr=function(n,e){return{key:n,value:lr({abort:e})}},vr=function(n,e){return{key:n,value:lr({run:e})}},pr=function(n,e,t){return{key:n,value:lr({run:function(n){e.apply(undefined,[n].concat(t))}})}},hr=function(n){return function(r){return{key:n,value:lr({run:function(n,e){var t;t=e,He(n.element(),t.event().target())&&r(n,e)}})}}},br=function(n,e,t){var u,r,o=e.partUids()[t];return r=o,vr(u=n,function(n,i){n.getSystem().getByUid(r).each(function(n){var e,t,r,o;t=(e=n).element(),r=u,o=i,e.getSystem().triggerEvent(r,t,o.event())})})},yr=function(n){return vr(n,function(n,e){e.cut()})},xr=hr(te()),wr=hr(re()),Sr=hr(ne()),Or=(c=Kn(),function(n){return vr(c,n)}),Tr=function(n){return xn(n,function(n){return r=e="/*",o=(t=n).length-e.length,""!==r&&(t.length<r.length||t.substr(o,o+r.length)!==r)?n:n.substring(0,n.length-"/*".length);var e,t,r,o})},kr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Tr(i)}},n},Cr=Ee(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),Er=function(n){return{tag:n.tag(),classes:n.classes().getOr([]),attributes:n.attributes().getOr({}),styles:n.styles().getOr({}),value:n.value().getOr("<none>"),innerHtml:n.innerHtml().getOr("<none>"),defChildren:n.defChildren().fold(function(){return"<none>"},function(n){return It(n,null,2)}),domChildren:n.domChildren().fold(function(){return"<none>"},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Dr=Ee([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),Ir=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return St(e,n)})},function(n){return t.fold(function(){return St(e,n)},function(n){return St(e,n)})})},Mr=function(t,r,o){return Sr(function(n,e){o(n,t,r)})},Ar=function(n,e,t,r,o,i){var u,c,a=n,s=ur(e,[(u="config",c=n,$t(u,u,ct(),c))]);return Fr(a,s,e,t,r,o,i)},Br=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:M(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,c=t.indexOf("("),a=t.substring(c+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:Tr(a.slice(0,1).concat(a.slice(3)))}},n},Rr=function(n){return{key:n,value:undefined}},Fr=function(t,n,r,o,e,i,u){var c=function(n){return kt(n,r)?n[r]():V.none()},a=z(e,function(n,e){return Br(r,n,e)}),s=z(i,function(n,e){return kr(n,e)}),f=C(s,a,{revoke:l(Rr,r),config:function(n){var e=Xt(r+"-config",t,n);return{key:r,value:{config:e,me:f,configAsRaw:nn(function(){return Kt(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return wt(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(Dr({}))},name:function(){return r},handlers:function(n){return c(n).bind(function(e){return wt(o,"events").map(function(n){return n(e.config,e.state)})}).getOr({})}});return f},Vr=function(n,e){return Nr(n,e,{validate:S,label:"function"})},Nr=function(r,o,i){if(0===o.length)throw new Error("You must specify at least one required field.");return ke("required",o),Ce(o),function(e){var t=N(e);An(o,function(n){return yn(t,n)})||Oe(o,t),r(o,t);var n=Sn(o,function(n){return!i.validate(e[n],n)});return 0<n.length&&function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+Se(n).join(", ")+") were not.")}(n,i.label),e}},Hr=function(e,n){var t=Sn(n,function(n){return!yn(e,n)});0<t.length&&Te(t)},zr=I,jr=function(n){return Vr(Hr,n)},Lr={init:function(){return Pr({readState:function(){return"No State required"}})}},Pr=function(n){return Vr(zr,["readState"])(n),n},$r=function(n){return Ot(n)},Wr=Ht([er("fields"),er("name"),ar("active",{}),ar("apis",{}),ar("state",Lr),ar("extra",{})]),Gr=function(n){var e,t,r,o,i,u,c,a,s=Kt("Creating behaviour: "+n.name,Wr,n);return e=s.fields,t=s.name,r=s.active,o=s.apis,i=s.extra,u=s.state,c=Ht(e),a=ur(t,[cr("config",e)]),Fr(c,a,t,r,o,i,u)},_r=Ht([er("branchKey"),er("branches"),er("name"),ar("active",{}),ar("apis",{}),ar("state",Lr),ar("extra",{})]),Ur=M(undefined),qr=function(n,e,t){if(!(b(t)||x(t)||O(t)))throw v.console.error("Invalid call to Attr.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},Yr=function(n,e,t){qr(n.dom(),e,t)},Kr=function(n,e){var t=n.dom();H(e,function(n,e){qr(t,e,n)})},Xr=function(n,e){var t=n.dom().getAttribute(e);return null===t?undefined:t},Jr=function(n,e){var t=n.dom();return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},Qr=function(n,e){n.dom().removeAttribute(e)},Zr=function(n,e){var t=Xr(n,e);return t===undefined||""===t?[]:t.split(" ")},no=function(n){return n.dom().classList!==undefined},eo=function(n){return Zr(n,"class")},to=function(n,e){return o=e,i=Zr(t=n,r="class").concat([o]),Yr(t,r,i.join(" ")),!0;var t,r,o,i},ro=function(n,e){return o=e,0<(i=Sn(Zr(t=n,r="class"),function(n){return n!==o})).length?Yr(t,r,i.join(" ")):Qr(t,r),!1;var t,r,o,i},oo=function(n,e){no(n)?n.dom().classList.add(e):to(n,e)},io=function(n,e){var t;no(n)?n.dom().classList.remove(e):ro(n,e),0===(no(t=n)?t.dom().classList:eo(t)).length&&Qr(t,"class")},uo=function(n,e){return no(n)?n.dom().classList.toggle(e):(r=e,yn(eo(t=n),r)?ro(t,r):to(t,r));var t,r},co=function(n,e){return no(n)&&n.dom().classList.contains(e)},ao=function(n,e,t){io(n,t),oo(n,e)},so=Object.freeze({toAlpha:function(n,e,t){ao(n.element(),e.alpha(),e.omega())},toOmega:function(n,e,t){ao(n.element(),e.omega(),e.alpha())},isAlpha:function(n,e,t){return co(n.element(),e.alpha())},isOmega:function(n,e,t){return co(n.element(),e.omega())},clear:function(n,e,t){io(n.element(),e.alpha()),io(n.element(),e.omega())}}),fo=[er("alpha"),er("omega")],lo=Gr({fields:fo,name:"swapping",apis:so}),mo=function(n){var e=n,t=function(){return e};return{get:t,set:function(n){e=n},clone:function(){return mo(t())}}};function go(n,e,t,r,o){return n(t,r)?V.some(t):S(o)&&o(t)?V.none():e(t,r,o)}var vo=function(n,e,t){for(var r=n.dom(),o=S(t)?t:M(!1);r.parentNode;){r=r.parentNode;var i=fe.fromDom(r);if(e(i))return V.some(i);if(o(i))break}return V.none()},po=function(n,e,t){return go(function(n){return e(n)},vo,n,e,t)},ho=function(n,r){var o=function(n){for(var e=0;e<n.childNodes.length;e++){if(r(fe.fromDom(n.childNodes[e])))return V.some(fe.fromDom(n.childNodes[e]));var t=o(n.childNodes[e]);if(t.isSome())return t}return V.none()};return o(n.dom())},bo=function(n){n.dom().focus()},yo=function(n){n.dom().blur()},xo=function(n){var e=n!==undefined?n.dom():v.document;return V.from(e.activeElement).map(fe.fromDom)},wo=function(e){return xo(ze(e)).filter(function(n){return e.dom().contains(n.dom())})},So=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Oo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),To=function(n){var e=v.document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=v.document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,v.window,0,0,0,0,0,!1,!1,!1,!1,0,null),v.document.body.appendChild(e),e.dispatchEvent(t),v.document.body.removeChild(e)},ko={formatChanged:M("formatChanged"),orientationChanged:M("orientationChanged"),dropupDismissed:M("dropupDismissed")},Co=function(n){return n.dom().innerHTML},Eo=function(n,e){var t,r,o=ze(n).dom(),i=fe.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||v.document).createElement("div")).innerHTML=t,Pe(fe.fromDom(r)));_e(i,u),Ue(n),Ge(n,i)},Do=function(n){return e=n,t=!1,fe.fromDom(e.dom().cloneNode(t));var e,t},Io=function(n){var e,t,r,o=Do(n);return e=o,t=fe.fromTag("div"),r=fe.fromDom(e.dom().cloneNode(!0)),Ge(t,r),Co(t)},Mo=function(n){return Io(n)},Ao=Object.freeze({events:function(c){return mr([vr(Yn(),function(o,i){var n,e,u=c.channels(),t=N(u),r=(n=t,(e=i).universal()?n:Sn(n,function(n){return yn(e.channels(),n)}));wn(r,function(n){var e=u[n](),t=e.schema(),r=Xt("channel["+n+"] data\nReceiver: "+Mo(o.element()),t,i.data());e.onReceive()(o,r)})})])}}),Bo=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Ro=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return V.none()},Fo="unknown",Vo=[],No=["alloy/data/Fields","alloy/debugging/Debugging"],Ho=function(){var n=new Error;if(n.stack!==undefined){var e=n.stack.split("\n");return kn(e,function(e){return 0<e.indexOf("alloy")&&!Cn(No,function(n){return-1<e.indexOf(n)}).isSome()}).getOr(Fo)}return Fo},zo={logEventCut:I,logEventStopped:I,logNoParent:I,logEventNoHandlers:I,logEventResponse:I,write:I},jo=function(n,e,t){var r,o="*"===Vo||yn(Vo,n)?(r=[],{logEventCut:function(n,e,t){r.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){r.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){r.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){r.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){r.push({outcome:"response",purpose:t,target:e})},write:function(){yn(["mousemove","mouseover","mouseout",ne()],n)||v.console.log(n,{event:n,target:e.dom(),sequence:xn(r,function(n){return yn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Mo(n.target)+")":n.outcome})})}}):zo,i=t(o);return o.write(),i},Lo=M([er("menu"),er("selectedMenu")]),Po=M([er("item"),er("selectedItem")]),$o=(M(Ht(Po().concat(Lo()))),M(Ht(Po()))),Wo=or("initSize",[er("numColumns"),er("numRows")]),Go=function(n,e,t){var r;return Ho(),$t(e,e,t,(r=function(t){return tt.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})},Nt(function(n){return r(n)})))},_o=function(n){return Go(0,n,it(I))},Uo=function(n){return Go(0,n,it(V.none))},qo=function(n){return Go(0,n,ut())},Yo=function(n){return Go(0,n,ut())},Ko=function(n,e){return fr(n,M(e))},Xo=function(n){return fr(n,h)},Jo=M(Wo),Qo=[tr("channels",jt(tt.value,Ht([qo("onReceive"),ar("schema",Zt())])))],Zo=Gr({fields:Qo,name:"receiving",active:Ao}),ni=function(n,e){var t=oi(n,e),r=e.aria();r.update()(n,r,t)},ei=function(n,e,t){uo(n.element(),e.toggleClass()),ni(n,e)},ti=function(n,e,t){oo(n.element(),e.toggleClass()),ni(n,e)},ri=function(n,e,t){io(n.element(),e.toggleClass()),ni(n,e)},oi=function(n,e){return co(n.element(),e.toggleClass())},ii=function(n,e,t){(e.selected()?ti:ri)(n,e,t)},ui=Object.freeze({onLoad:ii,toggle:ei,isOn:oi,on:ti,off:ri}),ci=Object.freeze({exhibit:function(n,e,t){return Dr({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=ei,Or(function(n){o(n,t,r)})),u=Mr(n,e,ii);return mr(In([n.toggleOnExecute()?[i]:[],[u]]))}}),ai=function(n,e,t){Yr(n.element(),"aria-expanded",t)},si=[ar("selected",!1),er("toggleClass"),ar("toggleOnExecute",!0),sr("aria",{mode:"none"},Qt("mode",{pressed:[ar("syncWithExpanded",!1),Ko("update",function(n,e,t){Yr(n.element(),"aria-pressed",t),e.syncWithExpanded()&&ai(n,e,t)})],checked:[Ko("update",function(n,e,t){Yr(n.element(),"aria-checked",t)})],expanded:[Ko("update",ai)],selected:[Ko("update",function(n,e,t){Yr(n.element(),"aria-selected",t)})],none:[Ko("update",I)]}))],fi=Gr({fields:si,name:"toggling",active:ci,apis:ui}),li=function(t,r){return Zo.config({channels:St(ko.formatChanged(),{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},di=function(n){return Zo.config({channels:St(ko.orientationChanged(),{onReceive:n})})},mi=function(n,e){return{key:n,value:{onReceive:e}}},gi="tinymce-mobile",vi={resolve:function(n){return gi+"-"+n},prefix:M(gi)},pi=function(n,e){e.ignore()||(bo(n.element()),e.onFocus()(n))},hi=Object.freeze({focus:pi,blur:function(n,e){e.ignore()||yo(n.element())},isFocused:function(n){return e=n.element(),t=ze(e).dom(),e.dom()===t.activeElement;var e,t}}),bi=Object.freeze({exhibit:function(n,e){return e.ignore()?Dr({}):Dr({attributes:{tabindex:"-1"}})},events:function(t){return mr([vr(Un(),function(n,e){pi(n,t),e.stop()})])}}),yi=[_o("onFocus"),ar("ignore",!1)],xi=Gr({fields:yi,name:"focusing",active:bi,apis:hi}),wi=function(n){return n.style!==undefined&&S(n.style.getPropertyValue)},Si=function(n,e,t){if(!b(t))throw v.console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);wi(n)&&n.style.setProperty(e,t)},Oi=function(n,e,t){var r=n.dom();Si(r,e,t)},Ti=function(n,e){var t=n.dom();H(e,function(n,e){Si(t,e,n)})},ki=function(n,e){var t=n.dom(),r=v.window.getComputedStyle(t).getPropertyValue(e),o=""!==r||be(n)?r:Ci(t,e);return null===o?undefined:o},Ci=function(n,e){return wi(n)?n.style.getPropertyValue(e):""},Ei=function(n,e){var t=n.dom(),r=Ci(t,e);return V.from(r).filter(function(n){return 0<n.length})},Di=function(n,e){var t,r,o=n.dom();r=e,wi(t=o)&&t.style.removeProperty(r),Jr(n,"style")&&""===Xr(n,"style").replace(/^\s+|\s+$/g,"")&&Qr(n,"style")},Ii=function(n){return n.dom().offsetWidth};function Mi(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=ki(n,r);return parseFloat(t)||0}return e},i=function(o,n){return Tn(n,function(n,e){var t=ki(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!O(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom();wi(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var Ai,Bi,Ri=Mi("height",function(n){var e=n.dom();return be(n)?e.getBoundingClientRect().height:e.offsetHeight}),Fi=function(n){return Ri.get(n)},Vi=function(n,e,t){return Sn(function(n,e){for(var t=S(e)?e:M(!1),r=n.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=fe.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},Ni=function(n,e){return Sn(Le(t=n).map(Pe).map(function(n){return Sn(n,function(n){return!He(t,n)})}).getOr([]),e);var t},Hi=function(n,e){return Ve(e,n)},zi=function(n){return Ne(n)},ji=function(n,e,t){return vo(n,function(n){return Re(n,e)},t)},Li=function(n,e){return Ne(e,n)},Pi=function(n,e,t){return go(Re,ji,n,e,t)},$i=function(n,e,t){var r=Bn(n.slice(0,e)),o=Bn(n.slice(e+1));return kn(r.concat(o),t)},Wi=function(n,e,t){var r=Bn(n.slice(0,e));return kn(r,t)},Gi=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return kn(o.concat(r),t)},_i=function(n,e,t){var r=n.slice(e+1);return kn(r,t)},Ui=function(t){return function(n){var e=n.raw();return yn(t,e.which)}},qi=function(n){return function(e){return An(n,function(n){return n(e)})}},Yi=function(n){return!0===n.raw().shiftKey},Ki=function(n){return!0===n.raw().ctrlKey},Xi=w(Yi),Ji=function(n,e){return{matches:n,classification:e}},Qi=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},Zi=function(n,e,t){return n<=e?e:t<=n?t:n},nu=function(e,t,n){var r=Hi(e.element(),"."+t.highlightClass());wn(r,function(n){io(n,t.highlightClass()),e.getSystem().getByDom(n).each(function(n){t.onDehighlight()(e,n)})})},eu=function(n,e,t,r){var o=tu(n,e,t,r);nu(n,e),oo(r.element(),e.highlightClass()),o||e.onHighlight()(n,r)},tu=function(n,e,t,r){return co(r.element(),e.highlightClass())},ru=function(n,e,t,r){var o=Hi(n.element(),"."+e.itemClass());return V.from(o[r]).fold(function(){return tt.error("No element found with index "+r)},n.getSystem().getByDom)},ou=function(e,n,t){return Li(e.element(),"."+n.itemClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},iu=function(e,n,t){var r=Hi(e.element(),"."+n.itemClass());return(0<r.length?V.some(r[r.length-1]):V.none()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},uu=function(t,e,n,r){var o=Hi(t.element(),"."+e.itemClass());return Cn(o,function(n){return co(n,e.highlightClass())}).bind(function(n){var e=Qi(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOption()})},cu=Object.freeze({dehighlightAll:nu,dehighlight:function(n,e,t,r){var o=tu(n,e,t,r);io(r.element(),e.highlightClass()),o&&e.onDehighlight()(n,r)},highlight:eu,highlightFirst:function(e,t,r){ou(e,t).each(function(n){eu(e,t,r,n)})},highlightLast:function(e,t,r){iu(e,t).each(function(n){eu(e,t,r,n)})},highlightAt:function(e,t,r,n){ru(e,t,r,n).fold(function(n){throw new Error(n)},function(n){eu(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Hi(e.element(),"."+t.itemClass()),i=Bo(xn(o,function(n){return e.getSystem().getByDom(n).toOption()}));kn(i,n).each(function(n){eu(e,t,r,n)})},isHighlighted:tu,getHighlighted:function(e,n,t){return Li(e.element(),"."+n.highlightClass()).bind(function(n){return e.getSystem().getByDom(n).toOption()})},getFirst:ou,getLast:iu,getPrevious:function(n,e,t){return uu(n,e,0,-1)},getNext:function(n,e,t){return uu(n,e,0,1)}}),au=[er("highlightClass"),er("itemClass"),_o("onHighlight"),_o("onDehighlight")],su=Gr({fields:au,name:"highlighting",apis:cu}),fu=function(){return{get:function(n){return wo(n.element())},set:function(n,e){n.getSystem().triggerFocus(e,n.element())}}},lu=function(n,e,c,t,r,i){var u=function(e,t,r,o){var n,i,u=c(e,t,r,o);return(n=u,i=t.event(),kn(n,function(n){return n.matches(i)}).map(function(n){return n.classification})).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([ar("focusManager",fu()),Ko("handler",o),Ko("state",e)])},processKey:u,toEvents:function(r,o){var n=t(r,o),e=mr(i.map(function(t){return vr(Un(),function(n,e){t(n,r,o,e),e.stop()})}).toArray().concat([vr(Y(),function(n,e){u(n,e,r,o).each(function(n){e.stop()})})]));return C(n,e)},toApis:r};return o},du=function(n){var e=[ir("onEscape"),ir("onEnter"),ar("selector",'[data-alloy-tabstop="true"]'),ar("firstTabstop",0),ar("useTabstopAt",M(!0)),ir("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector().bind(function(n){return Pi(e,n)}).getOr(e);return 0<Fi(t)},c=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt()(t);var e,t}).fold(function(){return r.cyclic()?V.some(!0):V.none()},function(n){return r.focusManager().set(e,n),V.some(!0)})},i=function(e,n,t,r){var o,i,u=Hi(e.element(),t.selector());return(o=e,i=t,i.focusManager().get(o).bind(function(n){return Pi(n,i.selector())})).bind(function(n){return Cn(u,l(He,n)).bind(function(n){return c(e,u,n,t,r)})})},t=M([Ji(qi([Yi,Ui([9])]),function(n,e,t,r){var o=t.cyclic()?$i:Wi;return i(n,0,t,o)}),Ji(Ui([9]),function(n,e,t,r){var o=t.cyclic()?Gi:_i;return i(n,0,t,o)}),Ji(Ui([27]),function(e,t,n,r){return n.onEscape().bind(function(n){return n(e,t)})}),Ji(qi([Xi,Ui([13])]),function(e,t,n,r){return n.onEnter().bind(function(n){return n(e,t)})})]),r=M({}),o=M({});return lu(e,Lr.init,t,r,o,V.some(function(e,t){var n,r,o,i;(n=e,r=t,o=Hi(n.element(),r.selector()),i=Sn(o,function(n){return u(r,n)}),V.from(i[r.firstTabstop()])).each(function(n){t.focusManager().set(e,n)})}))},mu=du(fr("cyclic",M(!1))),gu=du(fr("cyclic",M(!0))),vu=function(n){return"input"===ge(n)&&"radio"!==Xr(n,"type")||"textarea"===ge(n)},pu=function(n,e,t){return vu(t)&&Ui([32])(e.event())?V.none():(ce(n,t,Kn()),V.some(!0))},hu=[ar("execute",pu),ar("useSpace",!1),ar("useEnter",!0),ar("useControlEnter",!1),ar("useDown",!1)],bu=function(n,e,t){return t.execute()(n,e,n.element())},yu=M({}),xu=M({}),wu=lu(hu,Lr.init,function(n,e,t,r){var o=t.useSpace()&&!vu(n.element())?[32]:[],i=t.useEnter()?[13]:[],u=t.useDown()?[40]:[],c=o.concat(i).concat(u);return[Ji(Ui(c),bu)].concat(t.useControlEnter()?[Ji(qi([Ki,Ui([13])]),bu)]:[])},yu,xu,V.none()),Su=function(n){var t=mo(V.none());return Pr({readState:M({}),setGridSize:function(n,e){t.set(V.some({numRows:M(n),numColumns:M(e)}))},getNumRows:function(){return t.get().map(function(n){return n.numRows()})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns()})}})},Ou=Object.freeze({flatgrid:Su,init:function(n){return n.state()(n)}}),Tu=function(e,t){return function(n){return"rtl"===ku(n)?t:e}},ku=function(n){return"rtl"===ki(n,"direction")?"rtl":"ltr"},Cu=function(i){return function(n,e,t,r){var o=i(n.element());return Mu(o,n,e,t,r)}},Eu=function(n,e){var t=Tu(n,e);return Cu(t)},Du=function(n,e){var t=Tu(e,n);return Cu(t)},Iu=function(o){return function(n,e,t,r){return Mu(o,n,e,t,r)}},Mu=function(e,t,n,r,o){return r.focusManager().get(t).bind(function(n){return e(t.element(),n,r,o)}).map(function(n){return r.focusManager().set(t,n),!0})},Au=Iu,Bu=Iu,Ru=Iu,Fu=function(n){var e,t=n.dom();return!((e=t).offsetWidth<=0&&e.offsetHeight<=0)},Vu=Ee(["index","candidates"],[]),Nu=function(n,e,t){return Hu(n,e,t)},Hu=function(n,e,t,r){var o,i=l(He,e),u=Hi(n,t),c=Sn(u,Fu);return Cn(o=c,i).map(function(n){return Vu({index:n,candidates:o})})},zu=function(n,e){return Cn(n,function(n){return He(e,n)})},ju=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row()*r+n.column();return 0<=e&&e<t.length?V.some(t[e]):V.none()})},Lu=function(o,n,i,u,c){return ju(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=Qi(e,c,0,t-1);return V.some({row:M(n),column:M(r)})})},Pu=function(i,n,u,c,a){return ju(i,n,c,function(n,e){var t=Qi(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=Zi(e,0,r-1);return V.some({row:M(t),column:M(o)})})},$u=[er("selector"),ar("execute",pu),Uo("onEscape"),ar("captureTab",!1),Jo()],Wu=function(o){return function(n,e,t,r){return Nu(n,e,t.selector()).bind(function(n){return o(n.candidates(),n.index(),r.getNumRows().getOr(t.initSize().numRows()),r.getNumColumns().getOr(t.initSize().numColumns()))})}},Gu=function(n,e,t,r){return t.captureTab()?V.some(!0):V.none()},_u=Wu(function(n,e,t,r){return Lu(n,e,t,r,-1)}),Uu=Wu(function(n,e,t,r){return Lu(n,e,t,r,1)}),qu=Wu(function(n,e,t,r){return Pu(n,e,t,r,-1)}),Yu=Wu(function(n,e,t,r){return Pu(n,e,t,r,1)}),Ku=M([Ji(Ui([37]),Eu(_u,Uu)),Ji(Ui([39]),Du(_u,Uu)),Ji(Ui([38]),Au(qu)),Ji(Ui([40]),Bu(Yu)),Ji(qi([Yi,Ui([9])]),Gu),Ji(qi([Xi,Ui([9])]),Gu),Ji(Ui([27]),function(n,e,t,r){return t.onEscape()(n,e)}),Ji(Ui([32].concat([13])),function(e,t,r,n){return(o=e,i=r,i.focusManager().get(o).bind(function(n){return Pi(n,i.selector())})).bind(function(n){return r.execute()(e,t,n)});var o,i})]),Xu=M({}),Ju=lu($u,Su,Ku,Xu,{},V.some(function(e,t,n){Li(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Qu=function(n,e,t,o){return Nu(n,t,e).bind(function(n){var e=n.index(),t=n.candidates(),r=Qi(e,o,0,t.length-1);return V.from(t[r])})},Zu=[er("selector"),ar("getInitial",V.none),ar("execute",pu),ar("executeOnMove",!1),ar("allowVertical",!0)],nc=function(e,t,r){return(n=e,o=r,o.focusManager().get(n).bind(function(n){return Pi(n,o.selector())})).bind(function(n){return r.execute()(e,t,n)});var n,o},ec=function(n,e,t){return Qu(n,t.selector(),e,-1)},tc=function(n,e,t){return Qu(n,t.selector(),e,1)},rc=function(r){return function(n,e,t){return r(n,e,t).bind(function(){return t.executeOnMove()?nc(n,e,t):V.some(!0)})}},oc=M({}),ic=M({}),uc=lu(Zu,Lr.init,function(n,e,t,r){var o=[37].concat(t.allowVertical()?[38]:[]),i=[39].concat(t.allowVertical()?[40]:[]);return[Ji(Ui(o),rc(Eu(ec,tc))),Ji(Ui(i),rc(Du(ec,tc))),Ji(Ui([13]),nc),Ji(Ui([32]),nc)]},oc,ic,V.some(function(e,t){t.getInitial()(e).or(Li(e.element(),t.selector())).each(function(n){t.focusManager().set(e,n)})})),cc=Ee(["rowIndex","columnIndex","cell"],[]),ac=function(n,e,t){return V.from(n[e]).bind(function(n){return V.from(n[t]).map(function(n){return cc({rowIndex:e,columnIndex:t,cell:n})})})},sc=function(n,e,t,r){var o=n[e].length,i=Qi(t,r,0,o-1);return ac(n,e,i)},fc=function(n,e,t,r){var o=Qi(t,r,0,n.length-1),i=n[o].length,u=Zi(e,0,i-1);return ac(n,o,u)},lc=function(n,e,t,r){var o=n[e].length,i=Zi(t+r,0,o-1);return ac(n,e,i)},dc=function(n,e,t,r){var o=Zi(t+r,0,n.length-1),i=n[o].length,u=Zi(e,0,i-1);return ac(n,o,u)},mc=[or("selectors",[er("row"),er("cell")]),ar("cycles",!0),ar("previousSelector",V.none),ar("execute",pu)],gc=function(n,e){return function(t,r,i){var u=i.cycles()?n:e;return Pi(r,i.selectors().row()).bind(function(n){var e=Hi(n,i.selectors().cell());return zu(e,r).bind(function(r){var o=Hi(t,i.selectors().row());return zu(o,n).bind(function(n){var e,t=(e=i,xn(o,function(n){return Hi(n,e.selectors().cell())}));return u(t,n,r).map(function(n){return n.cell()})})})})}},vc=gc(function(n,e,t){return sc(n,e,t,-1)},function(n,e,t){return lc(n,e,t,-1)}),pc=gc(function(n,e,t){return sc(n,e,t,1)},function(n,e,t){return lc(n,e,t,1)}),hc=gc(function(n,e,t){return fc(n,t,e,-1)},function(n,e,t){return dc(n,t,e,-1)}),bc=gc(function(n,e,t){return fc(n,t,e,1)},function(n,e,t){return dc(n,t,e,1)}),yc=M([Ji(Ui([37]),Eu(vc,pc)),Ji(Ui([39]),Du(vc,pc)),Ji(Ui([38]),Au(hc)),Ji(Ui([40]),Bu(bc)),Ji(Ui([32].concat([13])),function(e,t,r){return wo(e.element()).bind(function(n){return r.execute()(e,t,n)})})]),xc=M({}),wc=M({}),Sc=lu(mc,Lr.init,yc,xc,wc,V.some(function(e,t){t.previousSelector()(e).orThunk(function(){var n=t.selectors();return Li(e.element(),n.cell())}).each(function(n){t.focusManager().set(e,n)})})),Oc=[er("selector"),ar("execute",pu),ar("moveOnTab",!1)],Tc=function(e,t,r){return r.focusManager().get(e).bind(function(n){return r.execute()(e,t,n)})},kc=function(n,e,t){return Qu(n,t.selector(),e,-1)},Cc=function(n,e,t){return Qu(n,t.selector(),e,1)},Ec=M([Ji(Ui([38]),Ru(kc)),Ji(Ui([40]),Ru(Cc)),Ji(qi([Yi,Ui([9])]),function(n,e,t){return t.moveOnTab()?Ru(kc)(n,e,t):V.none()}),Ji(qi([Xi,Ui([9])]),function(n,e,t){return t.moveOnTab()?Ru(Cc)(n,e,t):V.none()}),Ji(Ui([13]),Tc),Ji(Ui([32]),Tc)]),Dc=M({}),Ic=M({}),Mc=lu(Oc,Lr.init,Ec,Dc,Ic,V.some(function(e,t){Li(e.element(),t.selector()).each(function(n){t.focusManager().set(e,n)})})),Ac=[Uo("onSpace"),Uo("onEnter"),Uo("onShiftEnter"),Uo("onLeft"),Uo("onRight"),Uo("onTab"),Uo("onShiftTab"),Uo("onUp"),Uo("onDown"),Uo("onEscape"),ir("focusIn")],Bc=lu(Ac,Lr.init,function(n,e,t){return[Ji(Ui([32]),t.onSpace()),Ji(qi([Xi,Ui([13])]),t.onEnter()),Ji(qi([Yi,Ui([13])]),t.onShiftEnter()),Ji(qi([Yi,Ui([9])]),t.onShiftTab()),Ji(qi([Xi,Ui([9])]),t.onTab()),Ji(Ui([38]),t.onUp()),Ji(Ui([40]),t.onDown()),Ji(Ui([37]),t.onLeft()),Ji(Ui([39]),t.onRight()),Ji(Ui([32]),t.onSpace()),Ji(Ui([27]),t.onEscape())]},function(){return{}},function(){return{}},V.some(function(e,t){return t.focusIn().bind(function(n){return n(e,t)})})),Rc=mu.schema(),Fc=gu.schema(),Vc=uc.schema(),Nc=Ju.schema(),Hc=Sc.schema(),zc=wu.schema(),jc=Mc.schema(),Lc=Bc.schema(),Pc=(Bi=Kt("Creating behaviour: "+(Ai={branchKey:"mode",branches:Object.freeze({acyclic:Rc,cyclic:Fc,flow:Vc,flatgrid:Nc,matrix:Hc,execution:zc,menu:jc,special:Lc}),name:"keying",active:{events:function(n,e){return n.handler().toEvents(n,e)}},apis:{focusIn:function(n){n.getSystem().triggerFocus(n.element(),n.element())},setGridSize:function(n,e,t,r,o){kt(t,"setGridSize")?t.setGridSize(r,o):v.console.error("Layout does not support setGridSize")}},state:Ou}).name,_r,Ai),Ar(Qt(Bi.branchKey,Bi.branches),Bi.name,Bi.active,Bi.apis,Bi.extra,Bi.state)),$c=function(r,n){return e=r,t={},o=xn(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,$t(e,e,ct(),Nt(function(n){return tt.error("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([fr("dump",h)]),$t(e,e,it(t),zt(o));var e,t,o},Wc=function(n){return n.dump()},Gc="placeholder",_c=rt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Uc=function(n,e,t,r){return t.uiType===Gc?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?_c.single(!0,M(i)):wt(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+N(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+It(i,null,2))},function(n){return n.replace()})):_c.single(!1,M(t));var o,i,u},qc=function(i,u,c,a){return Uc(i,0,c,a).fold(function(n,e){var t=e(u,c.config,c.validated),r=wt(t,"components").getOr([]),o=Mn(r,function(n){return qc(i,u,n,a)});return[C(t,{components:o})]},function(n,e){return e(u,c.config,c.validated)})},Yc=function(e,t,n,r){var o,i,u,c=z(r,function(n,e){return r=n,o=!1,{name:M(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(!0===o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),a=(o=e,i=t,u=c,Mn(n,function(n){return qc(o,i,n,u)}));return H(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+It(t.components(),null,2))}),a},Kc=_c.single,Xc=_c.multiple,Jc=M(Gc),Qc=0,Zc=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Qc+String(e)},na=rt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ea=ar("factory",{sketch:h}),ta=ar("schema",[]),ra=er("name"),oa=$t("pname","pname",at(function(n){return"<alloy."+Zc(n.name)+">"}),Zt()),ia=ar("defaults",M({})),ua=ar("overrides",M({})),ca=zt([ea,ta,ra,oa,ia,ua]),aa=zt([ea,ta,ra,oa,ia,ua]),sa=zt([ea,ta,ra,er("unit"),oa,ia,ua]),fa=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},la=function(t,r){return function(n){var e=Xt("Converting part type",r,n);return t(e)}},da=la(na.required,ca),ma=la(na.optional,aa),ga=la(na.group,sa),va=M("entirety"),pa=function(n,e,t,r){var o=t;return C(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":St("part-"+e.name(),o)})},ha=function(o,n){var i={};return wn(n,function(n){var e;(e=n,e.fold(V.some,V.none,V.some,V.some)).each(function(t){var r=ba(o,t.pname());i[t.name()]=function(n){var e=Kt("Part: "+t.name()+" in "+o,zt(t.schema()),n);return C(r,{config:n,validated:e})}})}),i},ba=function(n,e){return{uiType:Jc(),owner:n,name:e}},ya=function(n,e,t){return r=e,i={},o={},wn(t,function(n){n.fold(function(r){i[r.pname()]=Kc(!0,function(n,e,t){return r.factory().sketch(pa(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=M(pa(r,n,e[va()]()))},function(r){i[r.pname()]=Kc(!1,function(n,e,t){return r.factory().sketch(pa(n,r,e,t))})},function(o){i[o.pname()]=Xc(!0,function(e,n,t){var r=e[o.name()]();return xn(r,function(n){return o.factory().sketch(C(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:M(i),externals:M(o)};var r,i,o},xa=function(n,e,t){return Yc(V.some(n),e,e.components(),t)},wa=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},Sa=function(n,e,t){return wa(n,e,t).getOrDie("Could not find part: "+t)},Oa=function(e,n){var t=xn(n,fa);return Ot(xn(t,function(n){return{key:n,value:e+"-"+n}}))},Ta=function(e){return $t("partUids","partUids",st(function(n){return Oa(n.uid,e)}),Zt())},ka=Zc("alloy-premade"),Ca=Zc("api"),Ea=function(n){return St(ka,n)},Da=function(o){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var r=n.config(Ca);return o.apply(undefined,[r].concat([n].concat(e)))},e=o.toString(),t=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Tr(i.slice(1))}},n;var n,e,t,r,i},Ia=M(Ca),Ma=M("alloy-id-"),Aa=M("data-alloy-id"),Ba=Ma(),Ra=Aa(),Fa=function(n){var e=pe(n)?Xr(n,Ra):null;return V.from(e)},Va=function(n){return Zc(n)},Na=function(n,e,t,r,o){var i,u,c=(u=o,(0<(i=r).length?[or("parts",i)]:[]).concat([er("uid"),ar("dom",{}),ar("components",[]),Xo("originalSpec"),ar("debug.sketcher",{})]).concat(u));return Xt(n+" [SpecSchema]",Ht(c.concat(e)),t)},Ha=function(n,e,t,r,o){var i=za(o),u=Mn(t,function(n){return n.fold(V.none,V.some,V.none,V.none).map(function(n){return or(n.name(),n.schema().concat([Xo(va())]))}).toArray()}),c=Ta(t),a=Na(n,e,i,u,[c]),s=ya(0,a,t),f=xa(n,a,s.internals());return C(r(a,f,i,s.externals()),{"debug.sketcher":St(n,o)})},za=function(n){return C({uid:Va("uid")},n)},ja=Ht([er("name"),er("factory"),er("configFields"),ar("apis",{}),ar("extraApis",{})]),La=Ht([er("name"),er("factory"),er("configFields"),er("partFields"),ar("apis",{}),ar("extraApis",{})]),Pa=function(n){var c=Kt("Sketcher for "+n.name,ja,n),e=z(c.apis,Da),t=z(c.extraApis,function(n,e){return kr(n,e)});return C({name:M(c.name),partFields:M([]),configFields:M(c.configFields),sketch:function(n){return e=c.name,t=c.configFields,r=c.factory,i=za(o=n),u=Na(e,t,i,[],[]),C(r(u,i),{"debug.sketcher":St(e,o)});var e,t,r,o,i,u}},e,t)},$a=function(n){var e=Kt("Sketcher for "+n.name,La,n),t=ha(e.name,e.partFields),r=z(e.apis,Da),o=z(e.extraApis,function(n,e){return kr(n,e)});return C({name:M(e.name),partFields:M(e.partFields),configFields:M(e.configFields),sketch:function(n){return Ha(e.name,e.configFields,e.partFields,e.factory,n)},parts:M(t)},r,o)},Wa=Pa({name:"Button",factory:function(n){var e,t,r,o=(e=n.action(),t=function(n,e){e.stop(),ue(n)},r=Gn.detect().deviceType.isTouch()?[vr(Jn(),t)]:[vr(J(),t),vr(G(),function(n,e){e.cut()})],mr(In([e.map(function(t){return vr(Kn(),function(n,e){t(n),e.stop()})}).toArray(),r]))),i=wt(n.dom(),"attributes").bind(yt("type")),u=wt(n.dom(),"tag");return{uid:n.uid(),dom:n.dom(),components:n.components(),events:o,behaviours:C($r([xi.config({}),Pc.config({mode:"execution",useSpace:!0,useEnter:!0})]),Wc(n.buttonBehaviours())),domModification:{attributes:C(i.fold(function(){return u.is("button")?{type:"button"}:{}},function(n){return{}}),{role:n.role().getOr("button")})},eventOrder:n.eventOrder()}},configFields:[ar("uid",undefined),er("dom"),ar("components",[]),$c("buttonBehaviours",[xi,Pc]),ir("action"),ir("role"),ar("eventOrder",{})]}),Ga=Gr({fields:[],name:"unselecting",active:Object.freeze({events:function(n){return mr([gr(Z(),M(!0))])},exhibit:function(n,e){return Dr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),_a=function(n){var e,t,r,o=fe.fromHtml(n),i=Pe(o),u=(t=(e=o).dom().attributes!==undefined?e.dom().attributes:[],Tn(t,function(n,e){return"class"===e.name?n:C(n,St(e.name,e.value))},{})),c=(r=o,Array.prototype.slice.call(r.dom().classList,0)),a=0===i.length?{}:{innerHtml:Co(o)};return C({tag:ge(o),classes:c,attributes:u},a)},Ua=function(n){var e,o,t=(e=n,o={prefix:vi.prefix()},e.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"===t?r.toString():n}));return _a(t)},qa=function(n){return{dom:Ua(n)}},Ya=function(n){return $r([fi.config({toggleClass:vi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),li(n,function(n,e){(e?fi.on:fi.off)(n)})])},Ka=function(n,e,t){return Wa.sketch({dom:Ua('<span class="${prefix}-toolbar-button ${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:e,buttonBehaviours:C($r([Ga.config({})]),t)})},Xa={forToolbar:Ka,forToolbarCommand:function(n,e){return Ka(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=Ya(t);return Ka(e,r,o)},forToolbarStateCommand:function(n,e){var t=Ya(e);return Ka(e,function(){n.execCommand(e)},t)}},Ja=function(t,r){return{left:M(t),top:M(r),translate:function(n,e){return Ja(t+n,r+e)}}},Qa=Ja,Za=function(n,e,t){return Math.max(e,Math.min(t,n))},ns=function(n,e,t,r,o,i,u){var c=t-e;if(r<n.left)return e-1;if(r>n.right)return t+1;var a,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Za(d/n.width*c+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(a=m,s=e,f=t,l=o,u.fold(function(){var n=a-s,e=Math.round(n/l)*l;return Za(s+e,s-1,f+1)},function(n){var e=(a-n)%l,t=Math.round(e/l),r=Math.floor((a-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},es="slider.change.value",ts=Gn.detect().deviceType.isTouch(),rs=function(n){return function(n){var e=n.event().raw();if(ts){var t=e;return t.touches!==undefined&&1===t.touches.length?V.some(t.touches[0]).map(function(n){return Qa(n.clientX,n.clientY)}):V.none()}var r=e;return r.clientX!==undefined?V.some(r).map(function(n){return Qa(n.clientX,n.clientY)}):V.none()}(n).map(function(n){return n.left()})},os=function(n,e){ie(n,es,{value:e})},is=function(i,u,c,n){return rs(n).map(function(n){var e,t,r,o;return e=i,r=n,o=ns(c,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),os(e,o),n})},us=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),t<r?t:o<t?o:t===r?r-1:Math.max(r,t-i));os(n,u)},cs=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),o<t?t:t<r?r:t===o?o+1:Math.min(o,t+i));os(n,u)},as=Gn.detect().deviceType.isTouch(),ss=function(n,r){return ma({name:n+"-edge",overrides:function(n){var e=mr([pr(P(),r,[n])]),t=mr([pr(G(),r,[n]),pr(_(),function(n,e){e.mouseIsDown().get()&&r(n,e)},[n])]);return{events:as?e:t}}})},fs=[ss("left",function(n,e){os(n,e.min()-1)}),ss("right",function(n,e){os(n,e.max()+1)}),da({name:"thumb",defaults:M({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:mr([br(P(),n,"spectrum"),br($(),n,"spectrum"),br(W(),n,"spectrum")])}}}),da({schema:[fr("mouseIsDown",function(){return mo(!1)})],name:"spectrum",overrides:function(r){var t=function(n,e){var t=n.element().dom().getBoundingClientRect();is(n,r,t,e)},n=mr([vr(P(),t),vr($(),t)]),e=mr([vr(G(),t),vr(_(),function(n,e){r.mouseIsDown().get()&&t(n,e)})]);return{behaviours:$r(as?[]:[Pc.config({mode:"special",onLeft:function(n){return us(n,r),V.some(!0)},onRight:function(n){return cs(n,r),V.some(!0)}}),xi.config({})]),events:as?n:e}}})],ls=function(n,e,t){e.store().manager().onLoad(n,e,t)},ds=function(n,e,t){e.store().manager().onUnload(n,e,t)},ms=Object.freeze({onLoad:ls,onUnload:ds,setValue:function(n,e,t,r){e.store().manager().setValue(n,e,t,r)},getValue:function(n,e,t){return e.store().manager().getValue(n,e,t)}}),gs=Object.freeze({events:function(t,r){var n=t.resetOnDom()?[xr(function(n,e){ls(n,t,r)}),wr(function(n,e){ds(n,t,r)})]:[Mr(t,r,ls)];return mr(n)}}),vs=function(){var n=mo(null);return Pr({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},ps=function(){var n=mo({});return Pr({readState:function(){return{mode:"dataset",dataset:n.get()}},set:n.set,get:n.get})},hs=Object.freeze({memory:vs,dataset:ps,manual:function(){return Pr({readState:function(){}})},init:function(n){return n.store().manager().state(n)}}),bs=function(n,e,t,r){e.store().getDataKey(),t.set({}),e.store().setData()(n,r),e.onSetValue()(n,r)},ys=[ir("initialValue"),er("getFallbackEntry"),er("getDataKey"),er("setData"),Ko("manager",{setValue:bs,getValue:function(n,e,t){var r=e.store().getDataKey()(n),o=t.get();return wt(o,r).fold(function(){return e.store().getFallbackEntry()(r)},function(n){return n})},onLoad:function(e,t,r){t.store().initialValue().each(function(n){bs(e,t,r,n)})},onUnload:function(n,e,t){t.set({})},state:ps})],xs=[er("getValue"),ar("setValue",I),ir("initialValue"),Ko("manager",{setValue:function(n,e,t,r){e.store().setValue()(n,r),e.onSetValue()(n,r)},getValue:function(n,e,t){return e.store().getValue()(n)},onLoad:function(e,t,n){t.store().initialValue().each(function(n){t.store().setValue()(e,n)})},onUnload:I,state:Lr.init})],ws=[ir("initialValue"),Ko("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue()(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store().initialValue().each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:vs})],Ss=[sr("store",{mode:"memory"},Qt("mode",{memory:ws,manual:xs,dataset:ys})),_o("onSetValue"),ar("resetOnDom",!1)],Os=Gr({fields:Ss,name:"representing",active:gs,apis:ms,extra:{setValueFrom:function(n,e){var t=Os.getValue(e);Os.setValue(n,t)}},state:hs}),Ts=Gn.detect().deviceType.isTouch(),ks=[er("min"),er("max"),ar("stepSize",1),ar("onChange",I),ar("onInit",I),ar("onDragStart",I),ar("onDragEnd",I),ar("snapToGrid",!1),ir("snapStart"),er("getInitialValue"),$c("sliderBehaviours",[Pc,Os]),fr("value",function(n){return mo(n.min)})].concat(Ts?[]:[fr("mouseIsDown",function(){return mo(!1)})]),Cs=Mi("width",function(n){return n.dom().offsetWidth}),Es=function(n,e){Cs.set(n,e)},Ds=function(n){return Cs.get(n)},Is=Gn.detect().deviceType.isTouch(),Ms=$a({name:"Slider",configFields:ks,partFields:fs,factory:function(a,n,e,t){var s=a.max()-a.min(),f=function(n){var e=n.element().dom().getBoundingClientRect();return(e.left+e.right)/2},o=function(n){return Sa(n,a,"thumb")},i=function(n){var e,t,r,o,i=Sa(n,a,"spectrum").element().dom().getBoundingClientRect(),u=n.element().dom().getBoundingClientRect(),c=(e=n,t=i,(o=(r=a).value().get())<r.min()?wa(e,r,"left-edge").fold(function(){return 0},function(n){return f(n)-t.left}):o>r.max()?wa(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+c},u=function(n){var e=i(n),t=o(n),r=Ds(t.element())/2;Oi(t.element(),"left",e-r+"px")},r=function(n,e){var t=a.value().get(),r=o(n);return t!==e||Ei(r.element(),"left").isNone()?(a.value().set(e),u(n),a.onChange()(n,r,e),V.some(!0)):V.none()},c=Is?[vr(P(),function(n,e){a.onDragStart()(n,o(n))}),vr(W(),function(n,e){a.onDragEnd()(n,o(n))})]:[vr(G(),function(n,e){e.stop(),a.onDragStart()(n,o(n)),a.mouseIsDown().set(!0)}),vr(U(),function(n,e){a.onDragEnd()(n,o(n)),a.mouseIsDown().set(!1)})];return{uid:a.uid(),dom:a.dom(),components:n,behaviours:C($r(In([Is?[]:[Pc.config({mode:"special",focusIn:function(n){return wa(n,a,"spectrum").map(Pc.focusIn).map(M(!0))}})],[Os.config({store:{mode:"manual",getValue:function(n){return a.value().get()}}})]])),Wc(a.sliderBehaviours())),events:mr([vr(es,function(n,e){r(n,e.event().value())}),xr(function(n,e){a.value().set(a.getInitialValue()());var t=o(n);u(n),a.onInit()(n,t,a.value().get())})].concat(c)),apis:{resetToMin:function(n){r(n,a.min())},resetToMax:function(n){r(n,a.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),As=function(e,t,r){return Xa.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},Bs=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Ms.sketch({dom:Ua('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Ms.parts()["left-edge"](qa('<div class="${prefix}-hue-slider-black"></div>')),Ms.parts().spectrum({dom:Ua('<div class="${prefix}-slider-gradient-container"></div>'),components:[qa('<div class="${prefix}-slider-gradient"></div>')],behaviours:$r([fi.config({toggleClass:vi.resolve("thumb-active")})])}),Ms.parts()["right-edge"](qa('<div class="${prefix}-hue-slider-white"></div>')),Ms.parts().thumb({dom:Ua('<div class="${prefix}-slider-thumb"></div>'),behaviours:$r([fi.config({toggleClass:vi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);Oi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){fi.on(e)},onDragEnd:function(n,e){fi.off(e)},onInit:function(n,e,t){var r=i(t);Oi(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:$r([di(Ms.refresh)])}))];var o,i},Rs=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return As(n,"color",function(){return Bs(e)})},Fs=Ht([er("getInitialValue"),er("onChange"),er("category"),er("sizes")]),Vs=function(n){var o=Kt("SizeSlider",Fs,n);return Ms.sketch({dom:{tag:"div",classes:[vi.resolve("slider-"+o.category+"-size-container"),vi.resolve("slider"),vi.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r<o.sizes.length&&o.onChange(t)},onDragStart:function(n,e){fi.on(e)},onDragEnd:function(n,e){fi.off(e)},min:0,max:o.sizes.length-1,stepSize:1,getInitialValue:o.getInitialValue,snapToGrid:!0,sliderBehaviours:$r([di(Ms.refresh)]),components:[Ms.parts().spectrum({dom:Ua('<div class="${prefix}-slider-size-container"></div>'),components:[qa('<div class="${prefix}-slider-size-line"></div>')]}),Ms.parts().thumb({dom:Ua('<div class="${prefix}-slider-thumb"></div>'),behaviours:$r([fi.config({toggleClass:vi.resolve("thumb-active")})])})]})},Ns=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Hs=function(n){var e,t,r=n.selection.getStart(),o=fe.fromDom(r),i=fe.fromDom(n.getBody()),u=(e=function(n){return He(i,n)},(pe(t=o)?V.some(t):Le(t)).map(function(n){return po(n,function(n){return Ei(n,"font-size").isSome()},e).bind(function(n){return Ei(n,"font-size")}).getOrThunk(function(){return ki(n,"font-size")})}).getOr(""));return kn(Ns,function(n){return u===n}).getOr("medium")},zs={candidates:M(Ns),get:function(n){var e,t=Hs(n);return(e=t,Cn(Ns,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,V.from(Ns[e])).each(function(n){var e,t;t=n,Hs(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},js=zs.candidates(),Ls=function(n){return[qa('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),(e=n,Vs({onChange:e.onChange,sizes:js,category:"font",getInitialValue:e.getInitialValue})),qa('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Ps=function(n){var e=n.uid!==undefined&&kt(n,"uid")?n.uid:Va("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(V.none,V.some)},asSpec:function(){return C(n,{uid:e})}}},$s=window.Promise?window.Promise:function(){var i=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(n,r(o,this),r(c,this))},n=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)};function r(n,e){return function(){return n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function u(r){var o=this;null!==this._state?n(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void f(r(e,n),r(o,this),r(c,this))}this._state=!0,this._value=n,a.call(this)}catch(t){c.call(this,t)}}function c(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];u.call(this,t)}this._deferreds=[]}function s(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function f(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}return i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(t,r){var o=this;return new i(function(n,e){u.call(o,new s(t,r,n,e))})},i.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&t(n[0])?n[0]:n);return new i(function(o,i){if(0===a.length)return o([]);var u=a.length;function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}for(var n=0;n<a.length;n++)c(n,a[n])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(n){n(e)})},i.reject=function(t){return new i(function(n,e){e(t)})},i.race=function(o){return new i(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},i}();function Ws(t){return new $s(function(n){var e=new(Me.getOrDie("FileReader"));e.onloadend=function(){n(e.result)},e.readAsDataURL(t)})}var Gs,_s,Us,qs,Ys,Ks,Xs,Js,Qs=function(n){return Ws(n).then(function(n){return n.split(",")[1]})},Zs=function(u){var e=Ps({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:mr([yr(J()),vr(X(),function(n,e){var t,r,o;(t=e,r=t.event(),o=r.raw().target.files||r.raw().dataTransfer.files,V.from(o[0])).each(function(n){var o,i;o=u,Qs(i=n).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Zc("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})})})])});return Wa.sketch({dom:Ua('<span class="${prefix}-toolbar-button ${prefix}-icon-image ${prefix}-icon"></span>'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},nf=function(n){return n.dom().textContent},ef=function(n){return 0<n.length},tf=function(n){return n===undefined||null===n?"":n},rf=function(e,t,n){return n.text.filter(ef).fold(function(){return Xr(n=e,"href")===nf(n)?V.some(t):V.none();var n},V.some)},of=function(n){var e=fe.fromDom(n.selection.getStart());return Pi(e,"a")},uf={getInfo:function(n){return of(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:V.none()}},function(n){return t=nf(e=n),r=Xr(e,"href"),o=Xr(e,"title"),i=Xr(e,"target"),{url:tf(r),text:t!==r?tf(t):"",title:tf(o),target:tf(i),link:V.some(e)};var e,t,r,o,i})},applyInfo:function(o,i){i.url.filter(ef).fold(function(){var e;e=o,i.link.bind(h).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.filter(ef).each(function(n){t.title=n}),n.target.filter(ef).each(function(n){t.target=n}),t);i.link.bind(h).fold(function(){var n=i.text.filter(ef).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=rf(t,e,i);Kr(t,r),n.each(function(n){var e;e=n,t.dom().textContent=e})})})},query:of},cf=Gn.detect(),af=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},sf=function(n,e){(cf.os.isAndroid()?af:s)(e,n)},ff=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=mr(e),Gr({fields:[er("enabled")],name:t,active:{events:M(r)}})),configAsRaw:M({}),initialConfig:{},state:Lr}}},lf=Object.freeze({getCurrent:function(n,e,t){return e.find()(n)}}),df=[er("find")],mf=Gr({fields:df,name:"composing",apis:lf}),gf=Pa({name:"Container",factory:function(n){return{uid:n.uid(),dom:C({tag:"div",attributes:{role:"presentation"}},n.dom()),components:n.components(),behaviours:Wc(n.containerBehaviours()),events:n.events(),domModification:n.domModification(),eventOrder:n.eventOrder()}},configFields:[ar("components",[]),$c("containerBehaviours",[]),ar("events",{}),ar("domModification",{}),ar("eventOrder",{})]}),vf=Pa({name:"DataField",factory:function(t){return{uid:t.uid(),dom:t.dom(),behaviours:C($r([Os.config({store:{mode:"memory",initialValue:t.getInitialValue()()}}),mf.config({find:V.some})]),Wc(t.dataBehaviours())),events:mr([xr(function(n,e){Os.setValue(n,t.getInitialValue()())})])}},configFields:[er("uid"),er("dom"),er("getInitialValue"),$c("dataBehaviours",[Os,mf])]}),pf=function(n){return n.dom().value},hf=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom().value=e},bf=M([ir("data"),ar("inputAttributes",{}),ar("inputStyles",{}),ar("type","input"),ar("tag","input"),ar("inputClasses",[]),_o("onSetValue"),ar("styles",{}),ir("placeholder"),ar("eventOrder",{}),$c("inputBehaviours",[Os,xi]),ar("selectOnFocus",!0)]),yf=function(n){return C($r([Os.config({store:{mode:"manual",initialValue:n.data().getOr(undefined),getValue:function(n){return pf(n.element())},setValue:function(n,e){pf(n.element())!==e&&hf(n.element(),e)}},onSetValue:n.onSetValue()})]),(e=n,$r([xi.config({onFocus:!1===e.selectOnFocus()?I:function(n){var e=n.element(),t=pf(e);e.dom().setSelectionRange(0,t.length)}})])),Wc(n.inputBehaviours()));var e},xf=Pa({name:"Input",configFields:bf(),factory:function(n,e){return{uid:n.uid(),dom:(t=n,{tag:t.tag(),attributes:C(Ot([{key:"type",value:t.type()}].concat(t.placeholder().map(function(n){return{key:"placeholder",value:n}}).toArray())),t.inputAttributes()),styles:t.inputStyles(),classes:t.inputClasses()}),components:[],behaviours:yf(n),eventOrder:n.eventOrder()};var t}}),wf=Object.freeze({exhibit:function(n,e){return Dr({attributes:Ot([{key:e.tabAttr(),value:"true"}])})}}),Sf=[ar("tabAttr","data-alloy-tabstop")],Of=Gr({fields:Sf,name:"tabstopping",active:wf}),Tf=function(n,e){var t=Ps(xf.sketch({placeholder:e,onSetValue:function(n,e){oe(n,K())},inputBehaviours:$r([mf.config({find:V.some}),Of.config({}),Pc.config({mode:"execution"})]),selectOnFocus:!1})),r=Ps(Wa.sketch({dom:Ua('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);Os.setValue(e,"")}}));return{name:n,spec:gf.sketch({dom:Ua('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:$r([fi.config({toggleClass:vi.resolve("input-container-empty")}),mf.config({find:function(n){return V.some(t.get(n))}}),ff("input-clearing",[vr(K(),function(n){var e=t.get(n);(0<Os.getValue(e).length?fi.off:fi.on)(n)})])])})}},kf=["input","button","textarea"],Cf=function(n,e,t){e.disabled()&&Bf(n,e)},Ef=function(n){return yn(kf,ge(n.element()))},Df=function(n){Yr(n.element(),"disabled","disabled")},If=function(n){Qr(n.element(),"disabled")},Mf=function(n){Yr(n.element(),"aria-disabled","true")},Af=function(n){Yr(n.element(),"aria-disabled","false")},Bf=function(e,n,t){n.disableClass().each(function(n){oo(e.element(),n)}),(Ef(e)?Df:Mf)(e)},Rf=function(n){return Ef(n)?Jr(n.element(),"disabled"):"true"===Xr(n.element(),"aria-disabled")},Ff=Object.freeze({enable:function(e,n,t){n.disableClass().each(function(n){io(e.element(),n)}),(Ef(e)?If:Af)(e)},disable:Bf,isDisabled:Rf,onLoad:Cf}),Vf=Object.freeze({exhibit:function(n,e,t){return Dr({classes:e.disabled()?e.disableClass().map(Rn).getOr([]):[]})},events:function(n,e){return mr([gr(Kn(),function(n,e){return Rf(n)}),Mr(n,e,Cf)])}}),Nf=[ar("disabled",!1),ir("disableClass")],Hf=Gr({fields:Nf,name:"disabling",active:Vf,apis:Ff}),zf=[$c("formBehaviours",[Os])],jf=function(n){return"<alloy.field."+n+">"},Lf=function(o,n,e){return C({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:C($r([Os.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),z(e.partUids(),function(n,e){return M(t.getByUid(n))}));return z(r,function(n,e){return n().bind(mf.getCurrent).map(Os.getValue)})},setValue:function(t,n){H(n,function(e,n){wa(t,o,n).each(function(n){mf.getCurrent(n).each(function(n){Os.setValue(n,e)})})})}}})]),Wc(o.formBehaviours())),apis:{getField:function(n,e){return wa(n,o,e).bind(mf.getCurrent)}}})},Pf=(Da(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=jf(n),o=e,{uiType:Jc(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=xn(r,function(n){return da({name:n,pname:jf(n)})});return Ha("form",zf,o,Lf,t)}),$f=function(){var e=mo(V.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(V.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(V.some(n))},run:function(n){e.get().each(n)}}},Wf=function(){var e=mo(V.none());return{clear:function(){e.set(V.none())},set:function(n){e.set(V.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},Gf=function(n){return{xValue:n,points:[]}},_f=function(n,e){if(e===n.xValue)return n;var t=0<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}},Uf=function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0},qf=function(n){var r="navigateEvent",e=zt([er("fields"),ar("maxFieldIndex",n.fields.length-1),er("onExecute"),er("getInitialValue"),fr("state",function(){return{dialogSwipeState:Wf(),currentScreen:mo(0)}})]),u=Kt("SerialisedDialog",e,n),o=function(e,n,t){return Wa.sketch({dom:Ua('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ie(n,r,{direction:e})},buttonBehaviours:$r([Hf.config({disableClass:vi.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Hi(n.element(),"."+vi.resolve("serialised-dialog-screen"));Li(n.element(),"."+vi.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(Ei(r,"left").each(function(n){var e=parseInt(n,10),t=Ds(i[0]);Oi(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},c=function(r){var n=Hi(r.element(),"input");V.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element(),e.getSystem().triggerFocus(t,e.element())})});var e=s.get(r);su.highlightAt(e,u.state.currentScreen.get())},a=Ps(Pf(function(t){return{dom:Ua('<div class="${prefix}-serialised-dialog"></div>'),components:[gf.sketch({dom:Ua('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:xn(u.fields,function(n,e){return e<=u.maxFieldIndex?gf.sketch({dom:Ua('<div class="${prefix}-serialised-dialog-screen"></div>'),components:In([[o(-1,"previous",0<e)],[t.field(n.name,n.spec)],[o(1,"next",e<u.maxFieldIndex)]])}):t.field(n.name,n.spec)})})],formBehaviours:$r([di(function(n,e){var t;t=e,Li(n.element(),"."+vi.resolve("serialised-dialog-chain")).each(function(n){Oi(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),Pc.config({mode:"special",focusIn:function(n){c(n)},onTab:function(n){return i(n,1),V.some(!0)},onShiftTab:function(n){return i(n,-1),V.some(!0)}}),ff("form-events",[xr(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=s.get(e);su.highlightFirst(t),u.getInitialValue(e).each(function(n){Os.setValue(e,n)})}),Or(u.onExecute),vr(Q(),function(n,e){"left"===e.event().raw().propertyName&&c(n)}),vr(r,function(n,e){var t=e.event().direction();i(n,t)})])])}})),s=Ps({dom:Ua('<div class="${prefix}-dot-container"></div>'),behaviours:$r([su.config({highlightClass:vi.resolve("dot-active"),itemClass:vi.resolve("dot-item")})]),components:Mn(u.fields,function(n,e){return e<=u.maxFieldIndex?[qa('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Ua('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),s.asSpec()],behaviours:$r([Pc.config({mode:"special",focusIn:function(n){var e=a.get(n);Pc.focusIn(e)}}),ff("serializer-wrapper-events",[vr(P(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(Gf(t.touches[0].clientX))}),vr($(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(_f(n,t.raw().touches[0].clientX))})}),vr(W(),function(r){u.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Uf(n);i(e,t)})})])])}},Yf=nn(function(t,r){return[{label:"the link group",items:[qf({fields:[Tf("url","Type or paste URL"),Tf("text","Link text"),Tf("title","Link title"),Tf("target","Link target"),(n="link",{name:n,spec:vf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return V.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return V.some(uf.getInfo(r))},onExecute:function(n){var e=Os.getValue(n);uf.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),Kf=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Xf=mr([(Gs=Un(),_s=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(He(t=o,n.element())&&!He(t,r)&&(v.console.warn(Un()+" did not get interpreted by the desired target. \nOriginator: "+Mo(o)+"\nTarget: "+Mo(i)+"\nCheck the "+Un()+" event handlers"),1))},{key:Gs,value:lr({can:_s})})]),Jf=Object.freeze({events:Xf}),Qf=h,Zf=jr(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),nl=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Mo(e().element())+" is not in context.")}};return Zf({debugInfo:M("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:M(!1)})},el=function(n,o){var i={};return H(n,function(n,r){H(n,function(n,e){var t=xt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},tl=function(n,e){return 1<n.length?tt.error('Multiple behaviours have tried to change DOM "'+e+'". The guilty behaviours are: '+It(xn(n,function(n){return n.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===n.length?tt.value({}):tt.value(n[0].modification().fold(function(){return{}},function(n){return St(e,n)}))},rl=function(u,c){return Tn(u,function(n,e){var t=e.modification().getOr({});return n.bind(function(i){var n=L(t,function(n,e){return i[e]!==undefined?(t=c,r=e,o=u,tt.error("Mulitple behaviours have tried to change the _"+r+'_ "'+t+'". The guilty behaviours are: '+It(Mn(o,function(n){return n.modification().getOr({})[r]!==undefined?[n.name()]:[]}),null,2)+". This is not currently supported.")):tt.value(St(e,n));var t,r,o});return Tt(n,i)})},tt.value({})).map(function(n){return St(c,n)})},ol={classes:function(n,e){var t=Mn(n,function(n){return n.modification().getOr([])});return tt.value(St(e,t))},attributes:rl,styles:rl,domChildren:tl,defChildren:tl,innerHtml:tl,value:tl},il=function(n,e){return t=l.apply(undefined,[n.handler].concat(e)),r=n.purpose(),{cHandler:t,purpose:M(r)};var t,r},ul=function(n){return n.cHandler},cl=function(n,e){return{name:M(n),handler:M(e)}},al=function(n,e,t){var r,o,i=C(t,(r=n,o={},wn(e,function(n){o[n.name()]=n.handlers(r)}),o));return el(i,cl)},sl=function(n){var e,i=S(e=n)?{can:M(!0),abort:M(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},fl=function(n,e,t){var r,o,i=e[t];return i?function(u,c,n,a){var e=n.slice(0);try{var t=e.sort(function(n,e){var t=n[c](),r=e[c](),o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+It(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+It(a,null,2));return o<i?-1:i<o?1:0});return tt.value(t)}catch(r){return tt.error([r])}}("Event: "+t,"name",n,i).map(function(n){var e=xn(n,function(n){return n.handler()});return dr(e)}):(r=t,o=n,tt.error(["The event ("+r+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+It(xn(o,function(n){return n.name()}),null,2)]))},ll=function(n,i){var e=L(n,function(r,o){return(1===r.length?tt.value(r[0].handler()):fl(r,i,o)).map(function(n){var e=sl(n),t=1<r.length?Sn(i,function(e){return yn(r,function(n){return n.name()===e})}).join(" > "):r[0].name();return St(o,{handler:e,purpose:M(t)})})});return Tt(e,{})},dl=function(n){return qt("custom.definition",Ht([$t("dom","dom",ut(),Ht([er("tag"),ar("styles",{}),ar("classes",[]),ar("attributes",{}),ir("value"),ir("innerHtml")])),er("components"),er("uid"),ar("events",{}),ar("apis",M({})),$t("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},ot.mergeWithThunk(M(e))),Zt()),ir("domModification"),Xo("originalSpec"),ar("debug.sketcher","unknown")]),n);var e},ml=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:C((e=n,St(Aa(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:xn(n.components(),function(n){return n.element()})};return Cr(C(t,n.dom().innerHtml().map(function(n){return St("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return St("value",n)}).getOr({})))},gl=function(e,n){wn(n,function(n){oo(e,n)})},vl=function(e,n){wn(n,function(n){io(e,n)})},pl=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=Er(e),It(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return xn(n,bl)},function(n){return n});var n},hl=function(n){var e=fe.fromTag(n.tag());Kr(e,n.attributes().getOr({})),gl(e,n.classes().getOr([])),Ti(e,n.styles().getOr({})),Eo(e,n.innerHtml().getOr(""));var t=pl(n);return _e(e,t),n.value().each(function(n){hf(e,n)}),e},bl=function(n){var e=Cr(n);return hl(e)},yl=function(n,e){return t=n,o=xn(r=e,function(n){return ur(n.name(),[er("config"),ar("state",Lr)])}),i=qt("component.behaviours",zt(o),t.behaviours).fold(function(n){throw new Error(Jt(n)+"\nComplete spec:\n"+It(t,null,2))},function(n){return n}),{list:r,data:z(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},xl=function(n){var e,t,r=(e=wt(n,"behaviours").getOr({}),t=Sn(N(e),function(n){return e[n]!==undefined}),xn(t,function(n){return e[n].me}));return yl(n,r)},wl=jr(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),Sl=function(n,e,t){var r,o,i,u,c=ml(n),a=function(e,n,t,r){var o=C({},n);wn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=el(o,function(n,e){return{name:function(){return n},modification:e}}),u=z(i,function(n,e){return Mn(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),c=L(u,function(e,t){return wt(ol,t).fold(function(){return tt.error("Unknown field type: "+t)},function(n){return n(e,t)})});return Tt(c,{}).map(Dr)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Dr({})},Dr))},e,c).getOrDie();return i=a,u=C({tag:(o=c).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:E(o.attributes().getOr({}),i.attributes().getOr({})),styles:E(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return St("innerHtml",n)}).getOr({}),Ir("domChildren",i.domChildren(),o.domChildren()),Ir("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return St("value",n)}).getOr({})),Cr(u)},Ol=function(n,e,t){var r,o,i,u,c,a,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,c=s,a=al(o,u,c),ll(a,i)).getOrDie()},Tl=function(n){var e,t,r,o,i,u,c,a,s,f,l,d,m,g,v=Qf(n),p=(e=v,t=xt("components",[])(e),xn(t,El)),h=C(Jf,v,St("components",p));return tt.value((r=h,i=mo(nl(o=function(){return g})),u=Yt(dl(C(r,{behaviours:undefined}))),c=xl(r),a=c.list,s=c.data,f=Sl(u,a,s),l=hl(f),d=Ol(u,a,s),m=mo(u.components()),g=wl({getSystem:i.get,config:function(n){if(n===Ia())return u.apis();if(b(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(S(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+It(r,null,2))})()},hasConfigured:function(n){return S(s[n.name()])},spec:M(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(nl(o))},element:M(l),syncComponents:function(){var n=Pe(l),e=Mn(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:M(d)})))},kl=function(n){var e=fe.fromText(n);return Cl({element:e})},Cl=function(n){var t=Xt("external.component",Ht([er("element"),ir("uid")]),n),e=mo(nl());t.uid().each(function(n){var e;e=t.element(),Yr(e,Ra,n)});var r=wl({getSystem:e.get,config:V.none,hasConfigured:M(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(nl(function(){return r}))},element:M(t.element()),spec:M(n),readState:M("No state"),syncComponents:I,components:M([]),events:M({})});return Ea(r)},El=function(e){return(n=e,wt(n,ka)).fold(function(){var n=C({uid:Va("")},e);return Tl(n).getOrDie()},function(n){return n});var n},Dl=Ea,Il="alloy.item-hover",Ml="alloy.item-focus",Al=function(n){(wo(n.element()).isNone()||xi.isFocused(n))&&(xi.isFocused(n)||xi.focus(n),ie(n,Il,{item:n}))},Bl=function(n){ie(n,Ml,{item:n})},Rl=M(Il),Fl=M(Ml),Vl=[er("data"),er("components"),er("dom"),ir("toggling"),ar("itemBehaviours",{}),ar("ignoreFocus",!1),ar("domModification",{}),Ko("builder",function(n){return{dom:C(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:C($r([n.toggling().fold(fi.revoke,function(n){return fi.config(C({aria:{mode:"checked"}},n))}),xi.config({ignore:n.ignoreFocus(),onFocus:function(n){Bl(n)}}),Pc.config({mode:"execution"}),Os.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:mr([(e=Qn(),r=ue,vr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),yr(G()),vr(q(),Al),vr(Xn(),xi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),ar("eventOrder",{})],Nl=[er("dom"),er("components"),Ko("builder",function(n){return{dom:n.dom(),components:n.components(),events:mr([(e=Xn(),vr(e,function(n,e){e.stop()}))])};var e})],Hl=M([da({name:"widget",overrides:function(e){return{behaviours:$r([Os.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),zl=[er("uid"),er("data"),er("components"),er("dom"),ar("autofocus",!1),ar("domModification",{}),Ta(Hl()),Ko("builder",function(t){var n=ya(0,t,Hl()),e=xa("item-widget",t,n.internals()),r=function(n){return wa(n,t,"widget").map(function(n){return Pc.focusIn(n),n})},o=function(n,e){return vu(e.event().target())||t.autofocus()&&e.setSource(n.element()),V.none()};return C({dom:t.dom(),components:e,domModification:t.domModification(),events:mr([Or(function(n,e){r(n).each(function(n){e.stop()})}),vr(q(),Al),vr(Xn(),function(n,e){t.autofocus()?r(n):xi.focus(n)})]),behaviours:$r([Os.config({store:{mode:"memory",initialValue:t.data()}}),xi.config({onFocus:function(n){Bl(n)}}),Pc.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Ur(),onLeft:o,onRight:o,onEscape:function(n,e){return xi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),V.none()):(xi.focus(n),V.some(!0))}})])})})],jl=Qt("type",{widget:zl,item:Vl,separator:Nl}),Ll=M([ga({factory:{sketch:function(n){var e=Xt("menu.spec item",jl,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Va("");return C({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Pl=M([er("value"),er("items"),er("dom"),er("components"),ar("eventOrder",{}),$c("menuBehaviours",[su,Os,mf,Pc]),sr("movement",{mode:"menu",moveOnTab:!0},Qt("mode",{grid:[Jo(),Ko("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[ar("moveOnTab",!0),Ko("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),tr("markers",$o()),ar("fakeFocus",!1),ar("focusManager",fu()),_o("onHighlight")]),$l=M("alloy.menu-focus"),Wl=$a({name:"Menu",configFields:Pl(),partFields:Ll(),factory:function(n,e,t,r){return C({dom:C(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:C($r([su.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),Os.config({store:{mode:"memory",initialValue:n.value()}}),mf.config({find:V.some}),Pc.config(n.movement().config()(n,n.movement()))]),Wc(n.menuBehaviours())),events:mr([vr(Fl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){su.highlight(e,n),t.stop(),ie(e,$l(),{menu:e,item:n})})}),vr(Rl(),function(n,e){var t=e.event().item();su.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),Gl=function(n,e,t,r){var o=n.getSystem().build(r);Je(n,o,t)},_l=function(n,e){return n.components()},Ul=Gr({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){Gl(n,0,Ge,r)},prepend:function(n,e,t,r){Gl(n,0,We,r)},remove:function(n,e,t,r){var o=_l(n);kn(o,function(n){return He(r.element(),n.element())}).each(Ze)},set:function(e,n,t,r){var o,i,u,c,a,s;i=(o=e).components(),wn(i,Qe),Ue(o.element()),o.syncComponents(),u=function(){var n=xn(r,e.getSystem().build);wn(n,function(n){Xe(e,n)})},c=e.element(),a=ze(c),s=xo(a).bind(function(e){var n=function(n){return He(e,n)};return n(c)?V.some(c):ho(c,n)}),u(c),s.each(function(e){xo(a).filter(function(n){return He(n,e)}).fold(function(){bo(e)},I)})},contents:_l})}),ql=function(t,r,o,n){return wt(o,n).bind(function(n){return wt(t,n).bind(function(n){var e=ql(t,r,o,n);return V.some([n].concat(e))})}).getOr([])},Yl=function(n,e){var t={};H(n,function(n,e){wn(n,function(n){t[n]=e})});var r=e,o=j(e,function(n,e){return{k:n,v:e}}),i=z(o,function(n,e){return[e].concat(ql(t,r,o,e))});return z(t,function(n){return wt(i,n).getOr([n])})},Kl=function(){var i=mo({}),u=mo({}),c=mo({}),a=mo(V.none()),s=mo({}),n=function(n){return wt(u.get(),n)};return{setContents:function(n,e,t,r){a.set(V.some(n)),i.set(t),u.set(e),s.set(r);var o=Yl(r,t);c.set(o)},expand:function(t){return wt(i.get(),t).map(function(n){var e=wt(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return wt(c.get(),n)},collapse:function(n){return wt(c.get(),n).bind(function(n){return 1<n.length?V.some(n.slice(1)):V.none()})},lookupMenu:n,otherMenus:function(n){var e,t,r=s.get();return e=N(r),t=n,Sn(e,function(n){return!yn(t,n)})},getPrimary:function(){return a.get().bind(n)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(V.none())},isClear:function(){return a.get().isNone()}}},Xl=M("collapse-item"),Jl=Pa({name:"TieredMenu",configFields:[Yo("onExecute"),Yo("onEscape"),qo("onOpenMenu"),qo("onOpenSubmenu"),_o("onCollapseMenu"),ar("openImmediately",!0),or("data",[er("primary"),er("menus"),er("expansions")]),ar("fakeFocus",!1),_o("onHighlight"),_o("onHover"),or("markers",[er("backgroundMenu")].concat(Lo()).concat(Po())),er("dom"),ar("navigateOnHover",!0),ar("stayInDom",!1),$c("tmenuBehaviours",[Pc,su,mf,Ul]),ar("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)}},factory:function(u,o){var i=function(r,n){return z(n,function(n,e){var t=Wl.sketch(C(n,{value:e,items:n.items,markers:ht(o.markers,["item","selectedItem"]),fakeFocus:u.fakeFocus(),onHighlight:u.onHighlight(),focusManager:u.fakeFocus()?{get:function(n){return su.getHighlighted(n).map(function(n){return n.element()})},set:function(e,n){e.getSystem().getByDom(n).fold(I,function(n){su.highlight(e,n)})}}:fu()}));return r.getSystem().build(t)})},c=Kl(),a=function(n){return Os.getValue(n).value},s=function(n){return z(u.data().menus(),function(n,e){return Mn(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},f=function(e,n){su.highlight(e,n),su.getHighlighted(n).orThunk(function(){return su.getFirst(n)}).each(function(n){ce(e,n.element(),Xn())})},l=function(n,e){return Bo(xn(e,n.lookupMenu))},d=function(r,o,i){return V.from(i[0]).bind(o.lookupMenu).map(function(n){var e=l(o,i.slice(1));wn(e,function(n){oo(n.element(),u.markers().backgroundMenu())}),be(n.element())||Ul.append(r,Dl(n)),vl(n.element(),[u.markers().backgroundMenu()]),f(r,n);var t=l(o,o.otherMenus(i));return wn(t,function(n){vl(n.element(),[u.markers().backgroundMenu()]),u.stayInDom()||Ul.remove(r,n)}),n})},m=function(e,t){var n=a(t);return c.expand(n).bind(function(n){return V.from(n[0]).bind(c.lookupMenu).each(function(n){be(n.element())||Ul.append(e,Dl(n)),u.onOpenSubmenu()(e,t,n),su.highlightFirst(n)}),d(e,c,n)})},r=function(e,t){var n=a(t);return c.collapse(n).bind(function(n){return d(e,c,n).map(function(n){return u.onCollapseMenu()(e,t,n),n})})},n=function(t){return function(e,n){return Pi(n.getSource(),"."+u.markers().item()).bind(function(n){return e.getSystem().getByDom(n).toOption().bind(function(n){return t(e,n).map(function(){return!0})})})}},e=mr([vr($l(),function(n,e){var t=e.event().menu();su.highlight(n,t)}),Or(function(e,n){var t=n.event().target();e.getSystem().getByDom(t).each(function(n){0===a(n).indexOf("collapse-item")&&r(e,n),m(e,n).fold(function(){u.onExecute()(e,n)},function(){})})}),xr(function(e,n){var t,r,o;(t=e,r=i(t,u.data().menus()),o=s(),c.setContents(u.data().primary(),r,u.data().expansions(),o),c.getPrimary()).each(function(n){Ul.append(e,Dl(n)),u.openImmediately()&&(f(e,n),u.onOpenMenu()(e,n))})})].concat(u.navigateOnHover()?[vr(Rl(),function(n,e){var t,r,o=e.event().item();t=n,r=a(o),c.refresh(r).bind(function(n){return d(t,c,n)}),m(n,o),u.onHover()(n,o)})]:[]));return{uid:u.uid(),dom:u.dom(),behaviours:C($r([Pc.config({mode:"special",onRight:n(function(n,e){return vu(e.element())?V.none():m(n,e)}),onLeft:n(function(n,e){return vu(e.element())?V.none():r(n,e)}),onEscape:n(function(n,e){return r(n,e).orThunk(function(){return u.onEscape()(n,e).map(function(){return n})})}),focusIn:function(e,n){c.getPrimary().each(function(n){ce(e,n.element(),Xn())})}}),su.config({highlightClass:u.markers().selectedMenu(),itemClass:u.markers().menu()}),mf.config({find:function(n){return su.getHighlighted(n)}}),Ul.config({})]),Wc(u.tmenuBehaviours())),eventOrder:u.eventOrder(),apis:{collapseMenu:function(e){su.getHighlighted(e).each(function(n){su.getHighlighted(n).each(function(n){r(e,n)})})}},events:e}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:St(n,e),expansions:{}}},collapseItem:function(n){return{value:Zc(Xl()),text:n}}}}),Ql=function(n,e,t,r){return wt(e.routes(),r.start()).map(s).bind(function(n){return wt(n,r.destination()).map(s)})},Zl=function(n,e,t,r){return Ql(0,e,0,r).bind(function(e){return e.transition().map(function(n){return{transition:M(n),route:M(e)}})})},nd=function(t,r,n){var e,o,i;(e=t,o=r,i=n,ed(e,o).bind(function(n){return Zl(e,o,i,n)})).each(function(n){var e=n.transition();io(t.element(),e.transitionClass()),Qr(t.element(),r.destinationAttr())})},ed=function(n,e,t){var r=n.element();return Jr(r,e.destinationAttr())?V.some({start:M(Xr(n.element(),e.stateAttr())),destination:M(Xr(n.element(),e.destinationAttr()))}):V.none()},td=function(n,e,t,r){nd(n,e,t),Jr(n.element(),e.stateAttr())&&Xr(n.element(),e.stateAttr())!==r&&e.onFinish()(n,r),Yr(n.element(),e.stateAttr(),r)},rd=Object.freeze({findRoute:Ql,disableTransition:nd,getCurrentRoute:ed,jumpTo:td,progressTo:function(t,r,o,i){var n,e;e=r,Jr((n=t).element(),e.destinationAttr())&&(Yr(n.element(),e.stateAttr(),Xr(n.element(),e.destinationAttr())),Qr(n.element(),e.destinationAttr()));var u,c,a=(u=r,c=i,{start:M(Xr(t.element(),u.stateAttr())),destination:M(c)});Zl(t,r,o,a).fold(function(){td(t,r,o,i)},function(n){nd(t,r,o);var e=n.transition();oo(t.element(),e.transitionClass()),Yr(t.element(),r.destinationAttr(),i)})},getState:function(n,e,t){var r=n.element();return Jr(r,e.stateAttr())?V.some(Xr(r,e.stateAttr())):V.none()}}),od=Object.freeze({events:function(o,i){return mr([vr(Q(),function(t,n){var r=n.event().raw();ed(t,o).each(function(e){Ql(0,o,0,e).each(function(n){n.transition().each(function(n){r.propertyName===n.property()&&(td(t,o,i,e.destination()),o.onTransition()(t,e))})})})}),xr(function(n,e){td(n,o,i,o.initialState())})])}}),id=[ar("destinationAttr","data-transitioning-destination"),ar("stateAttr","data-transitioning-state"),er("initialState"),_o("onTransition"),_o("onFinish"),tr("routes",jt(tt.value,jt(tt.value,Ht([cr("transition",[er("property"),er("transitionClass")])]))))],ud=Gr({fields:id,name:"transitioning",active:od,apis:rd,extra:{createRoutes:function(n){var r={};return H(n,function(n,e){var t=e.split("<->");r[t[0]]=St(t[1],n),r[t[1]]=St(t[0],n)}),r},createBistate:function(n,e,t){return Ot([{key:n,value:St(e,t)},{key:e,value:St(n,t)}])},createTristate:function(n,e,t,r){return Ot([{key:n,value:Ot([{key:e,value:r},{key:t,value:r}])},{key:e,value:Ot([{key:n,value:r},{key:t,value:r}])},{key:t,value:Ot([{key:n,value:r},{key:e,value:r}])}])}}}),cd=vi.resolve("scrollable"),ad={register:function(n){oo(n,cd)},deregister:function(n){io(n,cd)},scrollable:M(cd)},sd=function(n){return wt(n,"format").getOr(n.title)},fd=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[vi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:vi.resolve("format-matches"),selected:t},itemBehaviours:$r(o?[]:[li(n,function(n,e){(e?fi.on:fi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},ld=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Wa.sketch({dom:{tag:"div",classes:[vi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[vi.resolve("styles-collapse-icon")]}},kl(n)]:[kl(n)],action:function(n){if(r){var e=t().get(n);Jl.collapseMenu(e)}}}),{dom:{tag:"div",classes:[vi.resolve("styles-menu-items-container")]},components:[Wl.parts().items({})],behaviours:$r([ff("adhoc-scrollable-menu",[xr(function(n,e){Oi(n.element(),"overflow-y","auto"),Oi(n.element(),"-webkit-overflow-scrolling","touch"),ad.register(n.element())}),wr(function(n){Di(n.element(),"overflow-y"),Di(n.element(),"-webkit-overflow-scrolling"),ad.deregister(n.element())})])])}],items:e,menuBehaviours:$r([ud.config({initialState:"after",routes:ud.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},dd=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=ld("Styles",[].concat(xn(o.items,function(n){return fd(sd(n),n.title,n.isSelected(),n.getPreview(),kt(o.expansions,sd(n)))})),i,!1),e=z(o.menus,function(n,e){var t=xn(n,function(n){return fd(sd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",kt(o.expansions,sd(n)))});return ld(e,t,i,!0)}),t=C(e,St("styles",n)),{tmenu:Jl.tieredData("styles",t,o.expansions)}),c=Ps(Jl.sketch({dom:{tag:"div",classes:[vi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Os.getValue(e);return r.handle(e,t.value),V.none()},onEscape:function(){return V.none()},onOpenMenu:function(n,e){var t=Ds(n.element());Es(e.element(),t),ud.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Ds(n.element()),o=ji(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Es(t.element(),r),ud.progressTo(i,"before"),ud.jumpTo(t,"after"),ud.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=ji(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();ud.progressTo(o,"after"),ud.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:vi.resolve("styles-background-menu"),menu:vi.resolve("styles-menu"),selectedMenu:vi.resolve("styles-selected-menu"),item:vi.resolve("styles-item"),selectedItem:vi.resolve("styles-selected-item")}}));return c.asSpec()},md=function(n){return kt(n,"items")?(t=C(bt(e=n,["items"]),{menu:!0}),r=gd(e.items),{item:t,menus:C(r.menus,St(e.title,r.items)),expansions:C(r.expansions,St(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},gd=function(n){return On(n,function(n,e){var t=md(e);return{menus:C(n.menus,t.menus),items:[t.item].concat(n.items),expansions:C(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},vd={expand:gd},pd=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=wt(n,"style_formats").getOr(Kf),s=function(n){return xn(n,function(n){if(kt(n,"items")){var e=s(n.items);return C(C(n,{isSelected:M(!1),getPreview:M("")}),{items:e})}return kt(n,"format")?C(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Zc((t=n).title),o=C(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},hd=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Mn(n,function(n){return n.items!==undefined?0<o(n.items).length?[n]:[]:!kt(n,"format")||e.formatter.canApply(n.format)?[n]:[]})})(n),vd.expand(i));return dd({formats:u,handle:function(n,e){t.undoManager.transact(function(){fi.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},bd=["undo","bold","italic","link","image","bullist","styleselect"],yd=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},xd=function(n){return Mn(n,function(n){return y(n)?xd(n):yd(n)})},wd=function(n){var e=n.toolbar!==undefined?n.toolbar:bd;return y(e)?xd(e):yd(e)},Sd=function(r,o){var n=function(n){return function(){return Xa.forToolbarCommand(o,n)}},e=function(n){return function(){return Xa.forToolbarStateCommand(o,n)}},t=function(n,e,t){return function(){return Xa.forToolbarStateAction(o,n,e,t)}},i=n("undo"),u=n("redo"),c=e("bold"),a=e("italic"),s=e("underline"),f=n("removeformat"),l=t("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=t("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=t("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=pd(o,o.settings),v=function(){return hd(o,g,function(){o.fire("scrollIntoView")})},p=function(n,e){return{isSupported:function(){return n.forall(function(n){return kt(o.buttons,n)})},sketch:e}};return{undo:p(V.none(),i),redo:p(V.none(),u),bold:p(V.none(),c),italic:p(V.none(),a),underline:p(V.none(),s),removeformat:p(V.none(),f),link:p(V.none(),function(){return e=r,t=o,Xa.forToolbarStateAction(t,"link","link",function(){var n=Yf(e,t);e.setContextToolbar(n),sf(t,function(){e.focusToolbar()}),uf.query(t).each(function(n){t.selection.select(n.dom())})});var e,t}),unlink:p(V.none(),l),image:p(V.none(),function(){return Zs(o)}),bullist:p(V.some("bullist"),d),numlist:p(V.some("numlist"),m),fontsizeselect:p(V.none(),function(){return e=o,n={onChange:function(n){zs.apply(e,n)},getInitialValue:function(){return zs.get(e)}},As(r,"font-size",function(){return Ls(n)});var e,n}),forecolor:p(V.none(),function(){return Rs(r,o)}),styleselect:p(V.none(),function(){return Xa.forToolbar("style-formats",function(n){o.fire("toReading"),r.dropup().appear(v,fi.on,n)},$r([fi.config({toggleClass:vi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Zo.config({channels:Ot([mi(ko.orientationChanged(),fi.off),mi(ko.dropupDismissed(),fi.off)])})]))})}},Od=function(n,t){var e=wd(n),r={};return Mn(e,function(n){var e=!kt(r,n)&&kt(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})},Td=function(m,g){return function(n){if(m(n)){var e,t,r,o,i,u,c,a=fe.fromDom(n.target),s=function(){n.stopPropagation()},f=function(){n.preventDefault()},l=p(f,s),d=(e=a,t=n.clientX,r=n.clientY,o=s,i=f,u=l,c=n,{target:M(e),x:M(t),y:M(r),stop:o,prevent:i,kill:u,raw:M(c)});g(d)}}},kd=function(n,e,t,r,o){var i=Td(t,r);return n.dom().addEventListener(e,i,o),{unbind:l(Cd,n,e,i,o)}},Cd=function(n,e,t,r){n.dom().removeEventListener(e,t,r)},Ed=M(!0),Dd=function(n,e,t){return kd(n,e,Ed,t,!1)},Id=function(n,e,t){return kd(n,e,Ed,t,!0)},Md=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:M(e)}},Ad=Md,Bd=function(r,e){var n=fe.fromDom(r),o=null,t=Dd(n,"orientationchange",function(){clearInterval(o);var n=Md(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){clearInterval(o);var e=r.innerHeight,t=0;o=setInterval(function(){e!==r.innerHeight?(clearInterval(o),n(V.some(r.innerHeight))):20<t&&(clearInterval(o),n(V.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Rd=function(n){var e=Gn.detect().os.isiOS(),t=Md(n).isPortrait();return e&&!t?n.screen.height:n.screen.width},Fd=function(n){var e=n.raw();return e.touches===undefined||1!==e.touches.length?V.none():V.some(e.touches[0])},Vd=function(t){var r,o,i,u=mo(V.none()),c=(r=function(n){u.set(V.none()),t.triggerEvent(Zn(),n)},o=400,i=null,{cancel:function(){null!==i&&(v.clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i=v.setTimeout(function(){r.apply(null,n),i=null},o)}}),a=Ot([{key:P(),value:function(t){return Fd(t).each(function(n){c.cancel();var e={x:M(n.clientX),y:M(n.clientY),target:t.target};c.schedule(t),u.set(V.some(e))}),V.none()}},{key:$(),value:function(n){return c.cancel(),Fd(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x()),o=Math.abs(e.clientY-t.y()),(5<r||5<o)&&u.set(V.none())})}),V.none()}},{key:W(),value:function(e){return c.cancel(),u.get().filter(function(n){return He(n.target(),e.target())}).map(function(n){return t.triggerEvent(Jn(),e)})}}]);return{fireIfReady:function(e,n){return wt(a,n).bind(function(n){return n(e)})}}},Nd=function(t){var e=Vd({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return Dd(t.body(),"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return Dd(t.body(),"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Hd=6<=Gn.detect().os.version.major,zd=function(r,e,t){var o=Nd(r),i=ze(e),u=function(n){return!He(n.start(),n.finish())||n.soffset()!==n.foffset()},n=function(){var n=r.doc().dom().hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||xo(i).filter(function(n){return"input"===ge(n)}).exists(function(n){return n.dom().selectionStart!==n.dom().selectionEnd}))?fi.on:fi.off)},c=[Dd(r.body(),"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),Dd(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){yo(r.body())}),r.onToEditing(I),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win(),t=n.top()>e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Hd?[]:[Dd(fe.fromDom(r.win()),"blur",function(){t.getByDom(e).each(fi.off)}),Dd(i,"select",n),Dd(r.doc(),"selectionchange",n)]);return{destroy:function(){wn(c,function(n){n.unbind()})}}},jd=function(n,e){var t=parseInt(Xr(n,e),10);return isNaN(t)?0:t},Ld=(Us=he,qs="text",Ys=function(n){return Us(n)?V.from(n.dom().nodeValue):V.none()},Ks=Gn.detect().browser,{get:function(n){if(!Us(n))throw new Error("Can only get "+qs+" value of a "+qs+" node");return Xs(n).getOr("")},getOption:Xs=Ks.isIE()&&10===Ks.version.major?function(n){try{return Ys(n)}catch(e){return V.none()}}:Ys,set:function(n,e){if(!Us(n))throw new Error("Can only set raw "+qs+" value of a "+qs+" node");n.dom().nodeValue=e}}),Pd=function(n){return Ld.getOption(n)},$d={create:we("start","soffset","finish","foffset")},Wd=rt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gd={before:Wd.before,on:Wd.on,after:Wd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},_d=rt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ud={domRange:_d.domRange,relative:_d.relative,exact:_d.exact,exactFromRange:function(n){return _d.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e=n.match({domRange:function(n){return fe.fromDom(n.startContainer)},relative:function(n,e){return Gd.getStart(n)},exact:function(n,e,t,r){return n}});return je(e)},range:$d.create},qd=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},Yd=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},Kd=function(n){return{left:M(n.left),top:M(n.top),right:M(n.right),bottom:M(n.bottom),width:M(n.width),height:M(n.height)}},Xd=rt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Jd=function(n,e,t){return e(fe.fromDom(t.startContainer),t.startOffset,fe.fromDom(t.endContainer),t.endOffset)},Qd=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:M(n),rtl:V.none}},relative:function(n,e){return{ltr:nn(function(){return qd(o,n,e)}),rtl:nn(function(){return V.some(qd(o,e,n))})}},exact:function(n,e,t,r){return{ltr:nn(function(){return Yd(o,n,e,t,r)}),rtl:nn(function(){return V.some(Yd(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Xd.rtl(fe.fromDom(n.endContainer),n.endOffset,fe.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Jd(0,Xd.ltr,r)}):Jd(0,Xd.ltr,r)},Zd=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=ge(n);return"input"===t?Gd.after(n):yn(["br","img"],t)?0===e?Gd.before(n):Gd.after(n):Gd.on(n,e)}),nm=function(n,e,t,r){var o,i,u,c,a,s=(i=e,u=t,c=r,(a=ze(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),f=He(n,t)&&e===r;return s.collapsed&&!f},em=function(n,e,t,r,o){var i,u,c=Yd(n,e,t,r,o);i=n,u=c,V.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},tm=function(n,e,t,r,o){var i,u,c,a,l,s=(i=r,u=o,c=Zd(e,t),a=Zd(i,u),Ud.relative(c,a));Qd(l=n,s).match({ltr:function(n,e,t,r){em(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,c=t,a=r,(o=s).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(f){em(l,t,r,n,e)}else em(l,t,r,n,e)}})},rm=function(n){var e=fe.fromDom(n.anchorNode),t=fe.fromDom(n.focusNode);return nm(e,n.anchorOffset,t,n.focusOffset)?V.some($d.create(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return V.some($d.create(fe.fromDom(e.startContainer),e.startOffset,fe.fromDom(t.endContainer),t.endOffset))}return V.none()}(n)},om=function(n){return V.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(rm)},im=function(n,e){var i,t,r,o,u=Qd(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom(),e),o.setEnd(t.dom(),r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom(),r),o.setEnd(n.dom(),e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?V.some(o).map(Kd):V.none()},um=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:M(2),height:n.height}},cm=function(n){return{left:M(n.left),top:M(n.top),right:M(n.right),bottom:M(n.bottom),width:M(n.width),height:M(n.height)}},am=function(r){if(r.collapsed){var o=fe.fromDom(r.startContainer);return Le(o).bind(function(n){var e,t=Ud.exact(o,r.startOffset,n,"img"===ge(e=n)?1:Pd(e).fold(function(){return Pe(e).length},function(n){return n.length}));return im(r.startContainer.ownerDocument.defaultView,t).map(um).map(Rn)}).getOr([])}return xn(r.getClientRects(),cm)},sm=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?am(e.getRangeAt(0)):[]},fm=function(n){n.focus();var e=fe.fromDom(n.document.body);(xo().exists(function(n){return yn(["input","textarea"],ge(n))})?function(n){setTimeout(function(){n()},0)}:s)(function(){xo().each(yo),bo(e)})},lm="data-"+vi.resolve("last-outer-height"),dm=function(n,e){Yr(n,lm,e)},mm=function(n){return{top:M(n.top()),bottom:M(n.top()+n.height())}},gm=function(n,e){var t=jd(e,lm),r=n.innerHeight;return r<t?V.some(t-r):V.none()},vm=function(n,u){var e=fe.fromDom(u.document.body),t=Dd(fe.fromDom(n),"resize",function(){gm(n,e).each(function(i){var n,e;(n=u,e=sm(n),0<e.length?V.some(e[0]).map(mm):V.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top()>e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),dm(e,n.innerHeight)});return dm(e,n.innerHeight),{toEditing:function(){fm(u)},destroy:function(){t.unbind()}}},pm=function(n){return V.some(fe.fromDom(n.dom().contentWindow.document.body))},hm=function(n){return V.some(fe.fromDom(n.dom().contentWindow.document))},bm=function(n){return V.from(n.dom().contentWindow)},ym=function(n){return bm(n).bind(om)},xm=function(n){return n.getFrame()},wm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=xm(e);return function(){return t(n)}})()}},Sm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return Dd(e,r,n)}})},Om=function(n){return{left:M(n.left),top:M(n.top),right:M(n.right),bottom:M(n.bottom),width:M(n.width),height:M(n.height)}},Tm={getBody:wm("getBody",pm),getDoc:wm("getDoc",hm),getWin:wm("getWin",bm),getSelection:wm("getSelection",ym),getFrame:xm,getActiveApi:function(c){var a=xm(c);return pm(a).bind(function(u){return hm(a).bind(function(i){return bm(a).map(function(o){var n=fe.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return(n=o,om(n).map(function(n){return Ud.exact(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return im(o,n).orThunk(function(){return om(o).filter(function(n){return He(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0<e.width||0<e.height?V.some(e).map(Om):V.none()})})});var n}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){tm(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){o.getSelection().removeAllRanges()}});return{body:M(u),doc:M(i),win:M(o),html:M(n),getSelection:l(ym,a),setSelection:t,clearSelection:r,frame:M(a),onKeyup:Sm(c,i,"onKeyup","keyup"),onNodeChanged:Sm(c,i,"onNodeChanged","selectionchange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})})})}},km="data-ephox-mobile-fullscreen-style",Cm="position:absolute!important;",Em="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Dm=Gn.detect().os.isAndroid(),Im=function(n,e){var t,r,o,i=function(r){return function(n){var e=Xr(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(Yr(n,km,t),Yr(n,"style",r))}},u=(t="*",Vi(n,function(n){return Re(n,t)},r)),c=Mn(u,function(n){var e;return e="*",Ni(n,function(n){return Re(n,e)})}),a=(o=ki(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";wn(c,i("display:none!important;")),wn(u,i(Cm+Em+a)),i((!0===Dm?"":Cm)+Em+a)(n)},Mm=function(){var n=Ve("["+km+"]");wn(n,function(n){var e=Xr(n,km);"no-styles"!==e?Yr(n,"style",e):Qr(n,"style"),Qr(n,km)})},Am=function(){var e=zi("head").getOrDie(),n=zi('meta[name="viewport"]').getOrThunk(function(){var n=fe.fromTag("meta");return Yr(n,"name","viewport"),Ge(e,n),n}),t=Xr(n,"content");return{maximize:function(){Yr(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?Yr(n,"content",t):Yr(n,"content","user-scalable=yes")}}},Bm=function(e,n){var t=Am(),r=$f(),o=$f();return{enter:function(){n.hide(),oo(e.container,vi.resolve("fullscreen-maximized")),oo(e.container,vi.resolve("android-maximized")),t.maximize(),oo(e.body,vi.resolve("android-scroll-reload")),r.set(vm(e.win,Tm.getWin(e.editor).getOrDie("no"))),Tm.getActiveApi(e.editor).each(function(n){Im(e.container,n.body()),o.set(zd(n,e.toolstrip,e.alloy))})},exit:function(){t.restore(),n.show(),io(e.container,vi.resolve("fullscreen-maximized")),io(e.container,vi.resolve("android-maximized")),Mm(),io(e.body,vi.resolve("android-scroll-reload")),o.clear(),r.clear()}}},Rm=function(t,r){var o=null;return{cancel:function(){null!==o&&(v.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&v.clearTimeout(o),o=v.setTimeout(function(){t.apply(null,n),o=null},r)}}},Fm=function(n,e){var t,r,o,i=Ps(gf.sketch({dom:Ua('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:$r([fi.config({toggleClass:vi.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(v.clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=v.setTimeout(function(){t.apply(null,n),o=null},r))}});return gf.sketch({dom:Ua('<div class="${prefix}-disabled-mask"></div>'),components:[gf.sketch({dom:Ua('<div class="${prefix}-content-container"></div>'),components:[Wa.sketch({dom:Ua('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:$r([fi.config({toggleClass:vi.resolve("mask-tap-icon-selected")})])})]})]})},Vm=zt([or("editor",[er("getFrame"),ir("getBody"),ir("getDoc"),ir("getWin"),ir("getSelection"),ir("setSelection"),ir("clearSelection"),ir("cursorSaver"),ir("onKeyup"),ir("onNodeChanged"),ir("getCursorBox"),er("onDomChanged"),ar("onTouchContent",I),ar("onTapContent",I),ar("onTouchToolstrip",I),ar("onScrollToCursor",M({unbind:I})),ar("onScrollToElement",M({unbind:I})),ar("onToEditing",M({unbind:I})),ar("onToReading",M({unbind:I})),ar("onToolbarScrollStart",h)]),er("socket"),er("toolstrip"),er("dropup"),er("toolbar"),er("container"),er("alloy"),fr("win",function(n){return ze(n.socket).dom().defaultView}),fr("body",function(n){return fe.fromDom(n.socket.dom().ownerDocument.body)}),ar("translate",h),ar("setReadOnly",I),ar("readOnlyOnInit",M(!0))]),Nm=function(n){var e=Kt("Getting AndroidWebapp schema",Vm,n);Oi(e.toolstrip,"width","100%");var t=El(Fm(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Ge(e.container,t.element());var o=Bm(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:I,enter:o.enter,exit:o.exit,destroy:I}},Hm=M([ar("shell",!0),$c("toolbarBehaviours",[Ul])]),zm=M([ma({name:"groups",overrides:function(n){return{behaviours:$r([Ul.config({})])}}})]),jm=$a({name:"Toolbar",configFields:Hm(),partFields:zm(),factory:function(e,n,t,r){var o=function(n){return e.shell()?V.some(n):wa(n,e,"groups")},i=e.shell()?{behaviours:[Ul.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid(),dom:e.dom(),components:i.components,behaviours:C($r(i.behaviours),Wc(e.toolbarBehaviours())),apis:{setGroups:function(n,e){o(n).fold(function(){throw v.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){Ul.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Lm=M([er("items"),(Js=["itemClass"],or("markers",xn(Js,er))),$c("tgroupBehaviours",[Pc])]),Pm=M([ga({name:"items",unit:"item",overrides:function(n){return{domModification:{classes:[n.markers().itemClass()]}}}})]),$m=$a({name:"ToolbarGroup",configFields:Lm(),partFields:Pm(),factory:function(n,e,t,r){return C({dom:{attributes:{role:"toolbar"}}},{uid:n.uid(),dom:n.dom(),components:e,behaviours:C($r([Pc.config({mode:"flow",selector:"."+n.markers().itemClass()})]),Wc(n.tgroupBehaviours())),"debug.sketcher":t["debug.sketcher"]})}}),Wm="data-"+vi.resolve("horizontal-scroll"),Gm=function(n){return"true"===Xr(n,Wm)?0<(t=n).dom().scrollLeft||function(n){n.dom().scrollLeft=1;var e=0!==n.dom().scrollLeft;return n.dom().scrollLeft=0,e}(t):0<(e=n).dom().scrollTop||function(n){n.dom().scrollTop=1;var e=0!==n.dom().scrollTop;return n.dom().scrollTop=0,e}(e);var e,t},_m={exclusive:function(n,e){return Dd(n,"touchmove",function(n){Pi(n.target(),e).filter(Gm).fold(function(){n.raw().preventDefault()},I)})},markAsHorizontal:function(n){Yr(n,Wm,"true")}};function Um(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Ua('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:$r([ff("adhoc-scrollable-toolbar",!0===n.scrollable?[Sr(function(n,e){Oi(n.element(),"overflow-x","auto"),_m.markAsHorizontal(n.element()),ad.register(n.element())})]:[])]),components:[gf.sketch({components:[$m.parts().items({})]})],markers:{itemClass:vi.resolve("toolbar-group-item")},items:n.items}},t=El(jm.sketch({dom:Ua('<div class="${prefix}-toolbar"></div>'),components:[jm.parts().groups({})],toolbarBehaviours:$r([fi.config({toggleClass:vi.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),Pc.config({mode:"cyclic"})]),shell:!0})),n=El(gf.sketch({dom:{classes:[vi.resolve("toolstrip")]},components:[Dl(t)],containerBehaviours:$r([fi.config({toggleClass:vi.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){jm.setGroups(t,o.get()),fi.off(t)},o=mo([]);return{wrapper:M(n),toolbar:M(t),createGroups:function(n){return xn(n,p($m.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){fi.on(t),jm.setGroups(t,n)},restoreToolbar:function(){fi.isOn(t)&&r()},refresh:function(){},focus:function(){Pc.focusIn(t)}}}var qm=function(n,e){Ul.append(n,Dl(e))},Ym=function(n,e){Ul.remove(n,e)},Km=function(n){return El(Wa.sketch({dom:Ua('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},Xm=function(){return El(gf.sketch({dom:Ua('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:$r([Ul.config({})])}))},Jm=function(n,e,t,r){(!0===t?lo.toAlpha:lo.toOmega)(r),(t?qm:Ym)(n,e)},Qm=function(e,n){return n.getAnimationRoot().fold(function(){return e.element()},function(n){return n(e)})},Zm=function(n){return n.dimension().property()},ng=function(n,e){return n.dimension().getDimension()(e)},eg=function(n,e){var t=Qm(n,e);vl(t,[e.shrinkingClass(),e.growingClass()])},tg=function(n,e){io(n.element(),e.openClass()),oo(n.element(),e.closedClass()),Oi(n.element(),Zm(e),"0px"),Ii(n.element())},rg=function(n,e){io(n.element(),e.closedClass()),oo(n.element(),e.openClass()),Di(n.element(),Zm(e))},og=function(n,e,t){t.setCollapsed(),Oi(n.element(),Zm(e),ng(e,n.element())),Ii(n.element());var r=Qm(n,e);oo(r,e.shrinkingClass()),tg(n,e),e.onStartShrink()(n)},ig=function(n,e,t){var r=function(n,e){rg(n,e);var t=ng(e,n.element());return tg(n,e),t}(n,e),o=Qm(n,e);oo(o,e.growingClass()),rg(n,e),Oi(n.element(),Zm(e),r),t.setExpanded(),e.onStartGrow()(n)},ug=function(n,e,t){var r=Qm(n,e);return!0===co(r,e.growingClass())},cg=function(n,e,t){var r=Qm(n,e);return!0===co(r,e.shrinkingClass())},ag=Object.freeze({grow:function(n,e,t){t.isExpanded()||ig(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&og(n,e,t)},immediateShrink:function(n,e,t){var r,o;t.isExpanded()&&(r=n,o=e,t.setCollapsed(),Oi(r.element(),Zm(o),ng(o,r.element())),Ii(r.element()),eg(r,o),tg(r,o),o.onStartShrink()(r),o.onShrunk()(r))},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:ug,isShrinking:cg,isTransitioning:function(n,e,t){return!0===ug(n,e)||!0===cg(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?og:ig)(n,e,t)},disableTransitions:eg}),sg=Object.freeze({exhibit:function(n,e){var t=e.expanded();return Dr(t?{classes:[e.openClass()],styles:{}}:{classes:[e.closedClass()],styles:St(e.dimension().property(),"0px")})},events:function(t,r){return mr([vr(Q(),function(n,e){e.event().raw().propertyName===t.dimension().property()&&(eg(n,t),r.isExpanded()&&Di(n.element(),t.dimension().property()),(r.isExpanded()?t.onGrown():t.onShrunk())(n))})])}}),fg=[er("closedClass"),er("openClass"),er("shrinkingClass"),er("growingClass"),ir("getAnimationRoot"),_o("onShrunk"),_o("onStartShrink"),_o("onGrown"),_o("onStartGrow"),ar("expanded",!1),tr("dimension",Qt("property",{width:[Ko("property","width"),Ko("getDimension",function(n){return Ds(n)+"px"})],height:[Ko("property","height"),Ko("getDimension",function(n){return Fi(n)+"px"})]}))],lg=Gr({fields:fg,name:"sliding",active:sg,apis:ag,state:Object.freeze({init:function(n){var e=mo(n.expanded());return Pr({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:l(e.set,!1),setExpanded:l(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),dg=function(e,t){var r=El(gf.sketch({dom:{tag:"div",classes:[vi.resolve("dropup")]},components:[],containerBehaviours:$r([Ul.config({}),lg.config({closedClass:vi.resolve("dropup-closed"),openClass:vi.resolve("dropup-open"),shrinkingClass:vi.resolve("dropup-shrinking"),growingClass:vi.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),Ul.set(n,[])},onGrown:function(n){e(),t()}}),di(function(n,e){o(I)})])})),o=function(n){v.window.requestAnimationFrame(function(){n(),lg.shrink(r)})};return{appear:function(n,e,t){!0===lg.hasShrunk(r)&&!1===lg.isTransitioning(r)&&v.window.requestAnimationFrame(function(){e(t),Ul.set(r,[n()]),lg.grow(r)})},disappear:o,component:M(r),element:r.element}},mg=Gn.detect().browser.isFirefox(),gg=Ht([rr("triggerEvent"),rr("broadcastEvent"),ar("stopBackspace",!0)]),vg=function(e,n){var t,r,o,i,u=Kt("Getting GUI events settings",gg,n),c=Gn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],a=Vd(u),s=xn(c.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop"]),function(n){return Dd(e,n,function(e){a.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=Dd(e,"keydown",function(n){var e;u.triggerEvent("keydown",n)?n.kill():!0!==u.stopBackspace||8!==(e=n).raw().which||yn(["input","textarea"],ge(e.target()))||n.prevent()}),l=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},mg?Id(t,"focus",r):Dd(t,"focusin",r)),d=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),v.setTimeout(function(){u.triggerEvent(qn(),n)},0)},mg?Id(o,"blur",i):Dd(o,"focusout",i)),m=je(e),g=Dd(m,"scroll",function(n){u.broadcastEvent(ee(),n)&&n.kill()});return{unbind:function(){wn(s,function(n){n.unbind()}),f.unbind(),l.unbind(),d.unbind(),g.unbind()}}},pg=function(n,e){var t=wt(n,"target").map(function(n){return n()}).getOr(e);return mo(t)},hg=rt([{stopped:[]},{resume:["element"]},{complete:[]}]),bg=function(n,r,e,t,o,i){var u,c,a,s,f=n(r,t),l=(u=e,c=o,a=mo(!1),s=mo(!1),{stop:function(){a.set(!0)},cut:function(){s.set(!0)},isStopped:a.get,isCut:s.get,event:M(u),setSource:c.set,getSource:c.get});return f.fold(function(){return i.logEventNoHandlers(r,t),hg.complete()},function(e){var t=e.descHandler();return ul(t)(l),l.isStopped()?(i.logEventStopped(r,e.element(),t.purpose()),hg.stopped()):l.isCut()?(i.logEventCut(r,e.element(),t.purpose()),hg.complete()):Le(e.element()).fold(function(){return i.logNoParent(r,e.element(),t.purpose()),hg.complete()},function(n){return i.logEventResponse(r,e.element(),t.purpose()),hg.resume(n)})})},yg=function(e,t,r,n,o,i){return bg(e,t,r,n,o,i).fold(function(){return!0},function(n){return yg(e,t,r,n,o,i)},function(){return!1})},xg=function(n,e,t){var r,o,i=(r=e,o=mo(!1),{stop:function(){o.set(!0)},cut:I,isStopped:o.get,isCut:M(!1),event:M(r),setSource:a("Cannot set source of a broadcasted event"),getSource:a("Cannot get source of a broadcasted event")});return wn(n,function(n){var e=n.descHandler();ul(e)(i)}),i.isStopped()},wg=function(n,e,t,r,o){var i=pg(t,r);return yg(n,e,t,r,i,o)},Sg=function(n,e,t){return po(n,function(n){return e(n).isSome()},t).bind(e)},Og=we("element","descHandler"),Tg=function(n,e){return{id:M(n),descHandler:M(e)}};function kg(){var i={};return{registerId:function(r,o,n){H(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=il(n,r),i[e]=t})},unregisterId:function(t){H(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return wt(i,n).map(function(n){return L(n,function(n,e){return Tg(e,n)})}).getOr([])},find:function(n,e,t){var o=yt(e)(i);return Sg(t,function(n){return t=o,Fa(r=n).fold(function(){return V.none()},function(n){var e=yt(n);return t.bind(e).map(function(n){return Og(r,n)})});var t,r},n)}}}function Cg(){var r=kg(),o={},i=function(r){var n=r.element();return Fa(n).fold(function(){return n="uid-",e=r.element(),t=Zc(Ba+n),Yr(e,Ra,t),t;var n,e,t},function(n){return n})},u=function(n){Fa(n.element()).each(function(n){o[n]=undefined,r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);kt(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+Mo(t.element())+"\nCannot use it for: "+Mo(n.element())+"\nThe conflicting element is"+(be(t.element())?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events()),o[e]=n},unregister:u,getById:function(n){return yt(n)(o)}}}var Eg=function(t){var r=function(e){return Le(t.element()).fold(function(){return!0},function(n){return He(e,n)})},o=Cg(),s=function(n,e){return o.find(r,n,e)},n=vg(t.element(),{triggerEvent:function(u,c){return jo(u,c.target(),function(n){return e=s,t=u,o=n,i=(r=c).target(),wg(e,t,r,i,o);var e,t,r,o,i})},broadcastEvent:function(n,e){var t=o.filter(n);return xg(t,e)}}),i=Zf({debugInfo:M("real"),triggerEvent:function(e,t,r){jo(e,t,function(n){wg(s,e,r,t,n)})},triggerFocus:function(c,a){Fa(c).fold(function(){bo(c)},function(n){jo(Un(),c,function(n){var e,t,r,o,i,u;e=s,t=Un(),r={originator:M(a),kill:I,prevent:I,target:M(c)},i=n,u=pg(r,o=c),bg(e,t,r,o,u,i)})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element(),e.event())},getByUid:function(n){return m(n)},getByDom:function(n){return g(n)},build:El,addToGui:function(n){c(n)},removeFromGui:function(n){a(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},isConnected:M(!0)}),e=function(n){n.connect(i),he(n.element())||(o.register(n),wn(n.components(),e),i.triggerEvent(ne(),n.element(),{target:M(n.element())}))},u=function(n){he(n.element())||(wn(n.components(),u),o.unregister(n)),n.disconnect()},c=function(n){Xe(t,n)},a=function(n){Ze(n)},f=function(t){var n=o.filter(Yn());wn(n,function(n){var e=n.descHandler();ul(e)(t)})},l=function(n){f({universal:M(!0),data:M(n)})},d=function(n,e){f({universal:M(!1),channels:M(n),data:M(e)})},m=function(n){return o.getById(n).fold(function(){return tt.error(new Error('Could not find component with uid: "'+n+'" in system.'))},tt.value)},g=function(n){var e=Fa(n).getOr("not found");return m(e)};return e(t),{root:M(t),element:t.element,destroy:function(){n.unbind(),qe(t.element())},add:c,remove:a,getByUid:m,getByDom:g,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d}},Dg=M(vi.resolve("readonly-mode")),Ig=M(vi.resolve("edit-mode"));function Mg(n){var e=El(gf.sketch({dom:{classes:[vi.resolve("outer-container")].concat(n.classes)},containerBehaviours:$r([lo.config({alpha:Dg(),omega:Ig()})])}));return Eg(e)}var Ag=function(n,e){var t=fe.fromTag("input");Ti(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Ge(n,t),bo(t),e(t),qe(t)},Bg=function(n){var e=n.getSelection();if(0<e.rangeCount){var t=e.getRangeAt(0),r=n.document.createRange();r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),e.removeAllRanges(),e.addRange(r)}},Rg=function(n,e){xo().each(function(n){He(n,e)||yo(n)}),n.focus(),bo(fe.fromDom(n.document.body)),Bg(n)},Fg={stubborn:function(n,e,t,r){var o=function(){Rg(e,r)},i=Dd(t,"keydown",function(n){yn(["input","textarea"],ge(n.target()))||o()});return{toReading:function(){Ag(n,yo)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},timid:function(n,e,t,r){var o=function(){yo(r)};return{toReading:function(){o()},toEditing:function(){Rg(e,r)},onToolbarTouch:function(){o()},destroy:I}}},Vg=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom().scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},c=function(){r.run(function(n){n.clearSelection()})},a=function(){t.getCursorBox().each(function(n){e(n.top(),n.height())}),r.run(function(n){n.syncHeight()})},s=Nd(t),f=Rm(a,300),l=[t.onKeyup(function(){c(),f.throttle()}),t.onNodeChanged(u),t.onDomChanged(f.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),f.throttle()}),t.onScrollToElement(function(n){n.element(),e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),Dd(t.doc(),"touchend",function(n){He(t.html(),n.target())||He(t.body(),n.target())}),Dd(o,"transitionend",function(n){var e;"height"===n.raw().propertyName&&(e=Fi(o),r.run(function(n){n.setViewportOffset(e)}),u(),a())}),Id(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),Dd(t.body(),"touchstart",function(n){c(),t.onTouchContent(),s.fireTouchstart(n)}),s.onTouchmove(),s.onTouchend(),Dd(t.body(),"click",function(n){n.kill()}),Dd(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){wn(l,function(n){n.unbind()})}}},Ng=function(n){var t=V.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){wn(n,u)},u=function(e){t.each(function(n){v.setTimeout(function(){e(n)},0)})};return n(function(n){t=V.some(n),i(e),e=[]}),{get:r,map:function(t){return Ng(function(e){r(function(n){e(t(n))})})},isReady:o}},Hg={nu:Ng,pure:function(e){return Ng(function(n){n(e)})}},zg=function(e){var n=function(n){var r;e((r=n,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this;v.setTimeout(function(){r.apply(t,n)},0)}))},t=function(){return Hg.nu(n)};return{map:function(r){return zg(function(t){n(function(n){var e=r(n);t(e)})})},bind:function(t){return zg(function(e){n(function(n){t(n).get(e)})})},anonBind:function(t){return zg(function(e){n(function(n){t.get(e)})})},toLazy:t,toCached:function(){var e=null;return zg(function(n){null===e&&(e=t()),e.get(n)})},get:n}},jg={nu:zg,pure:function(e){return zg(function(n){n(e)})}},Lg=function(n,e,t){return Math.abs(n-e)<=t?V.none():n<e?V.some(n+t):V.some(n-t)},Pg=function(){var s=null;return{animate:function(r,o,n,i,e,t){var u=!1,c=function(n){u=!0,e(n)};clearInterval(s);var a=function(n){clearInterval(s),c(n)};s=setInterval(function(){var t=r();Lg(t,o,n).fold(function(){clearInterval(s),c(o)},function(n){if(i(n,a),!u){var e=r();(e!==n||Math.abs(e-o)>Math.abs(t-o))&&(clearInterval(s),c(o))}})},t)}}},$g=function(e,t){return Ro([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e<=n.width&&t<=n.height?V.some(n.keyboard):V.none()}).getOr({portrait:t/5,landscape:e/4})},Wg=function(n){var e,t=Ad(n).isPortrait(),r=$g((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},Gg=function(n,e){var t=ze(n).dom().defaultView;return Fi(n)+Fi(e)-Wg(t)},_g=Gg,Ug=function(n,e,t){var r=Gg(e,t),o=Fi(e)+Fi(t)-r;Oi(n,"padding-bottom",o+"px")},qg=rt([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Yg="data-"+vi.resolve("position-y-fixed"),Kg="data-"+vi.resolve("y-property"),Xg="data-"+vi.resolve("scrolling"),Jg="data-"+vi.resolve("last-window-height"),Qg=function(n){return jd(n,Yg)},Zg=function(n,e){var t=Xr(n,Kg);return qg.fixed(n,t,e)},nv=function(n,e){return qg.scroller(n,e)},ev=function(n){var e=Qg(n);return("true"===Xr(n,Xg)?nv:Zg)(n,e)},tv=function(n,e,t){var r=ze(n).dom().defaultView.innerHeight;return Yr(n,Jg,r+"px"),r-e-t},rv=function(n){var e=Hi(n,"["+Yg+"]");return xn(e,ev)},ov=function(r,o,i,u){var n,e,t,c,a,s,f,l,d=ze(r).dom().defaultView,m=(l=Xr(f=i,"style"),Ti(f,{position:"absolute",top:"0px"}),Yr(f,Yg,"0px"),Yr(f,Kg,"top"),{restore:function(){Yr(f,"style",l||""),Qr(f,Yg),Qr(f,Kg)}}),g=Fi(i),v=Fi(u),p=(c=tv(r,t=g,v),s=Xr(a=r,"style"),ad.register(a),Ti(a,{position:"absolute",height:c+"px",width:"100%",top:t+"px"}),Yr(a,Yg,t+"px"),Yr(a,Xg,"true"),Yr(a,Kg,"top"),{restore:function(){ad.deregister(a),Yr(a,"style",s||""),Qr(a,Yg),Qr(a,Xg),Qr(a,Kg)}}),h=(e=Xr(n=u,"style"),Ti(n,{position:"absolute",bottom:"0px"}),Yr(n,Yg,"0px"),Yr(n,Kg,"bottom"),{restore:function(){Yr(n,"style",e||""),Qr(n,Yg),Qr(n,Kg)}}),b=!0,y=function(){var n=d.innerHeight;return jd(r,Jg)<n},x=function(){if(b){var n=Fi(i),e=Fi(u),t=tv(r,n,e);Yr(r,Yg,n+"px"),Oi(r,"height",t+"px"),Ug(o,r,u)}};return Ug(o,r,u),{setViewportOffset:function(n){Yr(r,Yg,n+"px"),x()},isExpanding:y,isShrinking:w(y),refresh:x,restore:function(){b=!1,m.restore(),p.restore(),h.restore()}}},iv=Qg,uv=Pg(),cv="data-"+vi.resolve("last-scroll-top"),av=function(n){var e=Ei(n,"top").getOr("0");return parseInt(e,10)},sv=function(n){return parseInt(n.dom().scrollTop,10)},fv=function(n,e){var t=e+iv(n)+"px";Oi(n,"top",t)},lv=function(t,r,o){return jg.nu(function(n){var e=l(sv,t);uv.animate(e,r,15,function(n){t.dom().scrollTop=n,Oi(t,"top",av(t)+15+"px")},function(){t.dom().scrollTop=r,Oi(t,"top",o+"px"),n(r)},10)})},dv=function(o,i){return jg.nu(function(n){var e=l(sv,o);Yr(o,cv,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);uv.animate(e,i,r,function(n,e){jd(o,cv)!==o.dom().scrollTop?e(o.dom().scrollTop):(o.dom().scrollTop=n,Yr(o,cv,n))},function(){o.dom().scrollTop=i,Yr(o,cv,i),n(i)},10)})},mv=function(i,u){return jg.nu(function(n){var e=l(av,i),t=function(n){Oi(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);uv.animate(e,u,o,t,function(){t(u),n(u)},10)})},gv=function(e,t,r){var o=ze(e).dom().defaultView;return jg.nu(function(n){fv(e,r),fv(t,r),o.scrollTo(0,r),n(r)})},vv=function(n,e,t,r,o){var i=_g(e,t),u=l(Bg,n);i<r||i<o?dv(e,e.dom().scrollTop-i+o).get(u):r<0&&dv(e,e.dom().scrollTop+r).get(u)},pv=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):wn(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},hv=function(n,a){return n.fold(function(n,e,t){return Oi(n,e,a+(r=t)+"px"),jg.pure(r);var r},function(n,e){return o=a+(r=e),i=Ei(t=n,"top").getOr(r),u=o-parseInt(i,10),c=t.dom().scrollTop+u,lv(t,c,o);var t,r,o,i,u,c})},bv=function(n,e){var t=rv(n),r=xn(t,function(n){return hv(n,e)});return pv(r,jg.nu)},yv=function(e,t,n,r,o,i){var u,c,a=(u=function(n){return gv(e,t,n)},c=mo(Hg.pure({})),{start:function(e){var n=Hg.nu(function(n){return u(e).get(n)});c.set(n)},idle:function(n){c.get().get(function(){n()})}}),s=Rm(function(){a.idle(function(){bv(n,r.pageYOffset).get(function(){var n;(n=sm(i),V.from(n[0]).bind(function(n){var e=n.top()-t.dom().scrollTop;return e>r.innerHeight+5||e<-5?V.some({top:M(e),bottom:M(e+n.height())}):V.none()})).each(function(n){t.dom().scrollTop=t.dom().scrollTop+n.top()}),a.start(0),o.refresh()})})},1e3),f=Dd(fe.fromDom(r),"scroll",function(){r.pageYOffset<0||s.throttle()});return bv(n,r.pageYOffset).get(h),{unbind:f.unbind}},xv=function(n){var t=n.cWin(),e=n.ceBody(),r=n.socket(),o=n.toolstrip(),i=n.toolbar(),u=n.contentElement(),c=n.keyboardType(),a=n.outerWindow(),s=n.dropup(),f=ov(r,e,o,s),l=c(n.outerBody(),t,ye(),u,o,i),d=Bd(a,{onChange:I,onReady:f.refresh});d.onAdjustment(function(){f.refresh()});var m=Dd(fe.fromDom(a),"resize",function(){f.isExpanding()&&f.refresh()}),g=yv(o,r,n.outerBody(),a,f,t),v=function(t,e){var n=t.document,r=fe.fromTag("div");oo(r,vi.resolve("unfocused-selections")),Ge(fe.fromDom(n.documentElement),r);var o=Dd(r,"touchstart",function(n){n.prevent(),Rg(t,e),u()}),i=function(n){var e=fe.fromTag("span");return gl(e,[vi.resolve("layer-editor"),vi.resolve("unfocused-selection")]),Ti(e,{left:n.left()+"px",top:n.top()+"px",width:n.width()+"px",height:n.height()+"px"}),e},u=function(){Ue(r)};return{update:function(){u();var n=sm(t),e=xn(n,i);_e(r,e)},isActive:function(){return 0<Pe(r).length},destroy:function(){o.unbind(),qe(r)},clear:u}}(t,u),p=function(){v.clear()};return{toEditing:function(){l.toEditing(),p()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch(n)},refreshSelection:function(){v.isActive()&&v.update()},clearSelection:p,highlightSelection:function(){v.update()},scrollIntoView:function(n,e){vv(t,r,s,n,e)},updateToolbarPadding:I,setViewportOffset:function(n){f.setViewportOffset(n),mv(r,n).get(h)},syncHeight:function(){Oi(u,"height",u.dom().contentWindow.document.body.scrollHeight+"px")},refreshStructure:f.refresh,destroy:function(){f.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),v.destroy(),Ag(ye(),yo)}}},wv=function(r,n){var o=Am(),i=Wf(),u=Wf(),c=$f(),a=$f();return{enter:function(){n.hide();var t=fe.fromDom(v.document);Tm.getActiveApi(r.editor).each(function(n){i.set({socketHeight:Ei(r.socket,"height"),iframeHeight:Ei(n.frame(),"height"),outerScroll:v.document.body.scrollTop}),u.set({exclusives:_m.exclusive(t,"."+ad.scrollable())}),oo(r.container,vi.resolve("fullscreen-maximized")),Im(r.container,n.body()),o.maximize(),Oi(r.socket,"overflow","scroll"),Oi(r.socket,"-webkit-overflow-scrolling","touch"),bo(n.body());var e=Ee(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);c.set(xv(e({cWin:n.win(),ceBody:n.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:n.frame(),cursor:I,outerBody:r.body,outerWindow:r.win,keyboardType:Fg.stubborn,isScrolling:function(){return u.get().exists(function(n){return n.socket.isScrolling()})}}))),c.run(function(n){n.syncHeight()}),a.set(Vg(n,c,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){c.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),a.clear(),c.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){Oi(r.socket,"height",n)}),n.iframeHeight.each(function(n){Oi(r.editor.getFrame(),"height",n)}),v.document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),io(r.container,vi.resolve("fullscreen-maximized")),Mm(),ad.deregister(r.toolbar),Di(r.socket,"overflow"),Di(r.socket,"-webkit-overflow-scrolling"),yo(r.editor.getFrame()),Tm.getActiveApi(r.editor).each(function(n){n.clearSelection()})}}},Sv=function(n){var e=Kt("Getting IosWebapp schema",Vm,n);Oi(e.toolstrip,"width","100%"),Oi(e.container,"position","relative");var t=El(Fm(function(){e.setReadOnly(e.readOnlyOnInit()),r.enter()},e.translate));e.alloy.add(t);var r=wv(e,{show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}});return{setReadOnly:e.setReadOnly,refreshStructure:r.refreshStructure,enter:r.enter,exit:r.exit,destroy:I}},Ov=tinymce.util.Tools.resolve("tinymce.EditorManager"),Tv=function(n){var e=wt(n.settings,"skin_url").fold(function(){return Ov.baseURL+"/skins/lightgray"},function(n){return n});return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}},kv=function(n,e,t){n.system().broadcastOn([ko.formatChanged()],{command:e,state:t})},Cv=function(r,n){var e=N(n.formatter.get());wn(e,function(e){n.formatter.formatChanged(e,function(n){kv(r,e,n)})}),wn(["ul","ol"],function(t){n.selection.selectorChanged(t,function(n,e){kv(r,t,n)})})},Ev=(M(["x-small","small","medium","large","x-large"]),function(n){var e=function(){n._skinLoaded=!0,n.fire("SkinLoaded")};return function(){n.initialized?e():n.on("init",e)}}),Dv=M("toReading"),Iv=M("toEditing");Oo.add("mobile",function(D){return{getNotificationManagerImpl:function(){return{open:M({progressBar:{value:I},close:I}),close:I,reposition:I,getArgs:h}},renderUI:function(n){var e=Tv(D);0==(!1===D.settings.skin)?(D.contentCSS.push(e.content),So.DOM.styleSheetLoader.load(e.ui,Ev(D))):Ev(D)();var t,r,o,i,u,c,a,s,f,l,d,m,g,v,p,h,b,y=function(){D.fire("scrollIntoView")},x=fe.fromTag("div"),w=Gn.detect().os.isAndroid()?(s=y,f=Mg({classes:[vi.resolve("android-container")]}),l=Um(),d=$f(),m=Km(d),g=Xm(),v=dg(I,s),f.add(l.wrapper()),f.add(g),f.add(v.component()),{system:M(f),element:f.element,init:function(n){d.set(Nm(n))},exit:function(){d.run(function(n){n.exit(),Ul.remove(g,m)})},setToolbarGroups:function(n){var e=l.createGroups(n);l.setGroups(e)},setContextToolbar:function(n){var e=l.createGroups(n);l.setContextToolbar(e)},focusToolbar:function(){l.focus()},restoreToolbar:function(){l.restoreToolbar()},updateMode:function(n){Jm(g,m,n,f.root())},socket:M(g),dropup:M(v)}):(t=y,r=Mg({classes:[vi.resolve("ios-container")]}),o=Um(),i=$f(),u=Km(i),c=Xm(),a=dg(function(){i.run(function(n){n.refreshStructure()})},t),r.add(o.wrapper()),r.add(c),r.add(a.component()),{system:M(r),element:r.element,init:function(n){i.set(Sv(n))},exit:function(){i.run(function(n){Ul.remove(c,u),n.exit()})},setToolbarGroups:function(n){var e=o.createGroups(n);o.setGroups(e)},setContextToolbar:function(n){var e=o.createGroups(n);o.setContextToolbar(e)},focusToolbar:function(){o.focus()},restoreToolbar:function(){o.restoreToolbar()},updateMode:function(n){Jm(c,u,n,r.root())},socket:M(c),dropup:M(a)}),S=fe.fromDom(n.targetNode);we("element","offset"),h=x,(b=(p=S).dom(),V.from(b.nextSibling).map(fe.fromDom)).fold(function(){Le(p).each(function(n){Ge(n,h)})},function(n){var e,t;t=h,Le(e=n).each(function(n){n.dom().insertBefore(t.dom(),e.dom())})}),function(n,e){Ge(n,e.element());var t=Pe(e.element());wn(t,function(n){e.getByDom(n).each(Ke)})}(x,w.system());var O=n.targetNode.ownerDocument.defaultView,T=Bd(O,{onChange:function(){w.system().broadcastOn([ko.orientationChanged()],{width:Rd(O)})},onReady:I}),k=function(n,e,t,r){!1===r&&D.selection.collapse();var o=C(n,e,t);w.setToolbarGroups(!0===r?o.readOnly:o.main),D.setMode(!0===r?"readonly":"design"),D.fire(!0===r?Dv():Iv()),w.updateMode(r)},C=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},E=function(n,e){return D.on(n,e),{unbind:function(){D.off(n)}}};return D.on("init",function(){w.init({editor:{getFrame:function(){return fe.fromDom(D.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:I}},onToReading:function(n){return E(Dv(),n)},onToEditing:function(n){return E(Iv(),n)},onScrollToCursor:function(e){return D.on("scrollIntoView",function(n){e(n)}),{unbind:function(){D.off("scrollIntoView"),T.destroy()}}},onTouchToolstrip:function(){t()},onTouchContent:function(){var n,e=fe.fromDom(D.editorContainer.querySelector("."+vi.resolve("toolbar")));(n=e,wo(n).bind(function(n){return w.system().getByDom(n).toOption()})).each(ue),w.restoreToolbar(),t()},onTapContent:function(n){var e=n.target();"img"===ge(e)?(D.selection.select(e.dom()),n.kill()):"a"===ge(e)&&w.system().getByDom(fe.fromDom(D.editorContainer)).each(function(n){lo.isAlpha(n)&&To(e.dom())})}},container:fe.fromDom(D.editorContainer),socket:fe.fromDom(D.contentAreaContainer),toolstrip:fe.fromDom(D.editorContainer.querySelector("."+vi.resolve("toolstrip"))),toolbar:fe.fromDom(D.editorContainer.querySelector("."+vi.resolve("toolbar"))),dropup:w.dropup(),alloy:w.system(),translate:I,setReadOnly:function(n){k(a,c,u,n)},readOnlyOnInit:function(){return!1}});var t=function(){w.dropup().disappear(function(){w.system().broadcastOn([ko.dropupDismissed()],{})})},n={label:"The first group",scrollable:!1,items:[Xa.forToolbar("back",function(){D.selection.collapse(),w.exit()},{})]},e={label:"Back to read only",scrollable:!1,items:[Xa.forToolbar("readonly-back",function(){k(a,c,u,!0)},{})]},r=Sd(w,D),o=Od(D.settings,r),i={label:"The extra group",scrollable:!1,items:[]},u=mo([{label:"the action group",scrollable:!0,items:o},i]),c=mo([{label:"The read only mode group",scrollable:!0,items:[]},i]),a=mo({backToMask:[n],backToReadOnly:[e]});Cv(w,D)}),D.on("remove",function(){w.exit()}),D.on("detach",function(){var e,n;e=w.system(),n=Pe(e.element()),wn(n,function(n){e.getByDom(n).each(Ye)}),qe(e.element()),w.system().destroy(),qe(x)}),{iframeContainer:w.socket().element().dom(),editorContainer:w.element().dom()}}}})}(window);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L446

Insecure DOM Manipulation (XSS) in js.js

CWE-79
File Location: lib/web/varien/js.js:446
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- this.advice.innerHTML = error.replace('%1', countDaysInMonth);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L420

Insecure DOM Manipulation (XSS) in angular-sanitize.js

CWE-79
File Location: setup/pub/angular-sanitize/angular-sanitize.js:420
Security Score:
74 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- html = inertBodyElement.innerHTML;
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L97

Insecure DOM Manipulation (XSS) in msrp.js

CWE-79
File Location: app/code/Magento/Msrp/view/base/web/js/msrp.js:97
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- $msrpPopup = $(popupDOM.innerHTML.trim());
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L283

Insecure DOM Manipulation (XSS) in rules.js

CWE-79
File Location: app/code/Magento/Rule/view/adminhtml/web/rules.js:283
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- label.innerHTML = str.escapeHTML();
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L1

Insecure DOM Manipulation (XSS) in swagger-ui-bundle.min.js

CWE-79
File Location: app/code/Magento/Swagger/view/frontend/web/swagger-ui/js/swagger-ui-bundle.min.js:1
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1213)}([function(e,t,n){"use strict";e.exports=n(92)},function(e,t,n){e.exports=n(996)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(592),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(565),o=r(i),a=n(330),s=r(a),u=n(48),l=r(u);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,l.default)(t)));e.prototype=(0,s.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(48),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,i.default)(t))&&"function"!=typeof t?e:t}},function(e,t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function t(e){return o(e)?e:O(e)}function n(e){return a(e)?e:M(e)}function r(e){return s(e)?e:T(e)}function i(e){return o(e)&&!u(e)?e:P(e)}function o(e){return!(!e||!e[ln])}function a(e){return!(!e||!e[cn])}function s(e){return!(!e||!e[pn])}function u(e){return a(e)||s(e)}function l(e){return!(!e||!e[fn])}function c(e){return e.value=!1,e}function p(e){e&&(e.value=!0)}function f(){}function h(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function d(e){return void 0===e.size&&(e.size=e.__iterate(v)),e.size}function m(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function j(e){this._iterable=e,this.size=e.length||e.size}function F(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new F(e).fromEntrySeq():E(e)?new j(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new F(e):E(e)?new j(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Dn)return Dn;Dn=this}}function ee(){throw TypeError("Abstract")}function te(){}function ne(){}function re(){}function ie(e){return e>>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>Fn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ie(t)}function ue(e){var t;if(In&&void 0!==(t=On.get(e)))return t;if(void 0!==(t=e[jn]))return t;if(!Pn){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[jn]))return t;if(void 0!==(t=le(e)))return t}if(t=++Rn,1073741824&Rn&&(Rn=0),In)On.set(e,t);else{if(void 0!==Tn&&!1===Tn(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Pn)Object.defineProperty(e,jn,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[jn]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[jn]=t}}return t}function le(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<<a|1<<s,a===s?[Ce(e,t,n+hn,r,i)]:(o=new ge(t,r,i),a<s?[e,o]:[o,e]))}function Ae(e,t,n,r){e||(e=new f);for(var i=new ge(e,oe(n),[n,r]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function De(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,u=1,l=t.length;s<l;s++,u<<=1){var c=t[s];void 0!==c&&s!==r&&(i|=u,a[o++]=c)}return new de(e,i,a)}function Oe(e,t,n,r,i){for(var o=0,a=new Array(dn),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a<r.length;a++){var s=r[a],u=n(s);o(s)||(u=u.map(function(e){return H(e)})),i.push(u)}return Ie(e,t,i)}function Te(e,t,n){return e&&e.mergeDeep&&o(t)?e.mergeDeep(t):X(e,t)?e:t}function Pe(e){return function(t,n,r){if(t&&t.mergeDeepWith&&o(n))return t.mergeDeepWith(e,n);var i=e(t,n,r);return X(t,i)?t:i}}function Ie(e,t,n){return n=n.filter(function(e){return 0!==e.size}),0===n.length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations(function(e){for(var r=t?function(n,r){e.update(r,vn,function(e){return e===vn?n:t(e,n,r)})}:function(t,n){e.set(n,t)},i=0;i<n.length;i++)n[i].forEach(r)}):e.constructor(n[0])}function Re(e,t,n,r){var i=e===vn,o=t.next();if(o.done){var a=i?n:e,s=r(a);return s===a?e:s}Z(i||e&&e.set,"invalid keyPath");var u=o.value,l=i?vn:e.get(u,vn),c=Re(l,t,n,r);return c===l?e:c===vn?e.remove(u):(i?we():e).set(u,c)}function je(e){return e-=e>>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Fe(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function Be(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a<r;a++)a===t&&(o=1),i[a]=e[a+o];return i}function Le(e){var t=Ve();if(null===e||void 0===e)return t;if(qe(e))return e;var n=r(e),i=n.size;return 0===i?t:(ce(i),i>0&&i<dn?We(0,i,hn,null,new ze(n.toArray())):t.withMutations(function(e){e.setSize(i),n.forEach(function(t,n){return e.set(n,t)})}))}function qe(e){return!(!e||!e[Gn])}function ze(e,t){this.array=e,this.ownerID=t}function Ue(e,t){function n(e,t,n){return 0===t?r(e,n):i(e,t,n)}function r(e,n){var r=n===s?u&&u.array:e&&e.array,i=n>o?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<<r))}}}var o=e._origin,a=e._capacity,s=$e(a),u=e._tail;return n(e._root,e._level,0)}function We(e,t,n,r,i,o,a){var s=Object.create(Jn);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function Ve(){return Kn||(Kn=We(0,0,hn))}function He(e,t,n){if((t=m(e,t))!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a<e.array.length;if(!s&&void 0===i)return e;var u;if(n>0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<<e._level+hn){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<<u;c&&(a+=c,i+=c,s+=c,o+=c);for(var p=$e(o),h=$e(s);h>=1<<u+hn;)l=new ze(l&&l.array.length?[l]:[],r),u+=hn;var d=e._tail,m=h<p?Ke(e,s-1):h>p?new ze([],r):d;if(d&&h>p&&a<o&&d.array.length){l=Je(l,r);for(var v=l,g=u;g>hn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s<o&&(m=m&&m.removeAfter(r,0,s)),a>=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h<p){for(c=0;l;){var _=a>>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<<u)*_),u-=hn,l=l.array[_]}l&&a>i&&(l=l.removeBefore(r,u,a-c)),l&&h<p&&(l=l.removeAfter(r,u,h-c)),c&&(a-=c,s-=c)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=u,e._root=l,e._tail=m,e.__hash=void 0,e.__altered=!0,e):We(a,s,u,l,m)}function Ye(e,t,n){for(var i=[],a=0,s=0;s<n.length;s++){var u=n[s],l=r(u);l.size>a&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e<dn?0:e-1>>>hn<<hn}function Ze(e){return null===e||void 0===e?tt():Qe(e)?e:tt().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function Qe(e){return fe(e)&&l(e)}function et(e,t,n,r){var i=Object.create(Ze.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i}function tt(){return Yn||(Yn=et(we(),Ve()))}function nt(e,t,n){var r,i,o=e._map,a=e._list,s=o.get(t),u=void 0!==s;if(n===vn){if(!u)return e;a.size>=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&t<s?e.get(t+o,n):n}),l.__iterateUncached=function(t,n){var i=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,u=!0,l=0;return e.__iterate(function(e,n){if(!u||!(u=a++<o))return l++,!1!==t(e,r?n:l-1,i)&&l!==s}),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var i=0!==s&&e.__iterator(t,n),a=0,u=0;return new x(function(){for(;a++<o;)i.next();if(++u>s)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l<t)&&o(e)?a(e,l+1):!1===r(e,n?i:s++,c)&&(u=!0),!u},i)}var s=0,u=!1;return a(e,0),s},r.__iteratorUncached=function(r,i){var a=e.__iterator(r,i),s=[],u=0;return new x(function(){for(;a;){var e=a.next();if(!1===e.done){var l=e.value;if(r===xn&&(l=l[1]),t&&!(s.length<t)||!o(l))return n?e:w(r,u++,l,e);s.push(a),a=l.__iterator(r,i)}else a=s.pop()}return k()})},r}function yt(e,t,n){var r=At(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}function _t(e,t){var n=Dt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return e.__iterate(function(e,r){return(!o||!1!==n(t,o++,i))&&!1!==n(e,o++,i)},r),o},n.__iteratorUncached=function(n,r){var i,o=e.__iterator(bn,r),a=0;return new x(function(){return(!i||a%2)&&(i=o.next(),i.done)?i:a%2?w(n,a++,t):w(n,a++,i.value,i)})},n}function bt(e,t,n){t||(t=Mt);var r=a(e),i=0,o=e.toSeq().map(function(t,r){return[r,t,i++,n?n(t,r,e):t]}).toArray();return o.sort(function(e,n){return t(e[3],n[3])||e[2]-n[2]}).forEach(r?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),r?M(o):s(e)?T(o):P(o)}function xt(e,t,n){if(t||(t=Mt),n){var r=e.toSeq().map(function(t,r){return[t,n(t,r,e)]}).reduce(function(e,n){return wt(t,e[1],n[1])?n:e});return r&&r[0]}return e.reduce(function(e,n){return wt(t,e,n)?n:e})}function wt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(void 0===n||null===n||n!==n)||r>0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:e<t?-1:0}function Tt(e){var n=C(e);if(!n){if(!D(e))throw new TypeError("Expected iterable or array-like: "+e);n=C(t(e))}return n}function Pt(e,t){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var a=Object.keys(e);jt(i,a),i.size=a.length,i._name=t,i._keys=a,i._defaultValues=e}this._map=pe(o)},i=r.prototype=Object.create($n);return i.constructor=r,r}function It(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function Rt(e){return e._name||e.constructor.name||"Record"}function jt(e,t){try{t.forEach(Ft.bind(void 0,e))}catch(e){}}function Ft(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function Nt(e){return null===e||void 0===e?zt():Bt(e)&&!l(e)?e:zt().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Bt(e){return!(!e||!e[Zn])}function Lt(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function qt(e,t){var n=Object.create(Qn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function zt(){return er||(er=qt(we()))}function Ut(e){return null===e||void 0===e?Ht():Wt(e)?e:Ht().withMutations(function(t){var n=i(e);ce(n.size),n.forEach(function(e){return t.add(e)})})}function Wt(e){return Bt(e)&&l(e)}function Vt(e,t){var n=Object.create(tr);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Ht(){return nr||(nr=Vt(tt()))}function Gt(e){return null===e||void 0===e?Xt():Jt(e)?e:Xt().unshiftAll(e)}function Jt(e){return!(!e||!e[rr])}function Kt(e,t,n,r){var i=Object.create(ir);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xt(){return or||(or=Kt(0))}function Yt(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function $t(e,t){return t}function Zt(e,t){return[t,e]}function Qt(e){return function(){return!e.apply(this,arguments)}}function en(e){return function(){return-e.apply(this,arguments)}}function tn(e){return"string"==typeof e?JSON.stringify(e):String(e)}function nn(){return h(arguments)}function rn(e,t){return e<t?1:e>t?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<<hn,mn=dn-1,vn={},gn={value:!1},yn={value:!1},_n=0,bn=1,xn=2,wn="function"==typeof Symbol&&Symbol.iterator,kn="@@iterator",En=wn||kn;x.prototype.toString=function(){return"[Iterator]"},x.KEYS=_n,x.VALUES=bn,x.ENTRIES=xn,x.prototype.inspect=x.prototype.toSource=function(){return this.toString()},x.prototype[En]=function(){return this},e(O,t),O.of=function(){return O(arguments)},O.prototype.toSeq=function(){return this},O.prototype.toString=function(){return this.__toString("Seq {","}")},O.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},O.prototype.__iterate=function(e,t){return W(this,e,t,!0)},O.prototype.__iterator=function(e,t){return V(this,e,t,!0)},e(M,O),M.prototype.toKeyedSeq=function(){return this},e(T,O),T.of=function(){return T(arguments)},T.prototype.toIndexedSeq=function(){return this},T.prototype.toString=function(){return this.__toString("Seq [","]")},T.prototype.__iterate=function(e,t){return W(this,e,t,!1)},T.prototype.__iterator=function(e,t){return V(this,e,t,!1)},e(P,O),P.of=function(){return P(arguments)},P.prototype.toSetSeq=function(){return this},O.isSeq=N,O.Keyed=M,O.Set=P,O.Indexed=T;var Sn="@@__IMMUTABLE_SEQ__@@";O.prototype[Sn]=!0,e(I,T),I.prototype.get=function(e,t){return this.has(e)?this._array[m(this,e)]:t},I.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,i=0;i<=r;i++)if(!1===e(n[t?r-i:i],i,this))return i+1;return i},I.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,i=0;return new x(function(){return i>r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},j.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(!1===e(r[i],i++,this))return i;for(var o;!(o=n.next()).done;){var a=o.value;if(r[i]=a,!1===e(a,i++,this))break}return i},F.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,i=0;return new x(function(){if(i>=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},$.prototype.__iterator=function(e,t){var n=this,r=0;return new x(function(){return r<n.size?w(e,r++,n._value):k()})},$.prototype.equals=function(e){return e instanceof $?X(this._value,e._value):Y(e)};var An;e(Q,T),Q.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},Q.prototype.get=function(e,t){return this.has(e)?this._start+m(this,e)*this._step:t},Q.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},Q.prototype.slice=function(e,t){return g(e,t,this.size)?this:(e=y(e,this.size),t=_(t,this.size),t<=e?new Q(0,0):new Q(this.get(e,this._end),this.get(t,this._end),this._step))},Q.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},Q.prototype.lastIndexOf=function(e){return this.indexOf(e)},Q.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;o<=n;o++){if(!1===e(i,o,this))return o+1;i+=t?-r:r}return o},Q.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,i=t?this._start+n*r:this._start,o=0;return new x(function(){var a=i;return i+=t?-r:r,o>n?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,jn="__immutablehash__";"function"==typeof Symbol&&(jn=Symbol(jn));var Fn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n<e.length;n+=2){if(n+1>=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},he.prototype.update=function(e,t,n,r,i,o,a){for(var s=i===vn,u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),!s||1!==u.length){if(!f&&!s&&u.length>=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[je(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<<s,l=this.bitmap,c=0!=(l&u);if(!c&&i===vn)return this;var p=je(l&u-1),f=this.nodes,h=c?f[p]:void 0,d=Ee(h,e,t+hn,n,r,i,o,a);if(d===h)return this;if(!c&&d&&f.length>=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?Fe(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f<Hn)return De(e,l,f,s)}else f++;var h=e&&e===this.ownerID,d=Fe(l,s,p,h);return h?(this.count=f,this.nodes=d,this):new me(e,f,d)},ve.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(X(n,i[o][0]))return i[o][1];return r},ve.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=i===vn;if(n!==this.keyHash)return s?this:(p(a),p(o),Ce(this,e,t,n,[r,i]));for(var u=this.entries,l=0,c=u.length;l<c&&!X(r,u[l][0]);l++);var f=l<c;if(f?u[l][1]===i:s)return this;if(p(a),(s||!f)&&p(o),s&&2===c)return new ge(e,this.keyHash,u[1^l]);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new ve(e,this.keyHash,m)},ge.prototype.get=function(e,t,n,r){return X(n,this.entry[0])?this.entry[1]:r},ge.prototype.update=function(e,t,n,r,i,o,a){var s=i===vn,u=X(r,this.entry[0]);return(u?i===this.entry[1]:s)?this:(p(a),s?void p(o):u?e&&e===this.ownerID?(this.entry[1]=i,this):new ge(e,this.keyHash,[r,i]):(p(o),Ce(this,e,t,oe(r),[r,i])))},he.prototype.iterate=ve.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(!1===e(n[t?i-r:r]))return!1},de.prototype.iterate=me.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&!1===o.iterate(e,t))return!1}},ge.prototype.iterate=function(e,t){return e(this.entry)},e(ye,x),ye.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,i=t.index++;if(r.entry){if(0===i)return _e(e,r.entry)}else if(r.entries){if(n=r.entries.length-1,i<=n)return _e(e,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,i<=n){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return _e(e,o.entry);t=this._stack=be(o,t)}continue}t=this._stack=this._stack.__prev}return k()};var Un,Wn=dn/4,Vn=dn/2,Hn=dn/4;e(Le,ne),Le.of=function(){return this(arguments)},Le.prototype.toString=function(){return this.__toString("List [","]")},Le.prototype.get=function(e,t){if((e=m(this,e))>=0&&e<this.size){e+=this._origin;var n=Ke(this,e);return n&&n.array[e&mn]}return t},Le.prototype.set=function(e,t){return He(this,e,t)},Le.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},Le.prototype.insert=function(e,t){return this.splice(e,0,t)},Le.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=hn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ve()},Le.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations(function(n){Xe(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])})},Le.prototype.pop=function(){return Xe(this,0,-1)},Le.prototype.unshift=function(){var e=arguments;return this.withMutations(function(t){Xe(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])})},Le.prototype.shift=function(){return Xe(this,1)},Le.prototype.merge=function(){return Ye(this,void 0,arguments)},Le.prototype.mergeWith=function(e){return Ye(this,e,un.call(arguments,1))},Le.prototype.mergeDeep=function(){return Ye(this,Te,arguments)},Le.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Ye(this,Pe(e),t)},Le.prototype.setSize=function(e){return Xe(this,0,e)},Le.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:Xe(this,y(e,n),_(t,n))},Le.prototype.__iterator=function(e,t){var n=0,r=Ue(this,t);return new x(function(){var t=r();return t===Xn?k():w(e,n++,t)})},Le.prototype.__iterate=function(e,t){for(var n,r=0,i=Ue(this,t);(n=i())!==Xn&&!1!==e(n,r++,this););return r},Le.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?We(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},Le.isList=qe;var Gn="@@__IMMUTABLE_LIST__@@",Jn=Le.prototype;Jn[Gn]=!0,Jn.delete=Jn.remove,Jn.setIn=zn.setIn,Jn.deleteIn=Jn.removeIn=zn.removeIn,Jn.update=zn.update,Jn.updateIn=zn.updateIn,Jn.mergeIn=zn.mergeIn,Jn.mergeDeepIn=zn.mergeDeepIn,Jn.withMutations=zn.withMutations,Jn.asMutable=zn.asMutable,Jn.asImmutable=zn.asImmutable,Jn.wasAltered=zn.wasAltered,ze.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u<r;u++)s.array[u]=void 0;return i&&(s.array[r]=i),s},ze.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r=n-1>>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n<e.length;n++)i(e[n]).forEach(function(e){return t.add(e)})}):this.constructor(e[0])},Nt.prototype.intersect=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.every(function(e){return e.includes(t)})||n.remove(t)})})},Nt.prototype.subtract=function(){var e=un.call(arguments,0);if(0===e.length)return this;e=e.map(function(e){return i(e)});var t=this;return this.withMutations(function(n){t.forEach(function(t){e.some(function(e){return e.includes(t)})&&n.remove(t)})})},Nt.prototype.merge=function(){return this.union.apply(this,arguments)},Nt.prototype.mergeWith=function(e){var t=un.call(arguments,1);return this.union.apply(this,t)},Nt.prototype.sort=function(e){return Ut(bt(this,e))},Nt.prototype.sortBy=function(e,t){return Ut(bt(this,t,e))},Nt.prototype.wasAltered=function(){return this._map.wasAltered()},Nt.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate(function(t,r){return e(r,r,n)},t)},Nt.prototype.__iterator=function(e,t){return this._map.map(function(e,t){return t}).__iterator(e,t)},Nt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},Nt.isSet=Bt;var Zn="@@__IMMUTABLE_SET__@@",Qn=Nt.prototype;Qn[Zn]=!0,Qn.delete=Qn.remove,Qn.mergeDeep=Qn.merge,Qn.mergeDeepWith=Qn.mergeWith,Qn.withMutations=zn.withMutations,Qn.asMutable=zn.asMutable,Qn.asImmutable=zn.asImmutable,Qn.__empty=zt,Qn.__make=qt;var er;e(Ut,Nt),Ut.of=function(){return this(arguments)},Ut.fromKeys=function(e){return this(n(e).keySeq())},Ut.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ut.isOrderedSet=Wt;var tr=Ut.prototype;tr[fn]=!0,tr.__empty=Ht,tr.__make=Vt;var nr;e(Gt,ne),Gt.of=function(){return this(arguments)},Gt.prototype.toString=function(){return this.__toString("Stack [","]")},Gt.prototype.get=function(e,t){var n=this._head;for(e=m(this,e);n&&e--;)n=n.next;return n?n.value:t},Gt.prototype.peek=function(){return this._head&&this._head.value},Gt.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Et(this,_t(this,e))},interleave:function(){var e=[this].concat(h(arguments)),t=kt(this.toSeq(),T.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Et(this,n)},keySeq:function(){return Q(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Et(this,mt(this,e,t,!1))},zip:function(){return Et(this,kt(this,nn,[this].concat(h(arguments))))},zipWith:function(e){var t=h(arguments);return t[0]=this,Et(this,kt(this,e,t))}}),r.prototype[pn]=!0,r.prototype[fn]=!0,Yt(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=ar.includes,i.prototype.contains=i.prototype.includes,Yt(M,n.prototype),Yt(T,r.prototype),Yt(P,i.prototype),Yt(te,n.prototype),Yt(ne,r.prototype),Yt(re,i.prototype),{Iterable:t,Seq:O,Collection:ee,Map:pe,OrderedMap:Ze,List:Le,Stack:Gt,Set:Nt,OrderedSet:Ut,Record:Pt,Range:Q,Repeat:$,is:X,fromJS:H}})},function(e,t,n){"use strict";function r(e,t,n,r,o,a,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};e.exports=r},function(e,t,n){"use strict";(function(e){function r(e){return e&&e.__esModule?e:{default:e}}function i(e){try{var t=JSON.parse(e);if(t&&"object"===(void 0===t?"undefined":(0,N.default)(t)))return t}catch(e){}return!1}function o(e){return p(e)?oe(e)?e.toObject():e:{}}function a(e){return e?e.toArray?e.toArray():l(e):[]}function s(e){return oe(e)?e:e instanceof te.default.File?e:p(e)?Array.isArray(e)?L.default.Seq(e).map(s).toList():L.default.OrderedMap(e).map(s):e}function u(e,t){var n={};return(0,j.default)(e).filter(function(t){return"function"==typeof e[t]}).forEach(function(r){return n[r]=e[r].bind(null,t)}),n}function l(e){return Array.isArray(e)?e:[e]}function c(e){return"function"==typeof e}function p(e){return!!e&&"object"===(void 0===e?"undefined":(0,N.default)(e))}function f(e){return"function"==typeof e}function h(e){return Array.isArray(e)}function d(e,t){return(0,j.default)(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})}function m(e,t){return(0,j.default)(e).reduce(function(n,r){var i=t(e[r],r);return i&&"object"===(void 0===i?"undefined":(0,N.default)(i))&&(0,I.default)(n,i),n},{})}function v(e){return function(t){t.dispatch,t.getState;return function(t){return function(n){return"function"==typeof n?n(e()):t(n)}}}}function g(e){var t=e.keySeq();return t.contains(ie)?ie:t.filter(function(e){return"2"===(e+"")[0]}).sort().first()}function y(e,t){if(!L.default.Iterable.isIterable(e))return L.default.List();var n=e.getIn(Array.isArray(t)?t:[t]);return L.default.List.isList(n)?n:L.default.List()}function _(e){var t=document;if(!e)return"";if(e.textContent.length>5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: bold;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,j.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(35),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(30),I=r(P),R=n(47),j=r(R),F=n(48),N=r(F);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(506),z=n(940),U=r(z),W=n(428),V=r(W),H=n(425),G=r(H),J=n(223),K=r(J),X=n(955),Y=r(X),$=n(120),Z=r($),Q=n(172),ee=n(46),te=r(ee),ne=n(697),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,j.default)(e).length!==(0,j.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(e<t)return"Value must be greater than Minimum"},ue=t.validateNumber=function(e){if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"},le=t.validateInteger=function(e){if(!/^-?\d+$/.test(e))return"Value must be an integer"},ce=t.validateFile=function(e){if(e&&!(e instanceof te.default.File))return"Value must be a file"},pe=t.validateBoolean=function(e){if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"},fe=t.validateString=function(e){if(e&&"string"!=typeof e)return"Value must be a string"},he=t.validateDateTime=function(e){if(isNaN(Date.parse(e)))return"Value must be a DateTime"},de=t.validateGuid=function(e){if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"},me=t.validateMaxLength=function(e,t){if(e.length>t)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length<t)return"Value must be greater than MinLength"},ge=t.validatePattern=function(e,t){if(!new RegExp(t).test(e))return"Value must follow pattern "+t},ye=(t.validateParam=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'<?xml version="1.0" encoding="UTF-8"?>\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(40).Buffer)},function(e,t,n){"use strict";var r=n(32),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var i=new Error(n);throw i.name="Invariant Violation",i.framesToPop=1,i}e.exports=r},function(e,t,n){"use strict";function r(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":e instanceof b.Iterable?"Immutable."+e.toSource().split(" ")[0]:t}function i(e){function t(t,n,r,i,o,a){for(var s=arguments.length,u=Array(s>6?s-6:0),l=6;l<s;l++)u[l-6]=arguments[l];if(a=a||r,i=i||x,null!=n[r])return e.apply(void 0,[n,r,i,o,a].concat(u));var c=o;return t?new Error("Required "+c+" `"+a+"` was not specified in `"+i+"`."):void 0}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e,t){function n(n,i,o,a,s){var u=n[i];if(!t(u)){var l=r(u);return new Error("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+o+"`, expected `"+e+"`.")}return null}return i(n)}function a(e,t,n){function o(i,o,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=i[o];if(!n(f)){var h=s,d=r(f);return new Error("Invalid "+h+" `"+u+"` of type `"+d+"` supplied to `"+a+"`, expected an Immutable.js "+t+".")}if("function"!=typeof e)return new Error("Invalid typeChecker supplied to `"+a+"` for propType `"+u+"`, expected a function.");for(var m=f.toArray(),v=0,g=m.length;v<g;v++){var y=e.apply(void 0,[m,v,a,s,u+"["+v+"]"].concat(c));if(y instanceof Error)return y}}return i(o)}function s(e){function t(t,n,r,i,o){for(var a=arguments.length,s=Array(a>5?a-5:0),u=5;u<a;u++)s[u-5]=arguments[u];var l=t[n];if("function"!=typeof e)return new Error("Invalid keysTypeChecker (optional second argument) supplied to `"+r+"` for propType `"+o+"`, expected a function.");for(var c=l.keySeq().toArray(),p=0,f=c.length;p<f;p++){var h=e.apply(void 0,[c,p,r,i,o+" -> key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u<i;u++)o[u]=arguments[u];return a(e,n,r).apply(void 0,o)||t&&s(t).apply(void 0,o)}return i(o)}function c(e,t){return l(e,t,"Map",b.Map.isMap)}function p(e,t){return l(e,t,"OrderedMap",b.OrderedMap.isOrderedMap)}function f(e){return a(e,"Set",b.Set.isSet)}function h(e){return a(e,"OrderedSet",b.OrderedSet.isOrderedSet)}function d(e){return a(e,"Stack",b.Stack.isStack)}function m(e){return a(e,"Iterable",b.Iterable.isIterable)}function v(e){function t(t,n,i,o,a){for(var s=arguments.length,u=Array(s>5?s-5:0),l=5;l<s;l++)u[l-5]=arguments[l];var c=t[n];if(!(c instanceof b.Record)){var p=r(c),f=o;return new Error("Invalid "+f+" `"+a+"` of type `"+p+"` supplied to `"+i+"`, expected an Immutable.js Record.")}for(var h in e){var d=e[h];if(d){var m=c.toObject(),v=d.apply(void 0,[m,h,i,o,a+"."+h].concat(u));if(v)return v}}}return i(t)}function g(e){function t(t,i,a,s,u){for(var l=arguments.length,c=Array(l>5?l-5:0),p=5;p<l;p++)c[p-5]=arguments[p];var f=t[i];if(!o(f)){var h=r(f),d=s;return new Error("Invalid "+d+" `"+u+"` of type `"+h+"` supplied to `"+a+"`, expected an Immutable.js "+n+".")}var m=f.toObject();for(var v in e){var g=e[v];if(g){var y=g.apply(void 0,[m,v,a,s,u+"."+v].concat(c));if(y)return y}}}var n=void 0===arguments[1]?"Iterable":arguments[1],o=void 0===arguments[2]?b.Iterable.isIterable:arguments[2];return i(t)}function y(e){return g(e)}function _(e){return g(e,"Map",b.Map.isMap)}var b=n(7),x="<<anonymous>>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output
L2428

Insecure DOM Manipulation (XSS) in Editor.js

CWE-79
File Location: app/code/Magento/Tinymce3/view/base/web/tiny_mce/classes/Editor.js:2428
Security Score:
73 / 100
Needs Audit

Rule Engine Warning

Detected insecure pattern matching known vulnerability signatures. Medium Confidence (Fuzzy matcher overlap - minor review required). Please apply remediation steps matching the recommended patch format below.

Heuristics Diff
- h = t.setContent(is(e.value) ? e.value : e.innerHTML, o);
+ element.textContent = data; // Or use DOMPurify to sanitize HTML output