/*! For license information please see community.bundle.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.TFWeb=t(require("react"),require("react-dom")):e.TFWeb=t(e.React,e.ReactDOM)}(this,((e,t)=>(()=>{var n={2805:(e,t,n)=>{function r(e){return r="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},r(e)}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";var o=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}}(),i=n(1),a=c(i),s=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==r(t)&&"function"!=typeof t?e:t}(this,Object.getPrototypeOf(t).call(this,e));return n.onDocMouseTouchMove=n.onDocMouseTouchMove.bind(n),n.onDocMouseTouchEnd=n.onDocMouseTouchEnd.bind(n),n.onImageLoad=n.onImageLoad.bind(n),n.onComponentMouseTouchDown=n.onComponentMouseTouchDown.bind(n),n.onComponentKeyDown=n.onComponentKeyDown.bind(n),n.onCropMouseTouchDown=n.onCropMouseTouchDown.bind(n),n.state={crop:n.nextCropState(n.props.crop),polygonId:n.getRandomInt(1,9e5)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+r(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,e),o(t,[{key:"componentDidMount",value:function(){if(document.addEventListener("mousemove",this.onDocMouseTouchMove),document.addEventListener("touchmove",this.onDocMouseTouchMove),document.addEventListener("mouseup",this.onDocMouseTouchEnd),document.addEventListener("touchend",this.onDocMouseTouchEnd),document.addEventListener("touchcancel",this.onDocMouseTouchEnd),this.imageRef.complete||this.imageRef.readyState)if(0===this.imageRef.naturalWidth){var e=this.imageRef.src;this.imageRef.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.imageRef.src=e}else this.onImageLoad(this.imageRef)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(e.crop){var t=this.nextCropState(e.crop);t.aspect&&(t=this.ensureAspectDimensions(t,this.imageRef)),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onDocMouseTouchMove),document.removeEventListener("touchmove",this.onDocMouseTouchMove),document.removeEventListener("mouseup",this.onDocMouseTouchEnd),document.removeEventListener("touchend",this.onDocMouseTouchEnd),document.removeEventListener("touchcancel",this.onDocMouseTouchEnd)}},{key:"onDocMouseTouchMove",value:function(e){if(!this.props.disabled&&this.mouseDownOnCrop){e.preventDefault();var t=this.state.crop,n=this.evData,r=this.getClientPos(e);n.isResize&&t.aspect&&n.cropOffset&&(r.y=this.straightenYPath(r.x));var o=r.x-n.clientStartX;n.xDiffPc=o/n.imageWidth*100;var i=r.y-n.clientStartY;n.yDiffPc=i/n.imageHeight*100,n.isResize?this.resizeCrop():this.dragCrop(),this.cropInvalid=!1,this.props.onChange&&this.props.onChange(t,this.getPixelCrop(t)),this.setState({crop:t})}}},{key:"onCropMouseTouchDown",value:function(e){if(!this.props.disabled){e.preventDefault();var t=this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=e.target.dataset.ord,o="nw"===r||"w"===r||"sw"===r,i="nw"===r||"n"===r||"ne"===r,a=void 0;t.aspect&&(a=this.getElementOffset(this.cropSelectRef)),this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:o?t.x+t.width:t.x,cropStartY:i?t.y+t.height:t.y,xInversed:o,yInversed:i,xCrossOver:o,yCrossOver:i,startXCrossOver:o,startYCrossOver:i,isResize:e.target!==this.cropSelectRef,ord:r,cropOffset:a},this.mouseDownOnCrop=!0}}},{key:"onComponentMouseTouchDown",value:function(e){if((e.target===this.imageCopyRef||e.target===this.cropWrapperRef)&&!this.props.disabled){e.preventDefault();var t=!0===this.props.keepSelection?{}:this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=this.getElementOffset(this.imageRef),o=(n.x-r.left)/this.imageRef.width*100,i=(n.y-r.top)/this.imageRef.height*100;t.x=o,t.y=i,t.width=0,t.height=0,this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:t.x,cropStartY:t.y,xInversed:!1,yInversed:!1,xCrossOver:!1,yCrossOver:!1,startXCrossOver:!1,startYCrossOver:!1,isResize:!0,ord:"nw"},this.mouseDownOnCrop=!0,this.setState({newCropIsBeingDrawn:!0})}}},{key:"onComponentKeyDown",value:function(e){var n=this;if(!this.props.disabled){var r=e.which,o=this.state.crop,i=!1;o.width&&o.height&&(r===t.arrowKey.left?(o.x-=t.nudgeStep,i=!0):r===t.arrowKey.right?(o.x+=t.nudgeStep,i=!0):r===t.arrowKey.up?(o.y-=t.nudgeStep,i=!0):r===t.arrowKey.down&&(o.y+=t.nudgeStep,i=!0),i&&(e.preventDefault(),o.x=this.clamp(o.x,0,100-o.width),o.y=this.clamp(o.y,0,100-o.height),this.setState({crop:o},(function(){n.props.onChange&&n.props.onChange(o,n.getPixelCrop(o)),n.props.onComplete&&n.props.onComplete(o,n.getPixelCrop(o))}))))}}},{key:"onDocMouseTouchEnd",value:function(){if(!this.props.disabled&&this.mouseDownOnCrop){var e=this.state.crop;this.cropInvalid=this.isCropInvalid(e),this.mouseDownOnCrop=!1,this.props.onComplete&&this.props.onComplete(e,this.getPixelCrop(e)),this.setState({newCropIsBeingDrawn:!1})}}},{key:"getPixelCrop",value:function(e){return{x:Math.round(this.imageRef.naturalWidth*(e.x/100)),y:Math.round(this.imageRef.naturalHeight*(e.y/100)),width:Math.round(this.imageRef.naturalWidth*(e.width/100)),height:Math.round(this.imageRef.naturalHeight*(e.height/100))}}},{key:"getPolygonValues",value:function(e){var t=this.state.crop,n=[t.x,t.y],r=[t.x+t.width,t.y],o=[t.x,t.y+t.height],i=[t.x+t.width,t.y+t.height];return e?(n=this.arrayDividedBy100(n),r=this.arrayDividedBy100(r),o=this.arrayDividedBy100(o),i=this.arrayDividedBy100(i)):(n=this.arrayToPercent(n),r=this.arrayToPercent(r),o=this.arrayToPercent(o),i=this.arrayToPercent(i)),{top:{left:n,right:r},bottom:{left:o,right:i}}}},{key:"getCropStyle",value:function(){return{top:this.state.crop.y+"%",left:this.state.crop.x+"%",width:this.state.crop.width+"%",height:this.state.crop.height+"%"}}},{key:"getEllipseValues",value:function(e){var t=this.state.crop,n=t.width/2,r=t.height/2,o=t.x+n,i=t.y+r;return e?(n/=100,r/=100,o/=100,i/=100):(n+="%",r+="%",o+="%",i+="%"),{cx:o,cy:i,rx:n,ry:r}}},{key:"getPolygonClipPath",value:function(){var e=this.getPolygonValues(),t=e.top,n=e.bottom;return"polygon("+t.left+", "+t.right+", "+n.right+", "+n.left+")"}},{key:"getEllipseClipPath",value:function(){var e=this.getEllipseValues();return"ellipse("+e.rx+" "+e.ry+" at "+e.cx+" "+e.cy+")"}},{key:"getElementOffset",value:function(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+window.pageYOffset-n.clientTop,left:t.left+window.pageXOffset-n.clientLeft}}},{key:"getClientPos",value:function(e){var t=void 0,n=void 0;return e.touches?(t=e.touches[0].pageX,n=e.touches[0].pageY):(t=e.pageX,n=e.pageY),{x:t,y:n}}},{key:"getNewSize",value:function(){var e=this.state.crop,t=this.evData,n=t.imageWidth/t.imageHeight,r=t.cropStartWidth+t.xDiffPc;t.xCrossOver&&(r=Math.abs(r));var o=this.props.maxWidth;this.state.newCropIsBeingDrawn||(o=["nw","w","sw"].indexOf(t.inversedXOrd||t.ord)>-1?t.cropStartX:100-t.cropStartX,o=this.clamp(o,100,this.props.maxWidth)),r=this.clamp(r,this.props.minWidth||0,o);var i=void 0;i=e.aspect?r/e.aspect*n:t.cropStartHeight+t.yDiffPc,t.yCrossOver&&(i=Math.min(Math.abs(i),t.cropStartY));var a=this.props.maxHeight;return this.state.newCropIsBeingDrawn||(a=["nw","n","ne"].indexOf(t.inversedYOrd||t.ord)>-1?t.cropStartY:100-t.cropStartY,a=this.clamp(a,100,this.props.maxHeight)),i=this.clamp(i,this.props.minHeight||0,a),e.aspect&&(r=this.clamp(i*e.aspect/n,0,100)),{width:r,height:i}}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"getPolygonId",value:function(){return"ReactCropClipPolygon-"+this.state.polygonId}},{key:"dragCrop",value:function(){var e=this.state.crop,t=this.evData;e.x=this.clamp(t.cropStartX+t.xDiffPc,0,100-e.width),e.y=this.clamp(t.cropStartY+t.yDiffPc,0,100-e.height)}},{key:"resizeCrop",value:function(){var e=this.state.crop,n=this.evData,r=n.ord;n.xInversed&&(n.xDiffPc-=2*n.cropStartWidth),n.yInversed&&(n.yDiffPc-=2*n.cropStartHeight);var o=this.getNewSize(),i=n.cropStartX,a=n.cropStartY;n.xCrossOver&&(i=e.x+(e.width-o.width)),n.yCrossOver&&(a=!1===n.lastYCrossover?e.y-o.height:e.y+(e.height-o.height)),e.x=this.clamp(i,0,100-o.width),e.y=this.clamp(a,0,100-o.height),e.aspect||t.xyOrds.indexOf(r)>-1?(e.width=o.width,e.height=o.height):t.xOrds.indexOf(r)>-1?e.width=o.width:t.yOrds.indexOf(r)>-1&&(e.height=o.height),n.lastYCrossover=n.yCrossOver,this.crossOverCheck()}},{key:"straightenYPath",value:function(e){var t=this.evData,n=t.ord,r=t.cropOffset,o=t.cropStartWidth/100*t.imageWidth,i=t.cropStartHeight/100*t.imageHeight,a=void 0,s=void 0;return"nw"===n||"se"===n?(a=i/o,s=r.top-r.left*a):(a=-i/o,s=r.top+(i-r.left*a)),a*e+s}},{key:"onImageLoad",value:function(e){var t=this.state.crop;t.aspect&&(t=this.ensureAspectDimensions(t,e),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})),this.props.onImageLoaded&&this.props.onImageLoaded(t,e,this.getPixelCrop(t))}},{key:"arrayDividedBy100",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e/100})).join(t)}},{key:"arrayToPercent",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e+"%"})).join(t)}},{key:"createCropSelection",value:function(){var e=this,t=this.getCropStyle(),n=this.state.crop.aspect,r=this.props.ellipse;return a.default.createElement("div",{ref:function(t){e.cropSelectRef=t},style:t,className:"ReactCrop--crop-selection",onMouseDown:this.onCropMouseTouchDown,onTouchStart:this.onCropMouseTouchDown},a.default.createElement("div",{className:"ReactCrop--drag-bar ord-n","data-ord":"n"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-e","data-ord":"e"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-s","data-ord":"s"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-w","data-ord":"w"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-nw","data-ord":"nw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-n","data-ord":"n"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-ne","data-ord":"ne"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-e","data-ord":"e"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-se","data-ord":"se"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-s","data-ord":"s"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-sw","data-ord":"sw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-w","data-ord":"w"}))}},{key:"isCropInvalid",value:function(e){return!e.width||!e.height}},{key:"nextCropState",value:function(e){var n=(0,s.default)({},t.defaultCrop,e);return this.cropInvalid=this.isCropInvalid(n),n}},{key:"clamp",value:function(e,t,n){return Math.min(Math.max(e,t),n)}},{key:"crossOverCheck",value:function(){var e=this.evData;(!e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc>=0||e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc<=0)&&(e.xCrossOver=!e.xCrossOver),(!e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc>=0||e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc<=0)&&(e.yCrossOver=!e.yCrossOver);var t=e.xCrossOver!==e.startXCrossOver,n=e.yCrossOver!==e.startYCrossOver;e.inversedXOrd=!!t&&this.inverseOrd(e.ord),e.inversedYOrd=!!n&&this.inverseOrd(e.ord)}},{key:"inverseOrd",value:function(e){var t=void 0;return"n"===e?t="s":"ne"===e?t="sw":"e"===e?t="w":"se"===e?t="nw":"s"===e?t="n":"sw"===e?t="ne":"w"===e?t="e":"nw"===e&&(t="se"),t}},{key:"ensureAspectDimensions",value:function(e,t){var n=t.naturalWidth/t.naturalHeight,r=(0,s.default)({},e);return r.width?r.height=r.width/r.aspect*n:r.height&&(r.width=r.height*r.aspect/n),r.y+r.height>100&&(r.height=100-r.y,r.width=r.height*r.aspect/n),r.x+r.width>100&&(r.width=100-r.x,r.height=r.width/r.aspect*n),r}},{key:"renderSvg",value:function(){var e=void 0;if(this.props.ellipse)e=a.default.createElement("ellipse",this.getEllipseValues(!0));else{var t=this.getPolygonValues(!0),n=t.top,r=t.bottom;e=a.default.createElement("polygon",{points:n.left+", "+n.right+", "+r.right+", "+r.left})}return a.default.createElement("svg",{width:"0",height:"0",style:{position:"absolute"}},a.default.createElement("defs",null,a.default.createElement("clipPath",{id:this.getPolygonId(),clipPathUnits:"objectBoundingBox"},e)))}},{key:"render",value:function(){var e=this,t=void 0,n=void 0;this.cropInvalid||(t=this.createCropSelection(),n={WebkitClipPath:this.props.ellipse?this.getEllipseClipPath():this.getPolygonClipPath(),clipPath:'url("#'+this.getPolygonId()+'")'});var r=["ReactCrop"];return this.state.newCropIsBeingDrawn&&r.push("ReactCrop-new-crop"),this.state.crop.aspect&&r.push("ReactCrop-fixed-aspect"),this.props.ellipse&&r.push("ReactCrop-ellipse"),this.props.disabled&&r.push("ReactCrop--disabled"),a.default.createElement("div",{ref:function(t){e.componentRef=t},className:r.join(" "),onTouchStart:this.onComponentMouseTouchDown,onMouseDown:this.onComponentMouseTouchDown,tabIndex:"1",onKeyDown:this.onComponentKeyDown},this.renderSvg(),a.default.createElement("img",{ref:function(t){e.imageRef=t},crossOrigin:"anonymous",className:"ReactCrop--image",src:this.props.src,onLoad:function(t){e.onImageLoad(t.target)},alt:""}),a.default.createElement("div",{className:"ReactCrop--crop-wrapper",ref:function(t){e.cropWrapperRef=t}},a.default.createElement("img",{ref:function(t){e.imageCopyRef=t},className:"ReactCrop--image-copy",src:this.props.src,style:n,alt:""}),t),this.props.children)}}]),t}(i.Component);l.defaultProps={disabled:!1,maxWidth:100,maxHeight:100},l.xOrds=["e","w"],l.yOrds=["n","s"],l.xyOrds=["nw","ne","se","sw"],l.arrowKey={left:37,up:38,right:39,down:40},l.nudgeStep=.2,l.defaultCrop={x:0,y:0,width:0,height:0,aspect:!1},e.exports=l},function(e,t){e.exports=n(156)},function(e,t){e.exports=n(1664)}])},378:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n)||[],r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n)||[];return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var c=a[s];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},4156:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,n,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=r;var l=Array.isArray(n);return l===Array.isArray(e)?l?c.arrayMerge(e,n,c):function(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}(e,n,c):r(n,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var c=s;e.exports=c},5309:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(2480),a=n(9462),s=n(5972),c=n(820),l=n(1942),u=n(6366),p=n(9947),f=n(1854),h=n(7325),d=n(4431),y=f("draft_tree_data_support"),m=y?c:s,b=h.List,v=h.Repeat,g={insertAtomicBlock:function(e,t,n){var o=e.getCurrentContent(),s=e.getSelection(),c=l.removeRange(o,s,"backward"),f=c.getSelectionAfter(),h=l.splitBlock(c,f),d=h.getSelectionAfter(),g=l.setBlockType(h,d,"atomic"),w=a.create({entity:t}),E={key:p(),type:"atomic",text:n,characterList:b(v(w,n.length))},S={key:p(),type:"unstyled"};y&&(E=r({},E,{nextSibling:S.key}),S=r({},S,{prevSibling:E.key}));var O=[new m(E),new m(S)],_=i.createFromArray(O),P=l.replaceWithFragment(g,d,_),k=P.merge({selectionBefore:s,selectionAfter:P.getSelectionAfter().set("hasFocus",!0)});return u.push(e,k,"insert-fragment")},moveAtomicBlock:function(e,t,n,r){var o,i=e.getCurrentContent(),a=e.getSelection();if("before"===r||"after"===r){var s=i.getBlockForKey("before"===r?n.getStartKey():n.getEndKey());o=d(i,t,s,r)}else{var c=l.removeRange(i,n,"backward"),p=c.getSelectionAfter(),f=c.getBlockForKey(p.getFocusKey());if(0===p.getStartOffset())o=d(c,t,f,"before");else if(p.getEndOffset()===f.getLength())o=d(c,t,f,"after");else{var h=l.splitBlock(c,p),y=h.getSelectionAfter(),m=h.getBlockForKey(y.getFocusKey());o=d(h,t,m,"before")}}var b=o.merge({selectionBefore:a,selectionAfter:o.getSelectionAfter().set("hasFocus",!0)});return u.push(e,b,"move-block")}};e.exports=g},2480:(e,t,n)=>{"use strict";var r=n(7325).OrderedMap,o={createFromArray:function(e){return r(e.map((function(e){return[e.getKey(),e]})))}};e.exports=o},2422:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(7367),i=n(5339),a=n(7325),s=a.List,c=a.Repeat,l=a.Record,u=function(){return!0},p=l({start:null,end:null}),f=l({start:null,end:null,decoratorKey:null,leaves:null}),h={generate:function(e,t,n){var r=t.getLength();if(!r)return s.of(new f({start:0,end:0,decoratorKey:null,leaves:s.of(new p({start:0,end:0}))}));var i=[],a=n?n.getDecorations(t,e):s(c(null,r)),l=t.getCharacterList();return o(a,d,u,(function(e,t){var n,r,c,h;i.push(new f({start:e,end:t,decoratorKey:a.get(e),leaves:(n=l.slice(e,t).toList(),r=e,c=[],h=n.map((function(e){return e.getStyle()})).toList(),o(h,d,u,(function(e,t){c.push(new p({start:e+r,end:t+r}))})),s(c))}))})),s(i)},fromJS:function(e){var t=e.leaves,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["leaves"]);return new f(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n,{leaves:null!=t?s(Array.isArray(t)?t:i(t)).map((function(e){return p(e)})):null}))}};function d(e,t){return e===t}e.exports=h},9462:(e,t,n)=>{"use strict";var r=n(7325),o=r.Map,i=r.OrderedSet,a=r.Record,s=i(),c={style:s,entity:null},l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.getStyle=function(){return this.get("style")},a.getEntity=function(){return this.get("entity")},a.hasStyle=function(e){return this.getStyle().includes(e)},r.applyStyle=function(e,t){var n=e.set("style",e.getStyle().add(t));return r.create(n)},r.removeStyle=function(e,t){var n=e.set("style",e.getStyle().remove(t));return r.create(n)},r.applyEntity=function(e,t){var n=e.getEntity()===t?e:e.set("entity",t);return r.create(n)},r.create=function(e){if(!e)return u;var t=o({style:s,entity:null}).merge(e),n=p.get(t);if(n)return n;var i=new r(t);return p=p.set(t,i),i},r.fromJS=function(e){var t=e.style,n=e.entity;return new r({style:Array.isArray(t)?i(t):t,entity:Array.isArray(n)?i(n):n})},r}(a(c)),u=new l,p=o([[o(c),u]]);l.EMPTY=u,e.exports=l},3799:(e,t,n)=>{"use strict";var r=n(7325).List,o=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_decorators",void 0),this._decorators=e.slice()}var t=e.prototype;return t.getDecorations=function(e,t){var n=Array(e.getText().length).fill(null);return this._decorators.forEach((function(r,o){var i=0;(0,r.strategy)(e,(function(e,t){(function(e,t,n){for(var r=t;r<n;r++)if(null!=e[r])return!1;return!0})(n,e,t)&&(function(e,t,n,r){for(var o=t;o<n;o++)e[o]=r}(n,e,t,o+"."+i),i++)}),t)})),r(n)},t.getComponentForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].component},t.getPropsForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].props},e}();e.exports=o},5972:(e,t,n)=>{"use strict";var r=n(9462),o=n(7367),i=n(7325),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,p=c(),f=function(e){var t,n;function i(t){return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e}(t))||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=i.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():p},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},i}(l({key:"",type:"unstyled",text:"",characterList:a(),depth:0,data:s()}));function h(e,t){return e.getStyle()===t.getStyle()}function d(e,t){return e.getEntity()===t.getEntity()}e.exports=f},820:(e,t,n)=>{"use strict";var r=n(9462),o=n(7367),i=n(7325),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,p=c(),f={parent:null,characterList:a(),data:s(),depth:0,key:"",text:"",type:"unstyled",children:a(),prevSibling:null,nextSibling:null},h=function(e,t){return e.getStyle()===t.getStyle()},d=function(e,t){return e.getEntity()===t.getEntity()},y=function(e){var t,n;function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e}(t))||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=i.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():p},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.getChildKeys=function(){return this.get("children")},s.getParentKey=function(){return this.get("parent")},s.getPrevSiblingKey=function(){return this.get("prevSibling")},s.getNextSiblingKey=function(){return this.get("nextSibling")},s.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},i}(l(f));e.exports=y},4396:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(2480),a=n(9462),s=n(5972),c=n(820),l=n(9076),u=n(9737),p=n(9947),f=n(5339),h=n(1854),d=n(7325),y=n(6037),m=d.List,b=d.Record,v=d.Repeat,g=d.Map,w=d.OrderedMap,E=b({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),S=h("draft_tree_data_support")?c:s,O=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=o.prototype;return s.getEntityMap=function(){return l},s.getBlockMap=function(){return this.get("blockMap")},s.getSelectionBefore=function(){return this.get("selectionBefore")},s.getSelectionAfter=function(){return this.get("selectionAfter")},s.getBlockForKey=function(e){return this.getBlockMap().get(e)},s.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getBlockAfter=function(e){return this.getBlockMap().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlocksAsArray=function(){return this.getBlockMap().toArray()},s.getFirstBlock=function(){return this.getBlockMap().first()},s.getLastBlock=function(){return this.getBlockMap().last()},s.getPlainText=function(e){return this.getBlockMap().map((function(e){return e?e.getText():""})).join(e||"\n")},s.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},s.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,n){return l.__create(e,t,n),this},s.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},s.addEntity=function(e){return l.__add(e),this},s.getEntity=function(e){return l.__get(e)},s.getAllEntities=function(){return l.__getAll()},s.loadWithEntities=function(e){return l.__loadWithEntities(e)},o.createFromBlockArray=function(e,t){var n=Array.isArray(e)?e:e.contentBlocks,r=i.createFromArray(n),a=r.isEmpty()?new u:u.createEmpty(r.first().getKey());return new o({blockMap:r,entityMap:t||l,selectionBefore:a,selectionAfter:a})},o.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=e.split(t).map((function(e){return e=y(e),new S({key:p(),text:e,type:"unstyled",characterList:m(v(a.EMPTY,e.length))})}));return o.createFromBlockArray(n)},o.fromJS=function(e){return new o(r({},e,{blockMap:w(e.blockMap).map(o.createContentBlockFromJS),selectionBefore:new u(e.selectionBefore),selectionAfter:new u(e.selectionAfter)}))},o.createContentBlockFromJS=function(e){var t=e.characterList;return new S(r({},e,{data:g(e.data),characterList:null!=t?m((Array.isArray(t)?t:f(t)).map((function(e){return a.fromJS(e)}))):void 0}))},o}(E);e.exports=O},2752:(e,t,n)=>{"use strict";var r=n(9462),o=n(7325).Map,i={add:function(e,t,n){return a(e,t,n,!0)},remove:function(e,t,n){return a(e,t,n,!1)}};function a(e,t,n,i){var a=e.getBlockMap(),s=t.getStartKey(),c=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),p=a.skipUntil((function(e,t){return t===s})).takeUntil((function(e,t){return t===l})).concat(o([[l,a.get(l)]])).map((function(e,t){var o,a;s===l?(o=c,a=u):(o=t===s?c:0,a=t===l?u:e.getLength());for(var p,f=e.getCharacterList();o<a;)p=f.get(o),f=f.set(o,i?r.applyStyle(p,n):r.removeStyle(p,n)),o++;return e.set("characterList",f)}));return e.merge({blockMap:a.merge(p),selectionBefore:t,selectionAfter:t})}e.exports=i},9774:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(5858),i=n(8704),a=n(5577),s=n(7325),c=n(1634),l=n(4356),u=s.Map,p={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},f=o.isBrowser("IE <= 11"),h=function(){function e(e){var t=this;r(this,"observer",void 0),r(this,"container",void 0),r(this,"mutations",void 0),r(this,"onCharData",void 0),this.container=e,this.mutations=u();var n=a(e);n.MutationObserver&&!f?this.observer=new n.MutationObserver((function(e){return t.registerMutations(e)})):this.onCharData=function(e){e.target instanceof Node||c(!1),t.registerMutation({type:"characterData",target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,p):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var t=this.mutations;return this.mutations=u(),t},t.registerMutations=function(e){for(var t=0;t<e.length;t++)this.registerMutation(e[t])},t.getMutationTextContent=function(e){var t=e.type,n=e.target,r=e.removedNodes;if("characterData"===t){if(""!==n.textContent)return f?n.textContent.replace("\n",""):n.textContent}else if("childList"===t){if(r&&r.length)return"";if(""!==n.textContent)return n.textContent}return null},t.registerMutation=function(e){var t=this.getMutationTextContent(e);if(null!=t){var n=l(i(e.target));this.mutations=this.mutations.set(n,t)}},e}();e.exports=h},5511:(e,t,n)=>{"use strict";var r=n(156),o=n(9863),i=(0,n(7325).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:r.createElement("ul",{className:o("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:r.createElement("ol",{className:o("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:r.createElement("pre",{className:o("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=i},6146:e=>{"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},1683:(e,t,n)=>{"use strict";var r=n(5309),o=n(2480),i=n(9462),a=n(3799),s=n(5972),c=n(4396),l=n(5511),u=n(6146),p=n(9748),f=n(4496),h=n(9076),d=n(1942),y=n(3819),m=n(6366),b=n(7250),v=n(1249),g=n(7126),w=n(9737),E=n(2034),S=n(7088),O=n(9947),_=n(1727),P=n(9394),k={Editor:p,EditorBlock:f,EditorState:m,CompositeDecorator:a,Entity:h,EntityInstance:y,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:s,ContentState:c,RawDraftContentState:v,SelectionState:w,AtomicBlockUtils:r,KeyBindingUtil:b,Modifier:d,RichUtils:g,DefaultDraftBlockRenderMap:l,DefaultDraftInlineStyle:u,convertFromHTML:n(3196),convertFromRaw:S,convertToRaw:E,genKey:O,getDefaultKeyBinding:_,getVisibleSelectionRect:P};e.exports=k},9748:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var l=n(5511),u=n(6146),p=n(3916),f=n(6341),h=n(2414),d=n(3940),y=n(3996),m=n(7144),b=n(1413),v=n(6366),g=n(156),w=n(4725),E=n(1115),S=n(5858),O=n(9863),_=n(9947),P=n(1727),k=n(8284),j=n(1854),C=n(1634),T=n(5343),x=n(4356),D=S.isBrowser("IE"),N=!D,R={edit:d,composite:p,drag:h,cut:null,render:null},M=!1,I=function(e){function t(){return e.apply(this,arguments)||this}c(t,e);var n=t.prototype;return n.render=function(){return null},n.componentDidMount=function(){this._update()},n.componentDidUpdate=function(){this._update()},n._update=function(){var e=this.props.editor;e._latestEditorState=this.props.editorState,e._blockSelectEvents=!0},t}(g.Component),A=function(e){function t(t){var n;return s(a(n=e.call(this,t)||this),"_blockSelectEvents",void 0),s(a(n),"_clipboard",void 0),s(a(n),"_handler",void 0),s(a(n),"_dragCount",void 0),s(a(n),"_internalDrag",void 0),s(a(n),"_editorKey",void 0),s(a(n),"_placeholderAccessibilityID",void 0),s(a(n),"_latestEditorState",void 0),s(a(n),"_latestCommittedEditorState",void 0),s(a(n),"_pendingStateFromBeforeInput",void 0),s(a(n),"_onBeforeInput",void 0),s(a(n),"_onBlur",void 0),s(a(n),"_onCharacterData",void 0),s(a(n),"_onCompositionEnd",void 0),s(a(n),"_onCompositionStart",void 0),s(a(n),"_onCopy",void 0),s(a(n),"_onCut",void 0),s(a(n),"_onDragEnd",void 0),s(a(n),"_onDragOver",void 0),s(a(n),"_onDragStart",void 0),s(a(n),"_onDrop",void 0),s(a(n),"_onInput",void 0),s(a(n),"_onFocus",void 0),s(a(n),"_onKeyDown",void 0),s(a(n),"_onKeyPress",void 0),s(a(n),"_onKeyUp",void 0),s(a(n),"_onMouseDown",void 0),s(a(n),"_onMouseUp",void 0),s(a(n),"_onPaste",void 0),s(a(n),"_onSelect",void 0),s(a(n),"editor",void 0),s(a(n),"editorContainer",void 0),s(a(n),"focus",void 0),s(a(n),"blur",void 0),s(a(n),"setMode",void 0),s(a(n),"exitCurrentMode",void 0),s(a(n),"restoreEditorDOM",void 0),s(a(n),"setClipboard",void 0),s(a(n),"getClipboard",void 0),s(a(n),"getEditorKey",void 0),s(a(n),"update",void 0),s(a(n),"onDragEnter",void 0),s(a(n),"onDragLeave",void 0),s(a(n),"_handleEditorContainerRef",(function(e){n.editorContainer=e,n.editor=null!==e?e.firstChild:null})),s(a(n),"focus",(function(e){var t=n.props.editorState,r=t.getSelection().getHasFocus(),o=n.editor;if(o){var i=E.getScrollParent(o),a=e||k(i),s=a.x,c=a.y;T(o)||C(!1),o.focus(),i===window?window.scrollTo(s,c):w.setTop(i,c),r||n.update(v.forceSelection(t,t.getSelection()))}})),s(a(n),"blur",(function(){var e=n.editor;e&&(T(e)||C(!1),e.blur())})),s(a(n),"setMode",(function(e){var t=n.props,r=t.onPaste,o=t.onCut,a=t.onCopy,s=i({},R.edit);r&&(s.onPaste=r),o&&(s.onCut=o),a&&(s.onCopy=a);var c=i({},R,{edit:s});n._handler=c[e]})),s(a(n),"exitCurrentMode",(function(){n.setMode("edit")})),s(a(n),"restoreEditorDOM",(function(e){n.setState({contentsKey:n.state.contentsKey+1},(function(){n.focus(e)}))})),s(a(n),"setClipboard",(function(e){n._clipboard=e})),s(a(n),"getClipboard",(function(){return n._clipboard})),s(a(n),"update",(function(e){n._latestEditorState=e,n.props.onChange(e)})),s(a(n),"onDragEnter",(function(){n._dragCount++})),s(a(n),"onDragLeave",(function(){n._dragCount--,0===n._dragCount&&n.exitCurrentMode()})),n._blockSelectEvents=!1,n._clipboard=null,n._handler=null,n._dragCount=0,n._editorKey=t.editorKey||_(),n._placeholderAccessibilityID="placeholder-"+n._editorKey,n._latestEditorState=t.editorState,n._latestCommittedEditorState=t.editorState,n._onBeforeInput=n._buildHandler("onBeforeInput"),n._onBlur=n._buildHandler("onBlur"),n._onCharacterData=n._buildHandler("onCharacterData"),n._onCompositionEnd=n._buildHandler("onCompositionEnd"),n._onCompositionStart=n._buildHandler("onCompositionStart"),n._onCopy=n._buildHandler("onCopy"),n._onCut=n._buildHandler("onCut"),n._onDragEnd=n._buildHandler("onDragEnd"),n._onDragOver=n._buildHandler("onDragOver"),n._onDragStart=n._buildHandler("onDragStart"),n._onDrop=n._buildHandler("onDrop"),n._onInput=n._buildHandler("onInput"),n._onFocus=n._buildHandler("onFocus"),n._onKeyDown=n._buildHandler("onKeyDown"),n._onKeyPress=n._buildHandler("onKeyPress"),n._onKeyUp=n._buildHandler("onKeyUp"),n._onMouseDown=n._buildHandler("onMouseDown"),n._onMouseUp=n._buildHandler("onMouseUp"),n._onPaste=n._buildHandler("onPaste"),n._onSelect=n._buildHandler("onSelect"),n.getEditorKey=function(){return n._editorKey},n.state={contentsKey:0},n}c(t,e);var r=t.prototype;return r._buildHandler=function(e){var t=this;return function(n){if(!t.props.readOnly){var r=t._handler&&t._handler[e];r&&(y?y((function(){return r(t,n)})):r(t,n))}}},r._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},r._renderPlaceholder=function(){if(this._showPlaceholder()){var e={text:x(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return g.createElement(m,e)}return null},r._renderARIADescribedBy=function(){var e=this.props.ariaDescribedBy||"",t=this._showPlaceholder()?this._placeholderAccessibilityID:"";return e.replace("{{editor_id_placeholder}}",t)||void 0},r.render=function(){var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleFn,s=e.customStyleMap,c=e.editorState,l=e.preventScroll,p=e.readOnly,h=e.textAlignment,d=e.textDirectionality,y=O({"DraftEditor/root":!0,"DraftEditor/alignLeft":"left"===h,"DraftEditor/alignRight":"right"===h,"DraftEditor/alignCenter":"center"===h}),m=this.props.role||"textbox",b="combobox"===m?!!this.props.ariaExpanded:null,v={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,customStyleMap:i({},u,s),customStyleFn:a,editorKey:this._editorKey,editorState:c,preventScroll:l,textDirectionality:d};return g.createElement("div",{className:y},this._renderPlaceholder(),g.createElement("div",{className:O("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},g.createElement("div",{"aria-activedescendant":p?null:this.props.ariaActiveDescendantID,"aria-autocomplete":p?null:this.props.ariaAutoComplete,"aria-controls":p?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":p?null:b,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":p?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:O({notranslate:!p,"public/DraftEditor/content":!0}),contentEditable:!p,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:p?null:m,spellCheck:N&&this.props.spellCheck,style:{outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},g.createElement(I,{editor:this,editorState:c}),g.createElement(f,o({},v,{key:"contents"+this.state.contentsKey})))))},r.componentDidMount=function(){this._blockSelectEvents=!1,!M&&j("draft_ods_enabled")&&(M=!0,b.initODS()),this.setMode("edit"),D&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):n.g.execCommand("AutoUrlDetect",!1,!1))},r.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(g.Component);s(A,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:l,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:P,readOnly:!1,spellCheck:!1,stripPastedStyles:!1}),e.exports=A},4496:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}var i=n(8911),a=n(6449),s=n(156),c=n(4725),l=n(1115),u=n(4319),p=n(9898),f=n(9863),h=n(7875),d=n(8284),y=n(3125),m=n(1634),b=n(5343),v=n(4356),g=function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t},w=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"_node",void 0),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var w=r.prototype;return w.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||g(e.selection,e.block.getKey())&&e.forceSelection},w.componentDidMount=function(){if(!this.props.preventScroll){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this._node;if(null!=n){var r,o=l.getScrollParent(n),i=d(o);if(o===window){var a=h(n);(r=a.y+a.height-y().height)>0&&window.scrollTo(i.x,i.y+r+10)}else b(n)||m(!1),(r=n.offsetHeight+n.offsetTop-(o.offsetTop+o.offsetHeight+i.y))>0&&c.setTop(o,c.getTop(o)+r+10)}}}},w._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),r=t.getText(),c=this.props.tree.size-1,l=g(this.props.selection,n);return this.props.tree.map((function(f,h){var d=f.get("leaves");if(0===d.size)return null;var y=d.size-1,m=d.map((function(o,u){var p=a.encode(n,h,u),f=o.get("start"),d=o.get("end");return s.createElement(i,{key:p,offsetKey:p,block:t,start:f,selection:l?e.props.selection:null,forceSelection:e.props.forceSelection,text:r.slice(f,d),styleSet:t.getInlineStyleAt(f),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:h===c&&u===y})})).toArray(),b=f.get("decoratorKey");if(null==b)return m;if(!e.props.decorator)return m;var g=v(e.props.decorator),w=g.getComponentForKey(b);if(!w)return m;var E=g.getPropsForKey(b),S=a.encode(n,h,0),O=d.first().get("start"),_=d.last().get("end"),P=r.slice(O,_),k=t.getEntityAt(f.get("start")),j=p.getHTMLDirIfDifferent(u.getDirection(P),e.props.direction),C={contentState:e.props.contentState,decoratedText:P,dir:j,start:O,end:_,blockKey:n,entityKey:k,offsetKey:S};return s.createElement(w,o({},E,C,{key:S}),m)})).toArray()},w.render=function(){var e=this,t=this.props,n=t.direction,r=t.offsetKey,o=f({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===n,"public/DraftStyleDefault/rtl":"RTL"===n});return s.createElement("div",{"data-offset-key":r,className:o,ref:function(t){return e._node=t}},this._renderChildren())},r}(s.Component);e.exports=w},3004:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(927),c=n(6449),l=n(156),u=n(4725),p=n(1115),f=n(7875),h=n(8284),d=n(3125),y=n(7325),m=n(1634),b=n(5343),v=(y.List,function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t}),g=function(e,t){var n=t.get(e.getType())||t.get("unstyled"),r=n.wrapper;return{Element:n.element||t.get("unstyled").element,wrapperTemplate:r}},w=function(e,t){var n=t(e);return n?{CustomComponent:n.component,customProps:n.props,customEditable:n.editable}:{}},E=function(e,t,n,r,o,a){var s={"data-block":!0,"data-editor":t,"data-offset-key":n,key:e.getKey(),ref:a},c=r(e);return c&&(s.className=c),void 0!==o.customEditable&&(s=i({},s,{contentEditable:o.customEditable,suppressContentEditableWarning:!0})),s},S=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return a(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"wrapperRef",l.createRef()),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var y=r.prototype;return y.shouldComponentUpdate=function(e){var t=this.props,n=t.block,r=t.direction,o=t.tree,i=!n.getChildKeys().isEmpty(),a=n!==e.block||o!==e.tree||r!==e.direction||v(e.selection,e.block.getKey())&&e.forceSelection;return i||a},y.componentDidMount=function(){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this.wrapperRef.current;if(n){var r,o=p.getScrollParent(n),i=h(o);if(o===window){var a=f(n);(r=a.y+a.height-d().height)>0&&window.scrollTo(i.x,i.y+r+10)}else{b(n)||m(!1);var s=n;(r=s.offsetHeight+s.offsetTop-(o.offsetHeight+i.y))>0&&u.setTop(o,u.getTop(o)+r+10)}}}},y.render=function(){var e=this,t=this.props,n=t.block,a=t.blockRenderMap,u=t.blockRendererFn,p=t.blockStyleFn,f=t.contentState,h=t.decorator,d=t.editorKey,y=t.editorState,m=t.customStyleFn,b=t.customStyleMap,S=t.direction,O=t.forceSelection,_=t.selection,P=t.tree,k=null;n.children.size&&(k=n.children.reduce((function(t,n){var o=c.encode(n,0,0),s=f.getBlockForKey(n),h=w(s,u),m=h.CustomComponent||r,b=g(s,a),v=b.Element,S=b.wrapperTemplate,O=E(s,d,o,p,h,null),_=i({},e.props,{tree:y.getBlockTree(n),blockProps:h.customProps,offsetKey:o,block:s});return t.push(l.createElement(v,O,l.createElement(m,_))),!S||function(e,t){var n=e.getNextSiblingKey();return!!n&&t.getBlockForKey(n).getType()===e.getType()}(s,f)||function(e,t,n){var r=[],o=!0,i=!1,a=void 0;try{for(var s,u=n.reverse()[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var p=s.value;if(p.type!==t)break;r.push(p)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}n.splice(n.indexOf(r[0]),r.length+1);var f=r.reverse(),h=f[0].key;n.push(l.cloneElement(e,{key:"".concat(h,"-wrap"),"data-offset-key":c.encode(h,0,0)},f))}(S,v,t),t}),[]));var j=n.getKey(),C=c.encode(j,0,0),T=w(n,u),x=T.CustomComponent,D=null!=x?l.createElement(x,o({},this.props,{tree:y.getBlockTree(j),blockProps:T.customProps,offsetKey:C,block:n})):l.createElement(s,{block:n,children:k,contentState:f,customStyleFn:m,customStyleMap:b,decorator:h,direction:S,forceSelection:O,hasSelection:v(_,j),selection:_,tree:P});if(n.getParentKey())return D;var N=g(n,a).Element,R=E(n,d,C,p,T,this.wrapperRef);return l.createElement(N,R,D)},r}(l.Component);e.exports=S},3916:(e,t,n)=>{"use strict";var r=n(9774),o=n(1942),i=n(6449),a=n(6366),s=n(1896),c=n(5858),l=n(672),u=n(424),p=n(6652),f=n(4179),h=n(4356),d=c.isBrowser("IE"),y=!1,m=!1,b=null,v={onCompositionStart:function(e){m=!0,function(e){b||(b=new r(u(e))).start()}(e)},onCompositionEnd:function(e){y=!1,m=!1,setTimeout((function(){y||v.resolveComposition(e)}),20)},onSelect:l,onKeyDown:function(e,t){if(!m)return v.resolveComposition(e),void e._onKeyDown(t);t.which!==s.RIGHT&&t.which!==s.LEFT||t.preventDefault()},onKeyPress:function(e,t){t.which===s.RETURN&&t.preventDefault()},resolveComposition:function(e){if(!m){var t=h(b).stopAndFlushMutations();b=null,y=!0;var n=a.set(e._latestEditorState,{inCompositionMode:!1});if(e.exitCurrentMode(),t.size){var r=n.getCurrentContent();t.forEach((function(e,t){var s=i.decode(t),c=s.blockKey,l=s.decoratorKey,u=s.leafKey,p=n.getBlockTree(c).getIn([l,"leaves",u]),h=p.start,d=p.end,y=n.getSelection().merge({anchorKey:c,focusKey:c,anchorOffset:h,focusOffset:d,isBackward:!1}),m=f(r,y),b=r.getBlockForKey(c).getInlineStyleAt(h);r=o.replaceText(r,y,e,b,m),n=a.set(n,{currentContent:r})}));var s=p(n,u(e)).selectionState;e.restoreEditorDOM();var c=d?a.forceSelection(n,s):a.acceptSelection(n,s);e.update(a.push(c,r,"insert-characters"))}else e.update(n)}}};e.exports=v},4751:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(4496),c=n(6449),l=n(156),u=n(9863),p=n(6778),f=n(4356),h=function(e,t,n,r){return u({"public/DraftStyleDefault/unorderedListItem":"unordered-list-item"===e,"public/DraftStyleDefault/orderedListItem":"ordered-list-item"===e,"public/DraftStyleDefault/reset":n,"public/DraftStyleDefault/depth0":0===t,"public/DraftStyleDefault/depth1":1===t,"public/DraftStyleDefault/depth2":2===t,"public/DraftStyleDefault/depth3":3===t,"public/DraftStyleDefault/depth4":t>=4,"public/DraftStyleDefault/listLTR":"LTR"===r,"public/DraftStyleDefault/listRTL":"RTL"===r})},d=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},a.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleMap,u=e.customStyleFn,d=e.editorState,y=e.editorKey,m=e.preventScroll,b=e.textDirectionality,v=d.getCurrentContent(),g=d.getSelection(),w=d.mustForceSelection(),E=d.getDecorator(),S=f(d.getDirectionMap()),O=v.getBlocksAsArray(),_=[],P=null,k=null,j=0;j<O.length;j++){var C=O[j],T=C.getKey(),x=C.getType(),D=n(C),N=void 0,R=void 0,M=void 0;D&&(N=D.component,R=D.props,M=D.editable);var I=b||S.get(T),A=c.encode(T,0,0),L={contentState:v,block:C,blockProps:R,blockStyleFn:r,customStyleMap:a,customStyleFn:u,decorator:E,direction:I,forceSelection:w,offsetKey:A,preventScroll:m,selection:g,tree:d.getBlockTree(T)},B=t.get(x)||t.get("unstyled"),F=B.wrapper,U=B.element||t.get("unstyled").element,q=C.getDepth(),K="";r&&(K=r(C)),"li"===U&&(K=p(K,h(x,q,k!==F||null===P||q>P,I)));var V=N||s,z={className:K,"data-block":!0,"data-editor":y,"data-offset-key":A,key:T};void 0!==M&&(z=i({},z,{contentEditable:M,suppressContentEditableWarning:!0}));var W=l.createElement(U,z,l.createElement(V,o({},L,{key:T})));_.push({block:W,wrapperTemplate:F,key:T,offsetKey:A}),P=F?C.getDepth():null,k=F}for(var H=[],$=0;$<_.length;){var G=_[$];if(G.wrapperTemplate){var J=[];do{J.push(_[$].block),$++}while($<_.length&&_[$].wrapperTemplate===G.wrapperTemplate);var Q=l.cloneElement(G.wrapperTemplate,{key:G.key+"-wrap","data-offset-key":G.offsetKey},J);H.push(Q)}else H.push(G.block),$++}return l.createElement("div",{"data-contents":"true"},H)},r}(l.Component);e.exports=d},6341:(e,t,n)=>{"use strict";var r=n(1854)("draft_tree_data_support");e.exports=n(r?8743:4751)},8743:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}var i=n(3004),a=n(6449),s=n(156),c=n(4356),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var l=r.prototype;return l.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},l.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,l=e.customStyleMap,u=e.customStyleFn,p=e.editorState,f=e.editorKey,h=e.textDirectionality,d=p.getCurrentContent(),y=p.getSelection(),m=p.mustForceSelection(),b=p.getDecorator(),v=c(p.getDirectionMap()),g=[],w=d.getBlocksAsArray()[0];w;){var E=w.getKey(),S={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,contentState:d,customStyleFn:u,customStyleMap:l,decorator:b,editorKey:f,editorState:p,forceSelection:m,selection:y,block:w,direction:h||v.get(E),tree:p.getBlockTree(E)},O=(t.get(w.getType())||t.get("unstyled")).wrapper;g.push({block:s.createElement(i,o({key:E},S)),wrapperTemplate:O,key:E,offsetKey:a.encode(E,0,0)});var _=w.getNextSiblingKey();w=_?d.getBlockForKey(_):null}for(var P=[],k=0;k<g.length;){var j=g[k];if(j.wrapperTemplate){var C=[];do{C.push(g[k].block),k++}while(k<g.length&&g[k].wrapperTemplate===j.wrapperTemplate);var T=s.cloneElement(j.wrapperTemplate,{key:j.key+"-wrap","data-offset-key":j.offsetKey},C);P.push(T)}else P.push(j.block),k++}return s.createElement("div",{"data-contents":"true"},P)},r}(s.Component);e.exports=l},2160:(e,t,n)=>{"use strict";var r=n(1664);function o(){return o=r||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},o.apply(this,arguments)}var i=n(6449),a=n(156),s=n(4319),c=n(9898),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.render=function(){var e=this.props,t=e.block,n=e.children,r=e.contentState,l=e.decorator,u=e.decoratorKey,p=e.direction,f=e.leafSet,h=e.text,d=t.getKey(),y=f.get("leaves"),m=l.getComponentForKey(u),b=l.getPropsForKey(u),v=i.encode(d,parseInt(u,10),0),g=h.slice(y.first().get("start"),y.last().get("end")),w=c.getHTMLDirIfDifferent(s.getDirection(g),p);return a.createElement(m,o({},b,{contentState:r,decoratedText:g,dir:w,key:v,entityKey:t.getEntityAt(f.get("start")),offsetKey:v}),n)},r}(a.Component);e.exports=l},2414:(e,t,n)=>{"use strict";var r=n(5487),o=n(1942),i=n(6366),a=n(8704),s=n(3001),c=n(3175),l=n(9086),u=n(5577),p=n(7884),f=n(4356),h={onDragEnd:function(e){e.exitCurrentMode(),d(e)},onDrop:function(e,t){var n=new r(t.nativeEvent.dataTransfer),u=e._latestEditorState,h=function(e,t){var n=null,r=null,o=s(e.currentTarget);if("function"==typeof o.caretRangeFromPoint){var i=o.caretRangeFromPoint(e.x,e.y);n=i.startContainer,r=i.startOffset}else{if(!e.rangeParent)return null;n=e.rangeParent,r=e.rangeOffset}n=f(n),r=f(r);var c=f(a(n));return l(t,c,r,c,r)}(t.nativeEvent,u);if(t.preventDefault(),e._dragCount=0,e.exitCurrentMode(),null!=h){var m=n.getFiles();if(m.length>0){if(e.props.handleDroppedFiles&&p(e.props.handleDroppedFiles(h,m)))return;c(m,(function(t){t&&e.update(y(u,h,t))}))}else{var b=e._internalDrag?"internal":"external";e.props.handleDrop&&p(e.props.handleDrop(h,n,b))||(e._internalDrag?e.update(function(e,t){var n=o.moveText(e.getCurrentContent(),e.getSelection(),t);return i.push(e,n,"insert-fragment")}(u,h)):e.update(y(u,h,n.getText()))),d(e)}}}};function d(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var n=new MouseEvent("mouseup",{view:u(t),bubbles:!0,cancelable:!0});t.dispatchEvent(n)}}function y(e,t,n){var r=o.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return i.push(e,r,"insert-fragment")}e.exports=h},3940:(e,t,n)=>{"use strict";var r=n(5858),o=n(3902),i=n(4750),a=n(2825),s=n(4074),c=n(7643),l=n(1723),u=n(3625),p=n(419),f=n(8295),h=n(1116),d=n(7692),y=n(672),m=r.isBrowser("Chrome"),b=r.isBrowser("Firefox"),v=m||b?y:function(e){},g={onBeforeInput:o,onBlur:i,onCompositionStart:a,onCopy:s,onCut:c,onDragOver:l,onDragStart:u,onFocus:p,onInput:f,onKeyDown:h,onPaste:d,onSelect:y,onMouseUp:v,onKeyUp:v};e.exports=g},3996:(e,t,n)=>{"use strict";var r=n(9318).unstable_flushControlled;e.exports=r},8911:(e,t,n)=>{"use strict";var r=n(1664),o=n(5960),i=n(156),a=n(1634),s=n(9459),c=n(6112).setDraftEditorSelection,l=function(e){var t,n;function l(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t=e.call.apply(e,[this].concat(r))||this),"leaf",void 0),t}n=e,(t=l).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=l.prototype;return u._setSelection=function(){var e=this.props.selection;if(null!=e&&e.getHasFocus()){var t=this.props,n=t.block,r=t.start,o=t.text,i=n.getKey(),l=r+o.length;if(e.hasEdgeWithin(i,r,l)){var u=this.leaf;u||a(!1);var p,f=u.firstChild;f||a(!1),f.nodeType===Node.TEXT_NODE?p=f:s(f)?p=u:(p=f.firstChild)||a(!1),c(e,p,i,r,l)}}},u.shouldComponentUpdate=function(e){var t=this.leaf;return t||a(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},u.componentDidUpdate=function(){this._setSelection()},u.componentDidMount=function(){this._setSelection()},u.render=function(){var e=this,t=this.props.block,n=this.props.text;n.endsWith("\n")&&this.props.isLast&&(n+="\n");var a=this.props,s=a.customStyleMap,c=a.customStyleFn,l=a.offsetKey,u=a.styleSet,p=u.reduce((function(e,t){var n={},o=s[t];return void 0!==o&&e.textDecoration!==o.textDecoration&&(n.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),r(e,o,n)}),{});if(c){var f=c(u,t);p=r(p,f)}return i.createElement("span",{"data-offset-key":l,ref:function(t){return e.leaf=t},style:p},i.createElement(o,null,n))},l}(i.Component);e.exports=l},927:(e,t,n)=>{"use strict";var r=n(2160),o=n(8911),i=n(6449),a=n(7325),s=n(156),c=n(9863),l=(a.List,function(e){var t,n;function a(){return e.apply(this,arguments)||this}return n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.prototype.render=function(){var e=this.props,t=e.block,n=e.contentState,a=e.customStyleFn,l=e.customStyleMap,u=e.decorator,p=e.direction,f=e.forceSelection,h=e.hasSelection,d=e.selection,y=e.tree,m=t.getKey(),b=t.getText(),v=y.size-1,g=this.props.children||y.map((function(e,c){var y=e.get("decoratorKey"),g=e.get("leaves"),w=g.size-1,E=g.map((function(e,n){var r=i.encode(m,c,n),u=e.get("start"),p=e.get("end");return s.createElement(o,{key:r,offsetKey:r,block:t,start:u,selection:h?d:null,forceSelection:f,text:b.slice(u,p),styleSet:t.getInlineStyleAt(u),customStyleMap:l,customStyleFn:a,isLast:y===v&&n===w})})).toArray();return y&&u?s.createElement(r,{block:t,children:E,contentState:n,decorator:u,decoratorKey:y,direction:p,leafSet:e,text:b,key:c}):E})).toArray();return s.createElement("div",{"data-offset-key":i.encode(m,0,0),className:c({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===p,"public/DraftStyleDefault/rtl":"RTL"===p})},g)},a}(s.Component));e.exports=l},7144:(e,t,n)=>{"use strict";var r=n(156),o=n(9863),i=function(e){var t,n;function i(){return e.apply(this,arguments)||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},a.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=o({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e});return r.createElement("div",{className:t},r.createElement("div",{className:o("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:{whiteSpace:"pre-wrap"}},this.props.text))},i}(r.Component);e.exports=i},5960:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(156),a=n(5858),s=n(1634),c=n(2004),l=a.isBrowser("IE <= 11"),u=function(e){var t,n;function a(t){var n;return o(r(n=e.call(this,t)||this),"_forceFlag",void 0),o(r(n),"_node",void 0),n._forceFlag=!1,n}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=a.prototype;return u.shouldComponentUpdate=function(e){var t=this._node,n=""===e.children;c(t)||s(!1);var r=t;return n?!function(e){return l?"\n"===e.textContent:"BR"===e.tagName}(r):r.textContent!==e.children},u.componentDidMount=function(){this._forceFlag=!this._forceFlag},u.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},u.render=function(){var e,t=this;return""===this.props.children?this._forceFlag?(e=function(e){return t._node=e},l?i.createElement("span",{key:"A","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"A","data-text":"true",ref:e})):function(e){return l?i.createElement("span",{key:"B","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"B","data-text":"true",ref:e})}((function(e){return t._node=e})):i.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(e){return t._node=e}},this.props.children)},a}(i.Component);e.exports=u},1413:e=>{"use strict";e.exports={initODS:function(){},handleExtensionCausedError:function(){}}},9076:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(3819),i=n(7325),a=n(1634),s=n(8845),c=(0,i.Map)(),l=s();function u(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var p={getLastCreatedEntityKey:function(){return u("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),p.__getLastCreatedEntityKey()},create:function(e,t,n){return u("DraftEntity.create","contentState.createEntity"),p.__create(e,t,n)},add:function(e){return u("DraftEntity.add","contentState.addEntity"),p.__add(e)},get:function(e){return u("DraftEntity.get","contentState.getEntity"),p.__get(e)},__getAll:function(){return c},__loadWithEntities:function(e){c=e,l=s()},mergeData:function(e,t){return u("DraftEntity.mergeData","contentState.mergeEntityData"),p.__mergeData(e,t)},replaceData:function(e,t){return u("DraftEntity.replaceData","contentState.replaceEntityData"),p.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return l},__create:function(e,t,n){return p.__add(new o({type:e,mutability:t,data:n||{}}))},__add:function(e){return l=s(),c=c.set(l,e),l},__get:function(e){var t=c.get(e);return t||a(!1),t},__mergeData:function(e,t){var n=p.__get(e),o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n.getData(),t),i=n.set("data",o);return c=c.set(e,i),i},__replaceData:function(e,t){var n=p.__get(e).set("data",t);return c=c.set(e,n),n}};e.exports=p},3819:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.getType=function(){return this.get("type")},o.getMutability=function(){return this.get("mutability")},o.getData=function(){return this.get("data")},r}((0,n(7325).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}));e.exports=r},1034:e=>{"use strict";e.exports={getRemovalRange:function(e,t,n,r,o){var i=n.split(" ");i=i.map((function(e,t){if("forward"===o){if(t>0)return" "+e}else if(t<i.length-1)return e+" ";return e}));for(var a,s=r,c=null,l=null,u=0;u<i.length;u++){if(e<(a=s+i[u].length)&&s<t)null!==c||(c=s),l=a;else if(null!==c)break;s=a}var p=r+n.length,f=c===r,h=l===p;return(!f&&h||f&&!h)&&("forward"===o?l!==p&&l++:c!==r&&c--),{start:c,end:l}}}},7248:e=>{"use strict";e.exports={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}}},1942:(e,t,n)=>{"use strict";var r=n(9462),o=n(2752),i=n(6820),a=n(8640),s=n(4422),c=n(7325),l=n(3163),u=n(6636),p=n(1634),f=n(5994),h=n(3320),d=n(839),y=n(9570),m=c.OrderedSet,b={replaceText:function(e,t,n,o,i){var a=h(e,t),s=d(a,t),c=r.create({style:o||m(),entity:i||null});return u(s,s.getSelectionAfter(),n,c)},insertText:function(e,t,n,r,o){return t.isCollapsed()||p(!1),b.replaceText(e,t,n,r,o)},moveText:function(e,t,n){var r=s(e,t),o=b.removeRange(e,t,"backward");return b.replaceWithFragment(o,n,r)},replaceWithFragment:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",o=h(e,t),i=d(o,t);return l(i,i.getSelectionAfter(),n,r)},removeRange:function(e,t,n){var r,o,i,s;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),o=t.getFocusKey(),i=e.getBlockForKey(r),s=e.getBlockForKey(o);var c=t.getStartOffset(),l=t.getEndOffset(),u=i.getEntityAt(c),p=s.getEntityAt(l-1);if(r===o&&u&&u===p){var f=a(e.getEntityMap(),i,s,t,n);return d(e,f)}var y=h(e,t);return d(y,t)},splitBlock:function(e,t){var n=h(e,t),r=d(n,t);return y(r,r.getSelectionAfter())},applyInlineStyle:function(e,t,n){return o.add(e,t,n)},removeInlineStyle:function(e,t,n){return o.remove(e,t,n)},setBlockType:function(e,t,n){return f(e,t,(function(e){return e.merge({type:n,depth:0})}))},setBlockData:function(e,t,n){return f(e,t,(function(e){return e.merge({data:n})}))},mergeBlockData:function(e,t,n){return f(e,t,(function(e){return e.merge({data:e.getData().merge(n)})}))},applyEntity:function(e,t,n){var r=h(e,t);return i(r,t,n)}};e.exports=b},6449:e=>{"use strict";var t="-",n={encode:function(e,n,r){return e+t+n+t+r},decode:function(e){var n=e.split(t).reverse(),r=n[0],o=n[1];return{blockKey:n.slice(2).reverse().join(t),decoratorKey:parseInt(o,10),leafKey:parseInt(r,10)}}};e.exports=n},6754:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(5972),i=n(820),a=n(3196),s=n(9947),c=n(4828),l=n(1854),u=n(7325),p=n(6037),f=u.List,h=u.Repeat,d=l("draft_tree_data_support"),y=d?i:o,m={processHTML:function(e,t){return a(e,c,t)},processText:function(e,t,n){return e.reduce((function(e,o,i){o=p(o);var a=s(),c={key:a,type:n,text:o,characterList:f(h(t,o.length))};if(d&&0!==i){var l=i-1;c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},c,{prevSibling:(e[l]=e[l].merge({nextSibling:a})).getKey()})}return e.push(new y(c)),e}),[])}};e.exports=m},4138:(e,t,n)=>{"use strict";var r="['‘’]",o="\\s|(?![_])"+n(3137).getPunctuation(),i=new RegExp("^(?:"+o+")*(?:"+r+"|(?!"+o+").)*(?:(?!"+o+").)"),a=new RegExp("(?:(?!"+o+").)(?:"+r+"|(?!"+o+").)*(?:"+o+")*$");function s(e,t){var n=t?a.exec(e):i.exec(e);return n?n[0]:e}var c={getBackward:function(e){return s(e,!0)},getForward:function(e){return s(e,!1)}};e.exports=c},7651:e=>{"use strict";var t={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=t},7296:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(9947),a=n(1634),s=function(e){if(!e||!e.type)return!1;var t=e.type;return"unordered-list-item"===t||"ordered-list-item"===t},c={fromRawTreeStateToRawState:function(e){var t=e.blocks,n=[];return Array.isArray(t)||a(!1),Array.isArray(t)&&t.length?(function(e,t){for(var o=[].concat(e).reverse();o.length;){var i=o.pop();u=void 0,u=r({},l=i),s(l)&&(u.depth=u.depth||0,function(e){Array.isArray(e.children)&&(e.children=e.children.map((function(t){return t.type===e.type?r({},t,{depth:(e.depth||0)+1}):t})))}(l),null!=l.children&&l.children.length>0)||(delete u.children,n.push(u));var c=i.children;Array.isArray(c)||a(!1),o=o.concat([].concat(c.reverse()))}var l,u}(t),e.blocks=n,r({},e,{blocks:n})):e},fromRawStateToRawTreeState:function(e){var t=[],n=[];return e.blocks.forEach((function(e){var o=s(e),a=e.depth||0,c=r({},e,{children:[]});if(o){var l=n[0];if(null==l&&0===a)t.push(c);else if(null==l||l.depth<a-1){var u={key:i(),text:"",depth:a-1,type:e.type,children:[],entityRanges:[],inlineStyleRanges:[]};n.unshift(u),1===a?t.push(u):null!=l&&l.children.push(u),u.children.push(c)}else if(l.depth===a-1)l.children.push(c);else{for(;null!=l&&l.depth>=a;)n.shift(),l=n[0];a>0?l.children.push(c):t.push(c)}}else t.push(c)})),r({},e,{blocks:t})}};e.exports=c},6318:(e,t,n)=>{"use strict";n(4942),e.exports={isValidBlock:function(e,t){var n=e.getKey(),r=e.getParentKey();if(null!=r&&!t.get(r).getChildKeys().includes(n))return!1;if(!e.getChildKeys().map((function(e){return t.get(e)})).every((function(e){return e.getParentKey()===n})))return!1;var o=e.getPrevSiblingKey();if(null!=o&&t.get(o).getNextSiblingKey()!==n)return!1;var i=e.getNextSiblingKey();return(null==i||t.get(i).getPrevSiblingKey()===n)&&!(null!==i&&null!==o&&o===i||""!=e.text&&e.getChildKeys().size>0)},isConnectedTree:function(e){var t=e.toArray().filter((function(e){return null==e.getParentKey()&&null==e.getPrevSiblingKey()}));if(1!==t.length)return!1;for(var n=0,r=t.shift().getKey(),o=[];null!=r;){var i=e.get(r),a=i.getChildKeys(),s=i.getNextSiblingKey();if(a.size>0){null!=s&&o.unshift(s);var c=a.map((function(t){return e.get(t)})).find((function(e){return null==e.getPrevSiblingKey()}));if(null==c)return!1;r=c.getKey()}else r=null!=i.getNextSiblingKey()?i.getNextSiblingKey():o.shift();n++}return n===e.size},isValidTree:function(e){var t=this;return!!e.toArray().every((function(n){return t.isValidBlock(n,e)}))&&this.isConnectedTree(e)}}},3854:(e,t,n)=>{"use strict";var r,o=n(8472),i=n(7325),a=n(4356),s=i.OrderedMap,c={getDirectionMap:function(e,t){r?r.reset():r=new o;var n=e.getBlockMap(),c=n.valueSeq().map((function(e){return a(r).getDirection(e.getText())})),l=s(n.keySeq().zip(c));return null!=t&&i.is(t,l)?t:l}};e.exports=c},6366:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(2422),a=n(4396),s=n(3854),c=n(9737),l=n(7325),u=l.OrderedSet,p=l.Record,f=l.Stack,h=l.OrderedMap,d=l.List,y=p({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:f(),selection:null,treeMap:null,undoStack:f()}),m=function(){t.createEmpty=function(e){return this.createWithText("",e)},t.createWithText=function(e,n){return t.createWithContent(a.createFromText(e),n)},t.createWithContent=function(e,n){if(0===e.getBlockMap().count())return t.createEmpty(n);var r=e.getBlockMap().first().getKey();return t.create({currentContent:e,undoStack:f(),redoStack:f(),decorator:n||null,selection:c.createEmpty(r)})},t.create=function(e){var n=e.currentContent,o=r({},e,{treeMap:v(n,e.decorator),directionMap:s.getDirectionMap(n)});return new t(new y(o))},t.fromJS=function(e){return new t(new y(r({},e,{directionMap:null!=e.directionMap?h(e.directionMap):e.directionMap,inlineStyleOverride:null!=e.inlineStyleOverride?u(e.inlineStyleOverride):e.inlineStyleOverride,nativelyRenderedContent:null!=e.nativelyRenderedContent?a.fromJS(e.nativelyRenderedContent):e.nativelyRenderedContent,redoStack:null!=e.redoStack?f(e.redoStack.map((function(e){return a.fromJS(e)}))):e.redoStack,selection:null!=e.selection?new c(e.selection):e.selection,treeMap:null!=e.treeMap?h(e.treeMap).map((function(e){return d(e).map((function(e){return i.fromJS(e)}))})):e.treeMap,undoStack:null!=e.undoStack?f(e.undoStack.map((function(e){return a.fromJS(e)}))):e.undoStack,currentContent:a.fromJS(e.currentContent)})))},t.set=function(e,n){return new t(e.getImmutable().withMutations((function(t){var r=t.get("decorator"),o=r;null===n.decorator?o=null:n.decorator&&(o=n.decorator);var a=n.currentContent||e.getCurrentContent();if(o!==r){var s,c=t.get("treeMap");return s=o&&r?function(e,t,n,r,o){return n.merge(t.toSeq().filter((function(t){return r.getDecorations(t,e)!==o.getDecorations(t,e)})).map((function(t){return i.generate(e,t,r)})))}(a,a.getBlockMap(),c,o,r):v(a,o),void t.merge({decorator:o,treeMap:s,nativelyRenderedContent:null})}a!==e.getCurrentContent()&&t.set("treeMap",function(e,t,n,r){var o=e.getCurrentContent().set("entityMap",n),a=o.getBlockMap();return e.getImmutable().get("treeMap").merge(t.toSeq().filter((function(e,t){return e!==a.get(t)})).map((function(e){return i.generate(o,e,r)})))}(e,a.getBlockMap(),a.getEntityMap(),o)),t.merge(n)})))};var e=t.prototype;function t(e){o(this,"_immutable",void 0),this._immutable=e}return e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(e,n){return t.set(e,{inlineStyleOverride:n})},e.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(null!=e)return e;var t=this.getCurrentContent(),n=this.getSelection();return n.isCollapsed()?function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r>0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):g(e,n)}(t,n):function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r<o.getLength()?o.getInlineStyleAt(r):r>0?o.getInlineStyleAt(r-1):g(e,n)}(t,n)},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(e,t){return b(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),b(e,t,!0)},t.moveSelectionToEnd=function(e){var n=e.getCurrentContent().getLastBlock(),r=n.getKey(),o=n.getLength();return t.acceptSelection(e,new c({anchorKey:r,anchorOffset:o,focusKey:r,focusOffset:o,isBackward:!1}))},t.moveFocusToEnd=function(e){var n=t.moveSelectionToEnd(e);return t.forceSelection(n,n.getSelection())},t.push=function(e,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.getCurrentContent()===n)return e;var i=s.getDirectionMap(n,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:n,directionMap:i,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:null});var a=e.getSelection(),c=e.getCurrentContent(),l=e.getUndoStack(),u=n;a!==c.getSelectionAfter()||function(e,t){return t!==e.getLastChangeType()||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}(e,r)?(l=l.push(c),u=u.set("selectionBefore",a)):"insert-characters"!==r&&"backspace-character"!==r&&"delete-character"!==r||(u=u.set("selectionBefore",c.getSelectionBefore()));var p=e.getInlineStyleOverride();-1===["adjust-depth","change-block-type","split-block"].indexOf(r)&&(p=null);var h={currentContent:u,directionMap:i,undoStack:l,redoStack:f(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:p};return t.set(e,h)},t.undo=function(e){if(!e.getAllowUndo())return e;var n=e.getUndoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:n.shift(),redoStack:e.getRedoStack().push(o),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:o.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var n=e.getRedoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:e.getUndoStack().push(o),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:r.getSelectionAfter()})},e.getImmutable=function(){return this._immutable},t}();function b(e,t,n){return m.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function v(e,t){return e.getBlockMap().map((function(n){return i.generate(e,n,t)})).toOrderedMap()}function g(e,t){var n=e.getBlockMap().reverse().skipUntil((function(e,n){return n===t})).skip(1).skipUntil((function(e,t){return e.getLength()})).first();return n?n.getInlineStyleAt(n.getLength()-1):u()}e.exports=m},7250:(e,t,n)=>{"use strict";var r=n(5858),o=n(9682),i=r.isPlatform("Mac OS X"),a={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return i&&e.altKey},usesMacOSHeuristics:function(){return i},hasCommandModifier:function(e){return i?!!e.metaKey&&!e.altKey:a.isCtrlKeyCommand(e)},isSoftNewlineEvent:o};e.exports=a},1249:()=>{},7126:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(6074),a=n(4356),s={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some((function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()}))},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t,n){switch(t){case"bold":return s.toggleInlineStyle(e,"BOLD");case"italic":return s.toggleInlineStyle(e,"ITALIC");case"underline":return s.toggleInlineStyle(e,"UNDERLINE");case"code":return s.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return s.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return s.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t=e.getSelection();if(!t.isCollapsed()||t.getAnchorOffset()||t.getFocusOffset())return null;var n=e.getCurrentContent(),r=t.getStartKey(),i=n.getBlockBefore(r);if(i&&"atomic"===i.getType()){var a=n.getBlockMap().delete(i.getKey()),c=n.merge({blockMap:a,selectionAfter:t});if(c!==n)return o.push(e,c,"remove-range")}var l=s.tryToRemoveBlockStyle(e);return l?o.push(e,l,"change-block-type"):null},onDelete:function(e){var t=e.getSelection();if(!t.isCollapsed())return null;var n=e.getCurrentContent(),i=t.getStartKey(),a=n.getBlockForKey(i).getLength();if(t.getStartOffset()<a)return null;var s=n.getBlockAfter(i);if(!s||"atomic"!==s.getType())return null;var c=t.merge({focusKey:s.getKey(),focusOffset:s.getLength()}),l=r.removeRange(n,c,"forward");return l!==n?o.push(e,l,"remove-range"):null},onTab:function(e,t,n){var r=t.getSelection(),a=r.getAnchorKey();if(a!==r.getFocusKey())return t;var s=t.getCurrentContent(),c=s.getBlockForKey(a),l=c.getType();if("unordered-list-item"!==l&&"ordered-list-item"!==l)return t;e.preventDefault();var u=c.getDepth();if(!e.shiftKey&&u===n)return t;var p=i(s,r,e.shiftKey?-1:1,n);return o.push(t,p,"adjust-depth")},toggleBlockType:function(e,t){var n=e.getSelection(),i=n.getStartKey(),s=n.getEndKey(),c=e.getCurrentContent(),l=n;if(i!==s&&0===n.getEndOffset()){var u=a(c.getBlockBefore(s));s=u.getKey(),l=l.merge({anchorKey:i,anchorOffset:n.getStartOffset(),focusKey:s,focusOffset:u.getLength(),isBackward:!1})}if(c.getBlockMap().skipWhile((function(e,t){return t!==i})).reverse().skipWhile((function(e,t){return t!==s})).some((function(e){return"atomic"===e.getType()})))return e;var p=c.getBlockForKey(i).getType()===t?"unstyled":t;return o.push(e,r.setBlockType(c,l,p),"change-block-type")},toggleCode:function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=t.getFocusKey();return t.isCollapsed()||n!==r?s.toggleBlockType(e,"code-block"):s.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,t){var n=e.getSelection(),i=e.getCurrentInlineStyle();if(n.isCollapsed())return o.setInlineStyleOverride(e,i.has(t)?i.remove(t):i.add(t));var a,s=e.getCurrentContent();return a=i.has(t)?r.removeInlineStyle(s,n,t):r.applyInlineStyle(s,n,t),o.push(e,a,"change-inline-style")},toggleLink:function(e,t,n){var i=r.applyEntity(e.getCurrentContent(),t,n);return o.push(e,i,"apply-entity")},tryToRemoveBlockStyle:function(e){var t=e.getSelection(),n=t.getAnchorOffset();if(t.isCollapsed()&&0===n){var o=t.getAnchorKey(),i=e.getCurrentContent(),a=i.getBlockForKey(o).getType(),s=i.getBlockBefore(o);if("code-block"===a&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==a)return r.setBlockType(i,t,"unstyled")}return null}};e.exports=s},7158:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(4422),a=n(4356),s=null,c={cut:function(e){var t=e.getCurrentContent(),n=e.getSelection(),c=null;if(n.isCollapsed()){var l=n.getAnchorKey(),u=t.getBlockForKey(l).getLength();if(u===n.getAnchorOffset()){var p=t.getKeyAfter(l);if(null==p)return e;c=n.set("focusKey",p).set("focusOffset",0)}else c=n.set("focusOffset",u)}else c=n;c=a(c),s=i(t,c);var f=r.removeRange(t,c,"forward");return f===t?e:o.push(e,f,"remove-range")},paste:function(e){if(!s)return e;var t=r.replaceWithFragment(e.getCurrentContent(),e.getSelection(),s);return o.push(e,t,"insert-fragment")}};e.exports=c},9737:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},o.getAnchorKey=function(){return this.get("anchorKey")},o.getAnchorOffset=function(){return this.get("anchorOffset")},o.getFocusKey=function(){return this.get("focusKey")},o.getFocusOffset=function(){return this.get("focusOffset")},o.getIsBackward=function(){return this.get("isBackward")},o.getHasFocus=function(){return this.get("hasFocus")},o.hasEdgeWithin=function(e,t,n){var r=this.getAnchorKey(),o=this.getFocusKey();if(r===o&&r===e){var i=this.getStartOffset(),a=this.getEndOffset();return t<=i&&i<=n||t<=a&&a<=n}if(e!==r&&e!==o)return!1;var s=e===r?this.getAnchorOffset():this.getFocusOffset();return t<=s&&n>=s},o.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},o.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},o.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},o.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},o.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},r.createEmpty=function(e){return new r({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},r}((0,n(7325).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=r},6074:e=>{"use strict";e.exports=function(e,t,n,r){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat([[i,a.get(i)]]).map((function(e){var t=e.getDepth()+n;return t=Math.max(0,Math.min(t,r)),e.set("depth",t)}));return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}},4012:(e,t,n)=>{"use strict";var r=n(9462);e.exports=function(e,t,n,o){for(var i=t,a=e.getCharacterList();i<n;)a=a.set(i,r.applyEntity(a.get(i),o)),i++;return e.set("characterList",a)}},6820:(e,t,n)=>{"use strict";var r=n(4012),o=n(7325);e.exports=function(e,t,n){var i=e.getBlockMap(),a=t.getStartKey(),s=t.getStartOffset(),c=t.getEndKey(),l=t.getEndOffset(),u=i.skipUntil((function(e,t){return t===a})).takeUntil((function(e,t){return t===c})).toOrderedMap().merge(o.OrderedMap([[c,i.get(c)]])).map((function(e,t){var o=t===a?s:0,i=t===c?l:e.getLength();return r(e,o,i,n)}));return e.merge({blockMap:i.merge(u),selectionBefore:t,selectionAfter:t})}},2034:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(5972),i=n(820),a=n(7651),s=n(5141),c=n(2266),l=n(1634),u=function(e,t){return{key:e.getKey(),text:e.getText(),type:e.getType(),depth:e.getDepth(),inlineStyleRanges:c(e),entityRanges:s(e,t),data:e.getData().toObject()}};e.exports=function(e){var t={entityMap:{},blocks:[]};return t=function(e,t){var n=t.entityMap,s=[],c={},p={},f=0;return e.getBlockMap().forEach((function(e){e.findEntityRanges((function(e){return null!==e.getEntity()}),(function(t){var r=e.getEntityAt(t),o=a.stringify(r);p[o]||(p[o]=r,n[o]="".concat(f),f++)})),function(e,t,n,a){if(e instanceof o)n.push(u(e,t));else{e instanceof i||l(!1);var s=e.getParentKey(),c=a[e.getKey()]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},u(e,t),{children:[]});s?a[s].children.push(c):n.push(c)}}(e,n,s,c)})),{blocks:s,entityMap:n}}(e,t),t=function(e,t){var n=t.blocks,r=t.entityMap,o={};return Object.keys(r).forEach((function(t,n){var r=e.getEntity(a.unstringify(t));o[n]={type:r.getType(),mutability:r.getMutability(),data:r.getData()}})),{blocks:n,entityMap:o}}(e,t),t}},3196:(e,t,n)=>{"use strict";var r;function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(9462),s=n(5972),c=n(820),l=n(5511),u=n(9076),p=n(528),f=n(9863),h=n(9947),d=n(4828),y=n(1854),m=n(7325),b=m.List,v=m.Map,g=m.OrderedSet,w=n(5728),E=n(9459),S=n(5343),O=n(6500),_=y("draft_tree_data_support"),P=new RegExp("\r","g"),k=new RegExp("\n","g"),j=new RegExp("^\n","g"),C=new RegExp("&nbsp;","g"),T=new RegExp("&#13;?","g"),x=new RegExp("&#8203;?","g"),D=["bold","bolder","500","600","700","800","900"],N=["light","lighter","normal","100","200","300","400"],R=["className","href","rel","target","title"],M=["alt","className","height","src","width"],I=(i(r={},f("public/DraftStyleDefault/depth0"),0),i(r,f("public/DraftStyleDefault/depth1"),1),i(r,f("public/DraftStyleDefault/depth2"),2),i(r,f("public/DraftStyleDefault/depth3"),3),i(r,f("public/DraftStyleDefault/depth4"),4),r),A=v({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),L=function(e){return S(e)&&e.style.fontFamily.includes("monospace")?"CODE":null},B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(I).some((function(n){e.classList.contains(n)&&(t=I[n])})),t},F=function(e){if(!w(e))return!1;var t=e;if(!t.href||"http:"!==t.protocol&&"https:"!==t.protocol&&"mailto:"!==t.protocol&&"tel:"!==t.protocol)return!1;try{return new p(t.href),!0}catch(e){return!1}},U=function(e){if(!O(e))return!1;var t=e;return!(!t.attributes.getNamedItem("src")||!t.attributes.getNamedItem("src").value)},q=function(e,t){if(!S(e))return t;var n=e,r=n.style.fontWeight,o=n.style.fontStyle,i=n.style.textDecoration;return t.withMutations((function(e){D.indexOf(r)>=0?e.add("BOLD"):N.indexOf(r)>=0&&e.remove("BOLD"),"italic"===o?e.add("ITALIC"):"normal"===o&&e.remove("ITALIC"),"underline"===i&&e.add("UNDERLINE"),"line-through"===i&&e.add("STRIKETHROUGH"),"none"===i&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}))},K=function(e){return"ul"===e||"ol"===e},V=function(){function e(e,t){i(this,"characterList",b()),i(this,"currentBlockType","unstyled"),i(this,"currentDepth",0),i(this,"currentEntity",null),i(this,"currentText",""),i(this,"wrapper",null),i(this,"blockConfigs",[]),i(this,"contentBlocks",[]),i(this,"entityMap",u),i(this,"blockTypeMap",void 0),i(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=e,this.disambiguate=t}var t=e.prototype;return t.clear=function(){this.characterList=b(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=u,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(e){var t;return this.contentBlocks=[],this.currentDepth=0,(t=this.blockConfigs).push.apply(t,this._toBlockConfigs([e],g())),this._trimCurrentText(),""!==this.currentText&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return 0===this.contentBlocks.length&&(_?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=o({key:e.key||h(),type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:b(),prevSibling:null,nextSibling:null,childConfigs:[]},e);return this.characterList=b(),this.currentBlockType="unstyled",this.currentText="",t},t._toBlockConfigs=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=o.nodeName.toLowerCase();if("body"===i||K(i)){this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var a=this.currentDepth,s=this.wrapper;K(i)&&(this.wrapper=i,K(s)&&this.currentDepth++),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),t)),this.currentDepth=a,this.wrapper=s}else{var c=this.blockTypeMap.get(i);if(void 0===c)if("#text"!==i)if("br"!==i)if(U(o))this._addImgNode(o,t);else if(F(o))this._addAnchorNode(o,n,t);else{var l=t;A.has(i)&&(l=l.add(A.get(i))),l=q(o,l);var u=L(o);null!=u&&(l=l.add(u)),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),l))}else this._addBreakNode(o,t);else this._addTextNode(o,t);else{this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var p=this.currentDepth,f=this.wrapper;if(this.wrapper="pre"===i?"pre":this.wrapper,"string"!=typeof c&&(c=this.disambiguate(i,this.wrapper)||c[0]||"unstyled"),!_&&S(o)&&("unordered-list-item"===c||"ordered-list-item"===c)){var d=o;this.currentDepth=B(d,this.currentDepth)}var y=h(),m=this._toBlockConfigs(Array.from(o.childNodes),t);this._trimCurrentText(),n.push(this._makeBlockConfig({key:y,childConfigs:m,type:c})),this.currentDepth=p,this.wrapper=f}}}return n},t._appendText=function(e,t){var n;this.currentText+=e;var r=a.create({style:t,entity:this.currentEntity});this.characterList=(n=this.characterList).push.apply(n,Array(e.length).fill(r))},t._trimCurrentText=function(){var e=this.currentText.length,t=e-this.currentText.trimLeft().length,n=this.currentText.trimRight().length,r=this.characterList.findEntry((function(e){return null!==e.getEntity()}));(t=void 0!==r?Math.min(t,r[0]):t)>(n=void 0!==(r=this.characterList.reverse().findEntry((function(e){return null!==e.getEntity()})))?Math.max(n,e-r[0]):n)?(this.currentText="",this.characterList=b()):(this.currentText=this.currentText.slice(t,n),this.characterList=this.characterList.slice(t,n))},t._addTextNode=function(e,t){var n=e.textContent;""===n.trim()&&"pre"!==this.wrapper&&(n=" "),"pre"!==this.wrapper&&(n=(n=n.replace(j,"")).replace(k," ")),this._appendText(n,t)},t._addBreakNode=function(e,t){E(e)&&this._appendText("\n",t)},t._addImgNode=function(e,t){if(O(e)){var n=e,r={};M.forEach((function(e){var t=n.getAttribute(e);t&&(r[e]=t)})),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",r),y("draftjs_fix_paste_for_img")?"presentation"!==n.getAttribute("role")&&this._appendText("📷",t):this._appendText("📷",t),this.currentEntity=null}},t._addAnchorNode=function(e,t,n){if(w(e)){var r=e,o={};R.forEach((function(e){var t=r.getAttribute(e);t&&(o[e]=t)})),o.url=new p(r.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",o||{}),t.push.apply(t,this._toBlockConfigs(Array.from(e.childNodes),n)),this.currentEntity=null}},t._toContentBlocks=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.length-1,r=0;r<=n;r++){var i=e[r];i.parent=t,i.prevSibling=r>0?e[r-1].key:null,i.nextSibling=r<n?e[r+1].key:null,i.children=b(i.childConfigs.map((function(e){return e.key}))),this.contentBlocks.push(new c(o({},i))),this._toContentBlocks(i.childConfigs,i.key)}},t._hoistContainersInBlockConfigs=function(e){var t=this;return b(e).flatMap((function(e){return"unstyled"!==e.type||""!==e.text?[e]:t._hoistContainersInBlockConfigs(e.childConfigs)}))},t._toFlatContentBlocks=function(e){var t=this;this._hoistContainersInBlockConfigs(e).forEach((function(e){var n=t._extractTextFromBlockConfigs(e.childConfigs),r=n.text,i=n.characterList;t.contentBlocks.push(new s(o({},e,{text:e.text+r,characterList:e.characterList.concat(i)})))}))},t._extractTextFromBlockConfigs=function(e){for(var t=e.length-1,n="",r=b(),o=0;o<=t;o++){var i=e[o];n+=i.text,r=r.concat(i.characterList),""!==n&&"unstyled"!==i.type&&(n+="\n",r=r.push(r.last()));var a=this._extractTextFromBlockConfigs(i.childConfigs);n+=a.text,r=r.concat(a.characterList)}return{text:n,characterList:r}},e}();e.exports=function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:d)(e=e.trim().replace(P,"").replace(C," ").replace(T,"").replace(x,""));if(!n)return null;var r=function(e){var t={};return e.mapKeys((function(e,n){var r=[n.element];void 0!==n.aliasedElements&&r.push.apply(r,n.aliasedElements),r.forEach((function(n){void 0===t[n]?t[n]=e:"string"==typeof t[n]?t[n]=[t[n],e]:t[n].push(e)}))})),v(t)}(t);return new V(r,(function(e,t){return"li"===e?"ol"===t?"ordered-list-item":"unordered-list-item":null})).addDOMNode(n).getContentBlocks()}},7088:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(5972),a=n(820),s=n(4396),c=n(9076),l=n(7296),u=(n(6318),n(9737)),p=n(4031),f=n(9709),h=n(3762),d=n(9947),y=n(1854),m=n(7325),b=n(1634),v=y("draft_tree_data_support"),g=m.List,w=m.Map,E=m.OrderedMap,S=function(e,t){var n=e.key,r=e.type,o=e.data;return{text:e.text,depth:e.depth||0,type:r||"unstyled",key:n||d(),data:w(o),characterList:O(e,t)}},O=function(e,t){var n=e.text,o=e.entityRanges,i=e.inlineStyleRanges,a=o||[];return p(h(n,i||[]),f(n,a.filter((function(e){return t.hasOwnProperty(e.key)})).map((function(e){return r({},e,{key:t[e.key]})}))))},_=function(e){return r({},e,{key:e.key||d()})},P=function(e,t,n){var o=t.map((function(e){return r({},e,{parentRef:n})}));return e.concat(o.reverse())};e.exports=function(e){Array.isArray(e.blocks)||b(!1);var t=function(e){var t=e.entityMap,n={};return Object.keys(t).forEach((function(e){var r=t[e],o=r.type,i=r.mutability,a=r.data;n[e]=c.__create(o,i,a||{})})),n}(e),n=function(e,t){var n=e.blocks.find((function(e){return Array.isArray(e.children)&&e.children.length>0})),o=v&&!n?l.fromRawStateToRawTreeState(e).blocks:e.blocks;if(!v)return function(e,t){return E(e.map((function(e){var n=new i(S(e,t));return[n.getKey(),n]})))}(n?l.fromRawTreeStateToRawState(e).blocks:o,t);var s=function(e,t){return e.map(_).reduce((function(n,o,i){Array.isArray(o.children)||b(!1);var s=o.children.map(_),c=new a(r({},S(o,t),{prevSibling:0===i?null:e[i-1].key,nextSibling:i===e.length-1?null:e[i+1].key,children:g(s.map((function(e){return e.key})))}));n=n.set(c.getKey(),c);for(var l=P([],s,c);l.length>0;){var u=l.pop(),p=u.parentRef,f=p.getChildKeys(),h=f.indexOf(u.key),d=Array.isArray(u.children);if(!d){d||b(!1);break}var y=u.children.map(_),m=new a(r({},S(u,t),{parent:p.getKey(),children:g(y.map((function(e){return e.key}))),prevSibling:0===h?null:f.get(h-1),nextSibling:h===f.size-1?null:f.get(h+1)}));n=n.set(m.getKey(),m),l=P(l,y,m)}return n}),E())}(o,t);return s}(e,t),o=n.isEmpty()?new u:u.createEmpty(n.first().getKey());return new s({blockMap:n,entityMap:t,selectionBefore:o,selectionAfter:o})}},4031:(e,t,n)=>{"use strict";var r=n(9462),o=n(7325).List;e.exports=function(e,t){var n=e.map((function(e,n){var o=t[n];return r.create({style:e,entity:o})}));return o(n)}},9709:(e,t,n)=>{"use strict";var r=n(7912).substr;e.exports=function(e,t){var n=Array(e.length).fill(null);return t&&t.forEach((function(t){for(var o=r(e,0,t.offset).length,i=o+r(e,t.offset,t.length).length,a=o;a<i;a++)n[a]=t.key})),n}},3762:(e,t,n)=>{"use strict";var r=n(7912),o=n(7325).OrderedSet,i=r.substr,a=o();e.exports=function(e,t){var n=Array(e.length).fill(a);return t&&t.forEach((function(t){for(var r=i(e,0,t.offset).length,o=r+i(e,t.offset,t.length).length;r<o;)n[r]=n[r].add(t.style),r++})),n}},8875:e=>{"use strict";e.exports={notEmptyKey:function(e){return null!=e&&""!=e}}},3902:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(5858),a=n(4179),s=n(7884),c=n(4875),l=n(4356),u=n(1225),p=i.isBrowser("Firefox");function f(e,t,n,i,a){var s=r.replaceText(e.getCurrentContent(),e.getSelection(),t,n,i);return o.push(e,s,"insert-characters",a)}e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e._latestEditorState,r=t.data;if(r)if(e.props.handleBeforeInput&&s(e.props.handleBeforeInput(r,n,t.timeStamp)))t.preventDefault();else{var i=n.getSelection(),h=i.getStartOffset(),d=i.getAnchorKey();if(!i.isCollapsed())return t.preventDefault(),void e.update(f(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!0));var y,m=f(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!1),b=!1;if(b||(b=c(e._latestCommittedEditorState)),!b){var v=n.getBlockTree(d),g=m.getBlockTree(d);b=v.size!==g.size||v.zip(g).some((function(e){var t=e[0],n=e[1],o=t.get("start"),i=o+(o>=h?r.length:0),a=t.get("end"),s=a+(a>=h?r.length:0),c=n.get("start"),l=n.get("end"),u=n.get("decoratorKey");return t.get("decoratorKey")!==u||t.get("leaves").size!==n.get("leaves").size||i!==c||s!==l||null!=u&&l-c!=a-o}))}if(b||(y=r,b=p&&("'"==y||"/"==y)),b||(b=l(m.getDirectionMap()).get(d)!==l(n.getDirectionMap()).get(d)),b)return t.preventDefault(),m=o.set(m,{forceSelection:!0}),void e.update(m);m=o.set(m,{nativelyRenderedContent:m.getCurrentContent()}),e._pendingStateFromBeforeInput=m,u((function(){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)}))}}},4750:(e,t,n)=>{"use strict";var r=n(6366),o=n(9089),i=n(8410);e.exports=function(e,t){var n=t.currentTarget.ownerDocument;if(!Boolean(e.props.preserveSelectionOnBlur)&&i(n)===n.body){var a=n.defaultView.getSelection(),s=e.editor;1===a.rangeCount&&o(s,a.anchorNode)&&o(s,a.focusNode)&&a.removeAllRanges()}var c=e._latestEditorState,l=c.getSelection();if(l.getHasFocus()){var u=l.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(r.acceptSelection(c,u))}}},2825:(e,t,n)=>{"use strict";var r=n(6366);e.exports=function(e,t){e.setMode("composite"),e.update(r.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}},4074:(e,t,n)=>{"use strict";var r=n(6700);e.exports=function(e,t){e._latestEditorState.getSelection().isCollapsed()?t.preventDefault():e.setClipboard(r(e._latestEditorState))}},7643:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(1115),a=n(6700),s=n(8284),c=n(6248);e.exports=function(e,t){var n,l=e._latestEditorState,u=l.getSelection(),p=t.target;if(u.isCollapsed())t.preventDefault();else{if(c(p)){var f=p;n=s(i.getScrollParent(f))}var h=a(l);e.setClipboard(h),e.setMode("cut"),setTimeout((function(){e.restoreEditorDOM(n),e.exitCurrentMode(),e.update(function(e){var t=r.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return o.push(e,t,"remove-range")}(l))}),0)}}},1723:e=>{"use strict";e.exports=function(e,t){e.setMode("drag"),t.preventDefault()}},3625:e=>{"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},419:(e,t,n)=>{"use strict";var r=n(6366),o=n(5858);e.exports=function(e,t){var n=e._latestEditorState,i=n.getSelection();if(!i.getHasFocus()){var a=i.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),o.isBrowser("Chrome < 60.0.3081.0")?e.update(r.forceSelection(n,a)):e.update(r.acceptSelection(n,a))}}},8295:(e,t,n)=>{"use strict";var r=n(1942),o=n(6449),i=n(6366),a=n(5858),s=n(8875).notEmptyKey,c=n(8704),l=n(3081),u=n(4356),p=a.isEngine("Gecko");e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e.editor.ownerDocument.defaultView.getSelection(),a=n.anchorNode,f=n.isCollapsed,h=(null==a?void 0:a.nodeType)!==Node.TEXT_NODE&&(null==a?void 0:a.nodeType)!==Node.ELEMENT_NODE;if(null!=a&&!h){if(a.nodeType===Node.TEXT_NODE&&(null!==a.previousSibling||null!==a.nextSibling)){var d=a.parentNode;if(null==d)return;a.nodeValue=d.textContent;for(var y=d.firstChild;null!=y;y=y.nextSibling)y!==a&&d.removeChild(y)}var m=a.textContent,b=e._latestEditorState,v=u(c(a)),g=o.decode(v),w=g.blockKey,E=g.decoratorKey,S=g.leafKey,O=b.getBlockTree(w).getIn([E,"leaves",S]),_=O.start,P=O.end,k=b.getCurrentContent(),j=k.getBlockForKey(w),C=j.getText().slice(_,P);if(m.endsWith("\n\n")&&(m=m.slice(0,-1)),m!==C){var T,x,D,N,R=b.getSelection(),M=R.merge({anchorOffset:_,focusOffset:P,isBackward:!1}),I=j.getEntityAt(_),A=s(I)?k.getEntity(I):null,L="MUTABLE"===(null!=A?A.getMutability():null),B=L?"spellcheck-change":"apply-entity",F=r.replaceText(k,M,m,j.getInlineStyleAt(_),L?j.getEntityAt(_):null);if(p)T=n.anchorOffset,x=n.focusOffset,N=(D=_+Math.min(T,x))+Math.abs(T-x),T=D,x=N;else{var U=m.length-C.length;D=R.getStartOffset(),N=R.getEndOffset(),T=f?N+U:D,x=N+U}var q=F.merge({selectionBefore:k.getSelectionAfter(),selectionAfter:R.merge({anchorOffset:T,focusOffset:x})});e.update(i.push(b,q,B))}else{var K=t.nativeEvent.inputType;if(K){var V=function(e,t){return"deleteContentBackward"===e?l(t):t}(K,b);if(V!==b)return e.restoreEditorDOM(),void e.update(V)}}}}},1116:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(7250),a=n(1896),s=n(7158),c=n(5858),l=n(7884),u=n(5039),p=n(9539),f=n(513),h=n(2851),d=n(1501),y=n(6538),m=n(3081),b=n(9603),v=n(5155),g=n(3036),w=i.isOptionKeyCommand,E=c.isBrowser("Chrome");e.exports=function(e,t){var n=t.which,i=e._latestEditorState;function c(n){var r=e.props[n];return!!r&&(r(t),!0)}switch(n){case a.RETURN:if(t.preventDefault(),e.props.handleReturn&&l(e.props.handleReturn(t,i)))return;break;case a.ESC:if(t.preventDefault(),c("onEscape"))return;break;case a.TAB:if(c("onTab"))return;break;case a.UP:if(c("onUpArrow"))return;break;case a.RIGHT:if(c("onRightArrow"))return;break;case a.DOWN:if(c("onDownArrow"))return;break;case a.LEFT:if(c("onLeftArrow"))return;break;case a.SPACE:E&&w(t)&&t.preventDefault()}var S=e.props.keyBindingFn(t);if(null!=S&&""!==S)if("undo"!==S){if(t.preventDefault(),!e.props.handleKeyCommand||!l(e.props.handleKeyCommand(S,i,t.timeStamp))){var O=function(e,t,n){switch(e){case"redo":return o.redo(t);case"delete":return b(t);case"delete-word":return f(t);case"backspace":return m(t);case"backspace-word":return p(t);case"backspace-to-start-of-line":return u(t,n);case"split-block":return h(t);case"transpose-characters":return v(t);case"move-selection-to-start-of-block":return y(t);case"move-selection-to-end-of-block":return d(t);case"secondary-cut":return s.cut(t);case"secondary-paste":return s.paste(t);default:return t}}(S,i,t);O!==i&&e.update(O)}}else g(t,i,e.update);else if(n===a.SPACE&&E&&w(t)){var _=r.replaceText(i.getCurrentContent(),i.getSelection()," ");e.update(o.push(i,_,"insert-characters"))}}},7692:(e,t,n)=>{"use strict";var r=n(2480),o=n(9462),i=n(5487),a=n(1942),s=n(6754),c=n(6366),l=n(7126),u=n(4179),p=n(3175),f=n(7884),h=n(1976);function d(e,t,n){var r=a.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return c.push(e,r.set("entityMap",n),"insert-fragment")}e.exports=function(e,t){t.preventDefault();var n=new i(t.clipboardData);if(!n.isRichText()){var y=n.getFiles(),m=n.getText();if(y.length>0){if(e.props.handlePastedFiles&&f(e.props.handlePastedFiles(y)))return;return void p(y,(function(t){if(t=t||m){var n=e._latestEditorState,i=h(t),p=o.create({style:n.getCurrentInlineStyle(),entity:u(n.getCurrentContent(),n.getSelection())}),f=l.getCurrentBlockType(n),d=s.processText(i,p,f),y=r.createFromArray(d),b=a.replaceWithFragment(n.getCurrentContent(),n.getSelection(),y);e.update(c.push(n,b,"insert-fragment"))}}))}}var b=[],v=n.getText(),g=n.getHTML(),w=e._latestEditorState;if(e.props.formatPastedText){var E=e.props.formatPastedText(v,g);v=E.text,g=E.html}if(!e.props.handlePastedText||!f(e.props.handlePastedText(v,g,w))){if(v&&(b=h(v)),!e.props.stripPastedStyles){var S,O=e.getClipboard();if(!e.props.formatPastedText&&n.isRichText()&&O){if(-1!==(null===(S=g)||void 0===S?void 0:S.indexOf(e.getEditorKey()))||1===b.length&&1===O.size&&O.first().getText()===v)return void e.update(d(e._latestEditorState,O))}else if(O&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&function(e,t){return e.length===t.size&&t.valueSeq().every((function(t,n){return t.getText()===e[n]}))}(b,O))return void e.update(d(e._latestEditorState,O));if(g){var _=s.processHTML(g,e.props.blockRenderMap);if(_){var P=_.contentBlocks,k=_.entityMap;if(P){var j=r.createFromArray(P);return void e.update(d(e._latestEditorState,j,k))}}}e.setClipboard(null)}if(b.length){var C=o.create({style:w.getCurrentInlineStyle(),entity:u(w.getCurrentContent(),w.getSelection())}),T=l.getCurrentBlockType(w),x=s.processText(b,C,T),D=r.createFromArray(x);e.update(d(e._latestEditorState,D))}}}},672:(e,t,n)=>{"use strict";var r=n(7248),o=n(6366),i=n(424),a=n(6652);e.exports=function(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState.getSelection();r.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:(new Error).stack}),selectionState:JSON.stringify(t.toJS())})}}else{var n=e.props.editorState,s=a(n,i(e)),c=s.selectionState;c!==n.getSelection()&&(n=s.needsRecovery?o.forceSelection(n,c):o.acceptSelection(n,c),e.update(n))}}},5141:(e,t,n)=>{"use strict";var r=n(7651),o=n(7912).strlen;e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return!!e.getEntity()}),(function(i,a){var s=e.getText(),c=e.getEntityAt(i);n.push({offset:o(s.slice(0,i)),length:o(s.slice(i,a)),key:Number(t[r.stringify(c)])})})),n}},2266:(e,t,n)=>{"use strict";var r=n(7912),o=n(7367),i=function(e,t){return e===t},a=function(e){return!!e},s=[];e.exports=function(e){var t=e.getCharacterList().map((function(e){return e.getStyle()})).toList(),n=t.flatten().toSet().map((function(n){return function(e,t,n){var s=[],c=t.map((function(e){return e.has(n)})).toList();return o(c,i,a,(function(t,o){var i=e.getText();s.push({offset:r.strlen(i.slice(0,t)),length:r.strlen(i.slice(t,o)),style:n})})),s}(e,t,n)}));return Array.prototype.concat.apply(s,n.toJS())}},4505:(e,t,n)=>{"use strict";var r=n(7912),o=n(3001),i=n(1061),a=n(1634);function s(e,t){for(var n=1/0,r=1/0,o=-1/0,i=-1/0,a=0;a<e.length;a++){var s=e[a];0!==s.width&&1!==s.width&&(n=Math.min(n,s.top),r=Math.min(r,s.bottom),o=Math.max(o,s.top),i=Math.max(i,s.bottom))}return o<=r&&o-n<t&&i-r<t}function c(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}e.exports=function(e){e.collapsed||a(!1);var t=(e=e.cloneRange()).startContainer;1!==t.nodeType&&(t=t.parentNode);var n=function(e){var t=getComputedStyle(e),n=o(e),r=n.createElement("div");r.style.fontFamily=t.fontFamily,r.style.fontSize=t.fontSize,r.style.fontStyle=t.fontStyle,r.style.fontWeight=t.fontWeight,r.style.lineHeight=t.lineHeight,r.style.position="absolute",r.textContent="M";var i=n.body;i||a(!1),i.appendChild(r);var s=r.getBoundingClientRect();return i.removeChild(r),s.height}(t),l=e.endContainer,u=e.endOffset;for(e.setStart(e.startContainer,0);s(i(e),n)&&(l=e.startContainer,u=e.startOffset,l.parentNode||a(!1),e.setStartBefore(l),1!==l.nodeType||"inline"===getComputedStyle(l).display););for(var p=l,f=u-1;;){for(var h=p.nodeValue,d=f;d>=0;d--)if(!(null!=h&&d>0&&r.isSurrogatePair(h,d-1))){if(e.setStart(p,d),!s(i(e),n))break;l=p,u=d}if(-1===d||0===p.childNodes.length)break;f=c(p=p.childNodes[d])}return e.setStart(l,u),e}},8704:(e,t,n)=>{"use strict";var r=n(3001),o=n(2537);e.exports=function(e){for(var t=e;t&&t!==r(e).documentElement;){var n=o(t);if(null!=n)return n;t=t.parentNode}return null}},7367:e=>{"use strict";e.exports=function(e,t,n,r){if(e.size){var o=0;e.reduce((function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i})),n(e.last())&&r(o,e.count())}}},9947:e=>{"use strict";var t={},n=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||t.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*n).toString(32);return t[e]=!0,e}},8640:(e,t,n)=>{"use strict";var r=n(1034),o=n(379),i=n(1634);function a(e,t,n,a,s,c,l){var u=n.getStartOffset(),p=n.getEndOffset(),f=e.__get(s).getMutability(),h=l?u:p;if("MUTABLE"===f)return n;var d=o(t,s).filter((function(e){return h<=e.end&&h>=e.start}));1!=d.length&&i(!1);var y=d[0];if("IMMUTABLE"===f)return n.merge({anchorOffset:y.start,focusOffset:y.end,isBackward:!1});c||(l?p=y.end:u=y.start);var m=r.getRemovalRange(u,p,t.getText().slice(y.start,y.end),y.start,a);return n.merge({anchorOffset:m.start,focusOffset:m.end,isBackward:!1})}e.exports=function(e,t,n,r,o){var i=r.getStartOffset(),s=r.getEndOffset(),c=t.getEntityAt(i),l=n.getEntityAt(s-1);if(!c&&!l)return r;var u=r;if(c&&c===l)u=a(e,t,u,o,c,!0,!0);else if(c&&l){var p=a(e,t,u,o,c,!1,!0),f=a(e,n,u,o,l,!1,!1);u=u.merge({anchorOffset:p.getAnchorOffset(),focusOffset:f.getFocusOffset(),isBackward:!1})}else if(c){var h=a(e,t,u,o,c,!1,!0);u=u.merge({anchorOffset:h.getStartOffset(),isBackward:!1})}else if(l){var d=a(e,n,u,o,l,!1,!1);u=u.merge({focusOffset:d.getEndOffset(),isBackward:!1})}return u}},424:(e,t,n)=>{"use strict";var r=n(1634),o=n(5343);e.exports=function(e){var t=e.editorContainer;return t||r(!1),o(t.firstChild)||r(!1),t.firstChild}},4422:(e,t,n)=>{"use strict";var r=n(8906),o=n(3320);e.exports=function(e,t){var n=t.getStartKey(),i=t.getStartOffset(),a=t.getEndKey(),s=t.getEndOffset(),c=o(e,t).getBlockMap(),l=c.keySeq(),u=l.indexOf(n),p=l.indexOf(a)+1;return r(c.slice(u,p).map((function(e,t){var r=e.getText(),o=e.getCharacterList();return n===a?e.merge({text:r.slice(i,s),characterList:o.slice(i,s)}):t===n?e.merge({text:r.slice(i),characterList:o.slice(i)}):t===a?e.merge({text:r.slice(0,s),characterList:o.slice(0,s)}):e})))}},3001:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},1727:(e,t,n)=>{"use strict";var r=n(7250),o=n(1896),i=n(5858),a=i.isPlatform("Mac OS X"),s=a&&i.isBrowser("Firefox < 29"),c=r.hasCommandModifier,l=r.isCtrlKeyCommand;function u(e){return a&&e.altKey||l(e)}e.exports=function(e){switch(e.keyCode){case 66:return c(e)?"bold":null;case 68:return l(e)?"delete":null;case 72:return l(e)?"backspace":null;case 73:return c(e)?"italic":null;case 74:return c(e)?"code":null;case 75:return a&&l(e)?"secondary-cut":null;case 77:case 79:return l(e)?"split-block":null;case 84:return a&&l(e)?"transpose-characters":null;case 85:return c(e)?"underline":null;case 87:return a&&l(e)?"backspace-word":null;case 89:return l(e)?a?"secondary-paste":"redo":null;case 90:return function(e){return c(e)?e.shiftKey?"redo":"undo":null}(e)||null;case o.RETURN:return"split-block";case o.DELETE:return function(e){return!a&&e.shiftKey?null:u(e)?"delete-word":"delete"}(e);case o.BACKSPACE:return function(e){return c(e)&&a?"backspace-to-start-of-line":u(e)?"backspace-word":"backspace"}(e);case o.LEFT:return s&&c(e)?"move-selection-to-start-of-block":null;case o.RIGHT:return s&&c(e)?"move-selection-to-end-of-block":null;default:return null}}},6652:(e,t,n)=>{"use strict";var r=n(9051);e.exports=function(e,t){var n=t.ownerDocument.defaultView.getSelection(),o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,s=n.focusOffset;return 0===n.rangeCount||null==o||null==a?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:r(e,t,o,i,a,s)}},9051:(e,t,n)=>{"use strict";var r=n(8704),o=n(2537),i=n(9086),a=n(1634),s=n(2004),c=n(4356);function l(e,t,n){var i=t,l=r(i);if(null!=l||e&&(e===i||e.firstChild===i)||a(!1),e===i&&(i=i.firstChild,s(i)||a(!1),"true"!==i.getAttribute("data-contents")&&a(!1),n>0&&(n=i.childNodes.length)),0===n){var p=null;if(null!=l)p=l;else{var f=function(e){for(;e.firstChild&&(s(e.firstChild)&&"true"===e.firstChild.getAttribute("data-blocks")||o(e.firstChild));)e=e.firstChild;return e}(i);p=c(o(f))}return{key:p,offset:0}}var h=i.childNodes[n-1],d=null,y=null;if(o(h)){var m=function(e){for(;e.lastChild&&(s(e.lastChild)&&"true"===e.lastChild.getAttribute("data-blocks")||o(e.lastChild));)e=e.lastChild;return e}(h);d=c(o(m)),y=u(m)}else d=c(l),y=u(h);return{key:d,offset:y}}function u(e){var t=e.textContent;return"\n"===t?0:t.length}e.exports=function(e,t,n,o,a,s){var u=n.nodeType===Node.TEXT_NODE,p=a.nodeType===Node.TEXT_NODE;if(u&&p)return{selectionState:i(e,c(r(n)),o,c(r(a)),s),needsRecovery:!1};var f=null,h=null,d=!0;return u?(f={key:c(r(n)),offset:o},h=l(t,a,s)):p?(h={key:c(r(a)),offset:s},f=l(t,n,o)):(f=l(t,n,o),h=l(t,a,s),n===a&&o===s&&(d=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:i(e,f.key,f.offset,h.key,h.offset),needsRecovery:d}}},4179:(e,t,n)=>{"use strict";var r=n(8875).notEmptyKey;function o(e,t){return r(t)&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var n;if(t.isCollapsed()){var r=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(n=e.getBlockForKey(r).getEntityAt(i-1))!==e.getBlockForKey(r).getEntityAt(i)?null:o(e.getEntityMap(),n):null}var a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a);return n=s===c.getLength()?null:c.getEntityAt(s),o(e.getEntityMap(),n)}},6700:(e,t,n)=>{"use strict";var r=n(4422);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:r(e.getCurrentContent(),t)}},4884:(e,t,n)=>{"use strict";var r=n(820);e.exports=function(e,t){if(!(e instanceof r))return null;var n=e.getNextSiblingKey();if(n)return n;var o=e.getParentKey();if(!o)return null;for(var i=t.get(o);i&&!i.getNextSiblingKey();){var a=i.getParentKey();i=a?t.get(a):null}return i?i.getNextSiblingKey():null}},5339:e=>{"use strict";e.exports=function(e){return Object.keys(e).map((function(t){return e[t]}))}},8494:(e,t,n)=>{"use strict";var r=n(1061);e.exports=function(e){var t=r(e),n=0,o=0,i=0,a=0;if(t.length){if(t.length>1&&0===t[0].width){var s=t[1];n=s.top,o=s.right,i=s.bottom,a=s.left}else{var c=t[0];n=c.top,o=c.right,i=c.bottom,a=c.left}for(var l=1;l<t.length;l++){var u=t[l];0!==u.height&&0!==u.width&&(n=Math.min(n,u.top),o=Math.max(o,u.right),i=Math.max(i,u.bottom),a=Math.min(a,u.left))}}return{top:n,right:o,bottom:i,left:a,width:o-a,height:i-n}}},1061:(e,t,n)=>{"use strict";var r=n(5858),o=n(1634),i=r.isBrowser("Chrome")?function(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;null!=r;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var a,s=Array.from(t.getClientRects());if(n.push(s),i)return n.reverse(),(a=[]).concat.apply(a,n);t.setEndBefore(r)}o(!1)}:function(e){return Array.from(e.getClientRects())};e.exports=i},379:(e,t,n)=>{"use strict";var r=n(1634);e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return e.getEntity()===t}),(function(e,t){n.push({start:e,end:t})})),n.length||r(!1),n}},4828:(e,t,n)=>{"use strict";var r=n(5858),o=n(1634),i=r.isBrowser("IE <= 9");e.exports=function(e){var t,n=null;return!i&&document.implementation&&document.implementation.createHTMLDocument&&((t=document.implementation.createHTMLDocument("foo")).documentElement||o(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}},2537:(e,t,n)=>{"use strict";var r=n(2004);e.exports=function e(t){if(r(t)){var n=t,o=n.getAttribute("data-offset-key");if(o)return o;for(var i=0;i<n.childNodes.length;i++){var a=e(n.childNodes[i]);if(a)return a}}return null}},3175:(e,t,n)=>{"use strict";var r=n(1634),o=/\.textClipping$/,i={"text/plain":!0,"text/html":!0,"text/rtf":!0};e.exports=function(e,t){var a=0,s=[];e.forEach((function(c){!function(e,t){if(!n.g.FileReader||e.type&&!(e.type in i))t("");else{if(""===e.type){var a="";return o.test(e.name)&&(a=e.name.replace(o,"")),void t(a)}var s=new FileReader;s.onload=function(){var e=s.result;"string"!=typeof e&&r(!1),t(e)},s.onerror=function(){t("")},s.readAsText(e)}}(c,(function(n){a++,n&&s.push(n.slice(0,5e3)),a==e.length&&t(s.join("\r"))}))}))}},9086:(e,t,n)=>{"use strict";var r=n(6449),o=n(4356);e.exports=function(e,t,n,i,a){var s=o(e.getSelection());if(!t||!i)return s;var c=r.decode(t),l=c.blockKey,u=e.getBlockTree(l),p=u&&u.getIn([c.decoratorKey,"leaves",c.leafKey]),f=r.decode(i),h=f.blockKey,d=e.getBlockTree(h),y=d&&d.getIn([f.decoratorKey,"leaves",f.leafKey]);if(!p||!y)return s;var m=p.get("start"),b=y.get("start"),v=p?m+n:null,g=y?b+a:null;if(s.getAnchorKey()===l&&s.getAnchorOffset()===v&&s.getFocusKey()===h&&s.getFocusOffset()===g)return s;var w=!1;if(l===h){var E=p.get("end"),S=y.get("end");w=b===m&&S===E?a<n:b<m}else w=e.getCurrentContent().getBlockMap().keySeq().skipUntil((function(e){return e===l||e===h})).first()===h;return s.merge({anchorKey:l,anchorOffset:v,focusKey:h,focusOffset:g,isBackward:w})}},9394:(e,t,n)=>{"use strict";var r=n(8494);e.exports=function(e){var t=e.getSelection();if(!t.rangeCount)return null;var n=t.getRangeAt(0),o=r(n),i=o.top,a=o.right,s=o.bottom,c=o.left;return 0===i&&0===a&&0===s&&0===c?null:o}},5577:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}},1854:e=>{"use strict";e.exports=function(e){return!("undefined"==typeof window||!window.__DRAFT_GKX||!window.__DRAFT_GKX[e])}},3163:(e,t,n)=>{"use strict";var r=n(2480),o=n(820),i=n(7325),a=n(3321),s=n(1634),c=n(8906),l=i.List;e.exports=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA";t.isCollapsed()||s(!1);var u=e.getBlockMap(),p=c(n),f=t.getStartKey(),h=t.getStartOffset(),d=u.get(f);return d instanceof o&&(d.getChildKeys().isEmpty()||s(!1)),1===p.size?function(e,t,n,r,o,i){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"REPLACE_WITH_NEW_DATA",c=n.get(o),l=c.getText(),u=c.getCharacterList(),p=o,f=i+r.getText().length,h=null;switch(s){case"MERGE_OLD_DATA_TO_NEW_DATA":h=r.getData().merge(c.getData());break;case"REPLACE_WITH_NEW_DATA":h=r.getData()}var d=c.getType();l&&"unstyled"===d&&(d=r.getType());var y=c.merge({text:l.slice(0,i)+r.getText()+l.slice(i),characterList:a(u,r.getCharacterList(),i),type:d,data:h});return e.merge({blockMap:n.set(o,y),selectionBefore:t,selectionAfter:t.merge({anchorKey:p,anchorOffset:f,focusKey:p,focusOffset:f,isBackward:!1})})}(e,t,u,p.first(),f,h,i):function(e,t,n,i,a,s){var c=n.first()instanceof o,u=[],p=i.size,f=n.get(a),h=i.first(),d=i.last(),y=d.getLength(),m=d.getKey(),b=c&&(!f.getChildKeys().isEmpty()||!h.getChildKeys().isEmpty());n.forEach((function(e,t){t===a?(b?u.push(e):u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.slice(0,t),a=o.slice(0,t),s=n.first();return e.merge({text:i+s.getText(),characterList:a.concat(s.getCharacterList()),type:i?e.getType():s.getType(),data:s.getData()})}(e,s,i)),i.slice(b?0:1,p-1).forEach((function(e){return u.push(e)})),u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.length,a=r.slice(t,i),s=o.slice(t,i),c=n.last();return c.merge({text:c.getText()+a,characterList:c.getCharacterList().concat(s),data:c.getData()})}(e,s,i))):u.push(e)}));var v=r.createFromArray(u);return c&&(v=function(e,t,n,r){return e.withMutations((function(t){var o=n.getKey(),i=r.getKey(),a=n.getNextSiblingKey(),s=n.getParentKey(),c=function(e,t){var n=e.getKey(),r=e,o=[];for(t.get(n)&&o.push(n);r&&r.getNextSiblingKey();){var i=r.getNextSiblingKey();if(!i)break;o.push(i),r=t.get(i)}return o}(r,e),u=c[c.length-1];if(t.get(i)?(t.setIn([o,"nextSibling"],i),t.setIn([i,"prevSibling"],o)):(t.setIn([o,"nextSibling"],r.getNextSiblingKey()),t.setIn([r.getNextSiblingKey(),"prevSibling"],o)),t.setIn([u,"nextSibling"],a),a&&t.setIn([a,"prevSibling"],u),c.forEach((function(e){return t.setIn([e,"parent"],s)})),s){var p=e.get(s).getChildKeys(),f=p.indexOf(o)+1,h=p.toArray();h.splice.apply(h,[f,0].concat(c)),t.setIn([s,"children"],l(h))}}))}(v,0,f,h)),e.merge({blockMap:v,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:y,focusKey:m,focusOffset:y,isBackward:!1})})}(e,t,u,p,f,h)}},3321:e=>{"use strict";e.exports=function(e,t,n){var r=e;if(n===r.count())t.forEach((function(e){r=r.push(e)}));else if(0===n)t.reverse().forEach((function(e){r=r.unshift(e)}));else{var o=r.slice(0,n),i=r.slice(n);r=o.concat(t,i).toList()}return r}},6636:(e,t,n)=>{"use strict";var r=n(7325),o=n(3321),i=n(1634),a=r.Repeat;e.exports=function(e,t,n,r){t.isCollapsed()||i(!1);var s=null;if(null!=n&&(s=n.length),null==s||0===s)return e;var c=e.getBlockMap(),l=t.getStartKey(),u=t.getStartOffset(),p=c.get(l),f=p.getText(),h=p.merge({text:f.slice(0,u)+n+f.slice(u,p.getLength()),characterList:o(p.getCharacterList(),a(r,s).toList(),u)}),d=u+s;return e.merge({blockMap:c.set(l,h),selectionAfter:t.merge({anchorOffset:d,focusOffset:d})})}},2004:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&e.nodeType===Node.ELEMENT_NODE}},7884:e=>{"use strict";e.exports=function(e){return"handled"===e||!0===e}},5728:(e,t,n)=>{"use strict";var r=n(2004);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"A"===e.nodeName}},9459:(e,t,n)=>{"use strict";var r=n(2004);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"BR"===e.nodeName}},5343:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&(e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement)}},6500:(e,t,n)=>{"use strict";var r=n(2004);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"IMG"===e.nodeName}},6248:e=>{"use strict";e.exports=function(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}},4875:e=>{"use strict";e.exports=function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),o=t.getStartOffset(),i=!1;return r.some((function(e){return o===e.get("start")?(i=!0,!0):o<e.get("end")&&e.get("leaves").some((function(e){var t=e.get("start");return o===t&&(i=!0,!0)}))})),i}},9682:(e,t,n)=>{"use strict";var r=n(1896);e.exports=function(e){return e.which===r.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}},5039:(e,t,n)=>{"use strict";var r=n(6366),o=n(4505),i=n(9051),a=n(7260),s=n(9792);e.exports=function(e,t){var n=s(e,(function(e){var n=e.getSelection();if(n.isCollapsed()&&0===n.getAnchorOffset())return a(e,1);var r=t.currentTarget.ownerDocument.defaultView.getSelection().getRangeAt(0);return r=o(r),i(e,null,r.endContainer,r.endOffset,r.startContainer,r.startOffset).selectionState}),"backward");return n===e.getCurrentContent()?e:r.push(e,n,"remove-range")}},9539:(e,t,n)=>{"use strict";var r=n(4138),o=n(6366),i=n(7260),a=n(9792);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset();if(0===n)return i(e,1);var o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(0,n),s=r.getBackward(a);return i(e,s.length||1)}),"backward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},513:(e,t,n)=>{"use strict";var r=n(4138),o=n(6366),i=n(5284),a=n(9792);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset(),o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(n),s=r.getForward(a);return i(e,s.length||1)}),"forward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},2851:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366);e.exports=function(e){var t=r.splitBlock(e.getCurrentContent(),e.getSelection());return o.push(e,t,"split-block")}},1501:(e,t,n)=>{"use strict";var r=n(6366);e.exports=function(e){var t=e.getSelection(),n=t.getEndKey(),o=e.getCurrentContent().getBlockForKey(n).getLength();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:o,focusKey:n,focusOffset:o,isBackward:!1}),forceSelection:!0})}},6538:(e,t,n)=>{"use strict";var r=n(6366);e.exports=function(e){var t=e.getSelection(),n=t.getStartKey();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}},3081:(e,t,n)=>{"use strict";var r=n(6366),o=n(7912),i=n(7260),a=n(9792);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a-1];return i(e,s?o.getUTF16Length(s,0):1)}),"backward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}},9603:(e,t,n)=>{"use strict";var r=n(6366),o=n(7912),i=n(5284),a=n(9792);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a];return i(e,s?o.getUTF16Length(s,0):1)}),"forward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}},5155:(e,t,n)=>{"use strict";var r=n(1942),o=n(6366),i=n(4422);e.exports=function(e){var t=e.getSelection();if(!t.isCollapsed())return e;var n=t.getAnchorOffset();if(0===n)return e;var a,s,c=t.getAnchorKey(),l=e.getCurrentContent(),u=l.getBlockForKey(c).getLength();if(u<=1)return e;n===u?(a=t.set("anchorOffset",n-1),s=t):s=(a=t.set("focusOffset",n+1)).set("anchorOffset",n+1);var p=i(l,a),f=r.removeRange(l,a,"backward"),h=f.getSelectionAfter(),d=h.getAnchorOffset()-1,y=h.merge({anchorOffset:d,focusOffset:d}),m=r.replaceWithFragment(f,y,p),b=o.push(e,m,"insert-fragment");return o.acceptSelection(b,s)}},3036:(e,t,n)=>{"use strict";var r=n(6366);e.exports=function(e,t,n){var o=r.undo(t);if("spellcheck-change"!==t.getLastChangeType())e.preventDefault(),t.getNativelyRenderedContent()?(n(r.set(t,{nativelyRenderedContent:null})),setTimeout((function(){n(o)}),0)):n(o);else{var i=o.getCurrentContent();n(r.set(o,{nativelyRenderedContent:i}))}}},5994:(e,t,n)=>{"use strict";var r=n(7325).Map;e.exports=function(e,t,n){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat(r([[i,a.get(i)]])).map(n);return e.merge({blockMap:a.merge(s),selectionBefore:t,selectionAfter:t})}},4431:(e,t,n)=>{"use strict";var r=n(820),o=n(4884),i=n(7325),a=n(1634),s=i.OrderedMap,c=i.List,l=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},u=function(e,t,n,r,o){if(!o)return e;var i="after"===r,a=t.getKey(),s=n.getKey(),u=t.getParentKey(),p=t.getNextSiblingKey(),f=t.getPrevSiblingKey(),h=n.getParentKey(),d=i?n.getNextSiblingKey():s,y=i?s:n.getPrevSiblingKey();return e.withMutations((function(e){l(u,e,(function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(a))})})),l(f,e,(function(e){return e.merge({nextSibling:p})})),l(p,e,(function(e){return e.merge({prevSibling:f})})),l(d,e,(function(e){return e.merge({prevSibling:a})})),l(y,e,(function(e){return e.merge({nextSibling:a})})),l(h,e,(function(e){var t=e.getChildKeys(),n=t.indexOf(s),r=i?n+1:0!==n?n-1:0,o=t.toArray();return o.splice(r,0,a),e.merge({children:c(o)})})),l(a,e,(function(e){return e.merge({nextSibling:d,prevSibling:y,parent:h})}))}))};e.exports=function(e,t,n,i){"replace"===i&&a(!1);var c=n.getKey(),l=t.getKey();l===c&&a(!1);var p=e.getBlockMap(),f=t instanceof r,h=[t],d=p.delete(l);f&&(h=[],d=p.withMutations((function(e){var n=t.getNextSiblingKey(),r=o(t,e);e.toSeq().skipUntil((function(e){return e.getKey()===l})).takeWhile((function(e){var t=e.getKey(),o=t===l,i=n&&t!==n,a=!n&&e.getParentKey()&&(!r||t!==r);return!!(o||i||a)})).forEach((function(t){h.push(t),e.delete(t.getKey())}))})));var y=d.toSeq().takeUntil((function(e){return e===n})),m=d.toSeq().skipUntil((function(e){return e===n})).skip(1),b=h.map((function(e){return[e.getKey(),e]})),v=s();if("before"===i){var g=e.getBlockBefore(c);g&&g.getKey()===t.getKey()&&a(!1),v=y.concat([].concat(b,[[c,n]]),m).toOrderedMap()}else if("after"===i){var w=e.getBlockAfter(c);w&&w.getKey()===l&&a(!1),v=y.concat([[c,n]].concat(b),m).toOrderedMap()}return e.merge({blockMap:u(v,t,n,i,f),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:l,focusKey:l})})}},7260:(e,t,n)=>{"use strict";n(4942),e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),o=n.getStartKey(),i=n.getStartOffset(),a=o,s=0;if(t>i){var c=r.getKeyBefore(o);null==c?a=o:(a=c,s=r.getBlockForKey(c).getText().length)}else s=i-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}},5284:(e,t,n)=>{"use strict";n(4942),e.exports=function(e,t){var n,r=e.getSelection(),o=r.getStartKey(),i=r.getStartOffset(),a=e.getCurrentContent(),s=o;return t>a.getBlockForKey(o).getText().length-i?(s=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:s,focusOffset:n})}},8906:(e,t,n)=>{"use strict";var r=n(820),o=n(9947),i=n(7325).OrderedMap;e.exports=function(e){return e.first()instanceof r?function(e){var t,n={};return i(e.withMutations((function(e){e.forEach((function(r,i){var a=r.getKey(),s=r.getNextSiblingKey(),c=r.getPrevSiblingKey(),l=r.getChildKeys(),u=r.getParentKey(),p=o();if(n[a]=p,s&&(e.get(s)?e.setIn([s,"prevSibling"],p):e.setIn([a,"nextSibling"],null)),c&&(e.get(c)?e.setIn([c,"nextSibling"],p):e.setIn([a,"prevSibling"],null)),u&&e.get(u)){var f=e.get(u).getChildKeys();e.setIn([u,"children"],f.set(f.indexOf(r.getKey()),p))}else e.setIn([a,"parent"],null),t&&(e.setIn([t.getKey(),"nextSibling"],p),e.setIn([a,"prevSibling"],n[t.getKey()])),t=e.get(a);l.forEach((function(t){e.get(t)?e.setIn([t,"parent"],p):e.setIn([a,"children"],r.getChildKeys().filter((function(e){return e!==t})))}))}))})).toArray().map((function(e){return[n[e.getKey()],e.set("key",n[e.getKey()])]})))}(e):function(e){return i(e.toArray().map((function(e){var t=o();return[t,e.set("key",t)]})))}(e)}},3320:(e,t,n)=>{"use strict";var r=n(9462),o=n(7367),i=n(1634);function a(e,t,n){var a=t.getCharacterList(),s=n>0?a.get(n-1):void 0,c=n<a.count()?a.get(n):void 0,l=s?s.getEntity():void 0,u=c?c.getEntity():void 0;if(u&&u===l&&"MUTABLE"!==e.__get(u).getMutability()){for(var p,f=function(e,t,n){var r;return o(e,(function(e,t){return e.getEntity()===t.getEntity()}),(function(e){return e.getEntity()===t}),(function(e,t){e<=n&&t>=n&&(r={start:e,end:t})})),"object"!=typeof r&&i(!1),r}(a,u,n),h=f.start,d=f.end;h<d;)p=a.get(h),a=a.set(h,r.applyEntity(p,null)),h++;return t.set("characterList",a)}return t}e.exports=function(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),o={},i=t.getStartKey(),s=t.getStartOffset(),c=n.get(i),l=a(r,c,s);l!==c&&(o[i]=l);var u=t.getEndKey(),p=t.getEndOffset(),f=n.get(u);i===u&&(f=l);var h=a(r,f,p);return h!==f&&(o[u]=h),Object.keys(o).length?e.merge({blockMap:n.merge(o),selectionAfter:t}):e.set("selectionAfter",t)}},839:(e,t,n)=>{"use strict";var r=n(820),o=n(4884),i=n(7325),a=(i.List,i.Map),s=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},c=function(e,t){var n=[];if(!e)return n;for(var r=t.get(e);r&&r.getParentKey();){var o=r.getParentKey();o&&n.push(o),r=o?t.get(o):null}return n},l=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getNextSiblingKey();r&&!t.get(r);)r=n.get(r).getNextSiblingKey()||null;return r},u=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getPrevSiblingKey();r&&!t.get(r);)r=n.get(r).getPrevSiblingKey()||null;return r};e.exports=function(e,t){if(t.isCollapsed())return e;var n,i=e.getBlockMap(),p=t.getStartKey(),f=t.getStartOffset(),h=t.getEndKey(),d=t.getEndOffset(),y=i.get(p),m=i.get(h),b=y instanceof r,v=[];if(b){var g=m.getChildKeys(),w=c(h,i);m.getNextSiblingKey()&&(v=v.concat(w)),g.isEmpty()||(v=v.concat(w.concat([h]))),v=v.concat(c(o(m,i),i))}n=y===m?function(e,t,n){if(0===t)for(;t<n;)e=e.shift(),t++;else if(n===e.count())for(;n>t;)e=e.pop(),n--;else{var r=e.slice(0,t),o=e.slice(n);e=r.concat(o).toList()}return e}(y.getCharacterList(),f,d):y.getCharacterList().slice(0,f).concat(m.getCharacterList().slice(d));var E=y.merge({text:y.getText().slice(0,f)+m.getText().slice(d),characterList:n}),S=b&&0===f&&0===d&&m.getParentKey()===p&&null==m.getPrevSiblingKey()?a([[p,null]]):i.toSeq().skipUntil((function(e,t){return t===p})).takeUntil((function(e,t){return t===h})).filter((function(e,t){return-1===v.indexOf(t)})).concat(a([[h,null]])).map((function(e,t){return t===p?E:null})),O=i.merge(S).filter((function(e){return!!e}));return b&&y!==m&&(O=function(e,t,n,r){return e.withMutations((function(i){if(s(t.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),s(n.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),c(t.getKey(),r).forEach((function(e){return s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),s(t.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:t.getPrevSiblingKey()})})),s(t.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r)})})),s(n.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:u(e,i,r)})})),s(n.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:n.getNextSiblingKey()})})),c(n.getKey(),r).forEach((function(e){s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),function(e,t){var n=[];if(!e)return n;for(var r=o(e,t);r&&t.get(r);){var i=t.get(r);n.push(r),r=i.getParentKey()?o(i,t):null}return n}(n,r).forEach((function(e){return s(e,i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),null==e.get(t.getKey())&&null!=e.get(n.getKey())&&n.getParentKey()===t.getKey()&&null==n.getPrevSiblingKey()){var a=t.getPrevSiblingKey();s(n.getKey(),i,(function(e){return e.merge({prevSibling:a})})),s(a,i,(function(e){return e.merge({nextSibling:n.getKey()})}));var p=a?e.get(a):null,f=p?p.getParentKey():null;if(t.getChildKeys().forEach((function(e){s(e,i,(function(e){return e.merge({parent:f})}))})),null!=f){var h=e.get(f);s(f,i,(function(e){return e.merge({children:h.getChildKeys().concat(t.getChildKeys())})}))}s(t.getChildKeys().find((function(t){return null===e.get(t).getNextSiblingKey()})),i,(function(e){return e.merge({nextSibling:t.getNextSiblingKey()})}))}}))}(O,y,m,i)),e.merge({blockMap:O,selectionBefore:t,selectionAfter:t.merge({anchorKey:p,anchorOffset:f,focusKey:p,focusOffset:f,isBackward:!1})})}},9792:(e,t,n)=>{"use strict";var r=n(1942),o=n(1854)("draft_tree_data_support");e.exports=function(e,t,n){var i=e.getSelection(),a=e.getCurrentContent(),s=i,c=i.getAnchorKey(),l=i.getFocusKey(),u=a.getBlockForKey(c);if(o&&"forward"===n&&c!==l)return a;if(i.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return a;if(o&&i.getAnchorOffset()===a.getBlockForKey(c).getLength()){var p=a.getBlockForKey(u.nextSibling);if(!p||0===p.getLength())return a}}else if(e.isSelectionAtStartOfContent())return a;if((s=t(e))===i)return a}return r.removeRange(a,s,n)}},6037:e=>{"use strict";var t=new RegExp("\r","g");e.exports=function(e){return e.replace(t,"")}},6112:(e,t,n)=>{"use strict";var r=n(1413),o=n(7248),i=n(5858),a=n(9089),s=n(8410),c=n(3001),l=n(1634),u=n(2004),p=i.isBrowser("IE");function f(e,t){if(!e)return"[empty]";var n=h(e,t);return n.nodeType===Node.TEXT_NODE?n.textContent:(u(n)||l(!1),n.outerHTML)}function h(e,t){var n=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE){var r=e.textContent.length;return c(e).createTextNode("[text "+r+(n.length?" | "+n.join(", "):"")+"]")}var o=e.cloneNode();1===o.nodeType&&n.length&&o.setAttribute("data-labels",n.join(", "));for(var i=e.childNodes,a=0;a<i.length;a++)o.appendChild(h(i[a],t));return o}function d(e,t){for(var n=e,r=n;n;){if(u(n)&&r.hasAttribute("contenteditable"))return f(n,t);r=n=n.parentNode}return"Could not find contentEditable parent of node"}function y(e){return null===e.nodeValue?e.childNodes.length:e.nodeValue.length}function m(e,t,n,r){var i=s();if(e.extend&&null!=t&&a(i,t)){n>y(t)&&o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var c=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,n)}catch(a){throw o.logSelectionStateFailure({anonymizedDom:d(t,(function(t){var n=[];return t===i&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n})),extraParams:JSON.stringify({activeElementName:i?i.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:c,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:a?""+a:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),a}}else if(t&&e.rangeCount>0){var l=e.getRangeAt(0);l.setEnd(t,n),e.addRange(l.cloneRange())}}function b(e,t,n,i){var a=c(t).createRange();if(n>y(t)&&(o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(i.toJS())}),r.handleExtensionCausedError()),a.setStart(t,n),p)try{e.addRange(a)}catch(e){}else e.addRange(a)}e.exports={setDraftEditorSelection:function(e,t,n,r,o){var i=c(t);if(a(i.documentElement,t)){var s=i.defaultView.getSelection(),l=e.getAnchorKey(),u=e.getAnchorOffset(),p=e.getFocusKey(),f=e.getFocusOffset(),h=e.getIsBackward();if(!s.extend&&h){var d=l,y=u;l=p,u=f,p=d,f=y,h=!1}var v=l===n&&r<=u&&o>=u,g=p===n&&r<=f&&o>=f;if(v&&g)return s.removeAllRanges(),b(s,t,u-r,e),void m(s,t,f-r,e);if(h){if(g&&(s.removeAllRanges(),b(s,t,f-r,e)),v){var w=s.focusNode,E=s.focusOffset;s.removeAllRanges(),b(s,t,u-r,e),m(s,w,E,e)}}else v&&(s.removeAllRanges(),b(s,t,u-r,e)),g&&m(s,t,f-r,e)}},addFocusToSelection:m}},9570:(e,t,n)=>{"use strict";var r=n(820),o=n(9947),i=n(7325),a=n(1634),s=n(5994),c=i.List,l=i.Map,u=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}};e.exports=function(e,t){t.isCollapsed()||a(!1);var n=t.getAnchorKey(),i=e.getBlockMap(),p=i.get(n),f=p.getText();if(!f){var h=p.getType();if("unordered-list-item"===h||"ordered-list-item"===h)return s(e,t,(function(e){return e.merge({type:"unstyled",depth:0})}))}var d=t.getAnchorOffset(),y=p.getCharacterList(),m=o(),b=p instanceof r,v=p.merge({text:f.slice(0,d),characterList:y.slice(0,d)}),g=v.merge({key:m,text:f.slice(d),characterList:y.slice(d),data:l()}),w=i.toSeq().takeUntil((function(e){return e===p})),E=i.toSeq().skipUntil((function(e){return e===p})).rest(),S=w.concat([[n,v],[m,g]],E).toOrderedMap();return b&&(p.getChildKeys().isEmpty()||a(!1),S=function(e,t,n){return e.withMutations((function(e){var r=t.getKey(),o=n.getKey();u(t.getParentKey(),e,(function(e){var t=e.getChildKeys(),n=t.indexOf(r)+1,i=t.toArray();return i.splice(n,0,o),e.merge({children:c(i)})})),u(t.getNextSiblingKey(),e,(function(e){return e.merge({prevSibling:o})})),u(r,e,(function(e){return e.merge({nextSibling:o})})),u(o,e,(function(e){return e.merge({prevSibling:r})}))}))}(S,v,g)),e.merge({blockMap:S,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:0,focusKey:m,focusOffset:0,isBackward:!1})})}},1976:e=>{"use strict";var t=/\r\n?|\n/g;e.exports=function(e){return e.split(t)}},8845:e=>{"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}},7325:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:$(e)}function r(e){return s(e)?e:G(e)}function o(e){return c(e)?e:J(e)}function i(e){return a(e)&&!l(e)?e:Q(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",m=5,b=1<<m,v=b-1,g={},w={value:!1},E={value:!1};function S(e){return e.value=!1,e}function O(e){e&&(e.value=!0)}function _(){}function P(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function k(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function j(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?k(e)+t:t}function C(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function x(e,t){return N(e,t,0)}function D(e,t){return N(e,t,t)}function N(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var R=0,M=1,I=2,A="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=A||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function K(e){return!!W(e)}function V(e){return e&&"function"==typeof e.next}function z(e){var t=W(e);return t&&t.call(e)}function W(e){var t=e&&(A&&e[A]||e[L]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function $(e){return null==e?ae():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function G(e){return null==e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function J(e){return null==e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():ce(e)}function Q(e){return(null==e?ae():a(e)?s(e)?e.entrySeq():e:ce(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=R,F.VALUES=M,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t($,n),$.of=function(){return $(arguments)},$.prototype.toSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq {","}")},$.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},$.prototype.__iterate=function(e,t){return ue(this,e,t,!0)},$.prototype.__iterator=function(e,t){return pe(this,e,t,!0)},t(G,$),G.prototype.toKeyedSeq=function(){return this},t(J,$),J.of=function(){return J(arguments)},J.prototype.toIndexedSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq [","]")},J.prototype.__iterate=function(e,t){return ue(this,e,t,!1)},J.prototype.__iterator=function(e,t){return pe(this,e,t,!1)},t(Q,$),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},$.isSeq=ie,$.Keyed=G,$.Set=Q,$.Indexed=J;var Y,X,Z,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[ee])}function ae(){return Y||(Y=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():K(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ce(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return H(e)?new te(e):V(e)?new oe(e):K(e)?new re(e):void 0}function ue(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function pe(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new F((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:U(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function fe(e,t){return t?he(t,e,"",{"":e}):de(e)}function he(e,t,n,r){return Array.isArray(t)?e.call(r,n,J(t).map((function(n,r){return he(e,n,r,t)}))):ye(t)?e.call(r,n,G(t).map((function(n,r){return he(e,n,r,t)}))):t}function de(e){return Array.isArray(e)?J(e).map(de).toList():ye(e)?G(e).map(de).toMap():e}function ye(e){return e&&(e.constructor===Object||void 0===e.constructor)}function me(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!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function be(e,t){if(e===t)return!0;if(!a(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||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&me(o[1],e)&&(n||me(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var p=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):o?!me(t,e.get(r,g)):!me(e.get(r,g),t))return p=!1,!1}));return p&&e.size===f}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function ge(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(ge(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(Z)return Z;Z=this}}function Ee(){throw TypeError("Abstract")}function Se(){}function Oe(){}function _e(){}$.prototype[ee]=!0,t(te,J),te.prototype.get=function(e,t){return this.has(e)?this._array[j(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?{value:void 0,done:!0}:U(e,o,n[t?r-o++:o++])}))},t(ne,G),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new F((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:U(e,a,n[a])}))},ne.prototype[d]=!0,t(re,J),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=z(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=z(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,J),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(ve,J),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return me(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new ve(this._value,D(t,n)-x(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return me(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return me(this._value,e)?this.size:-1},ve.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},ve.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):{value:void 0,done:!0}}))},ve.prototype.equals=function(e){return e instanceof ve?me(this._value,e._value):be(e)},t(we,J),we.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},we.prototype.get=function(e,t){return this.has(e)?this._start+j(this,e)*this._step:t},we.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},we.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=x(e,this.size),(t=D(t,this.size))<=e?new we(0,0):new we(this.get(e,this._end),this.get(t,this._end),this._step))},we.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},we.prototype.lastIndexOf=function(e){return this.indexOf(e)},we.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},we.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new F((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:U(e,i++,a)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:be(this,e)},t(Ee,n),t(Se,Ee),t(Oe,Ee),t(_e,Ee),Ee.Keyed=Se,Ee.Indexed=Oe,Ee.Set=_e;var Pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function je(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Ie?function(e){var t=Be[e];return void 0===t&&(t=Ce(e),Le===Ae&&(Le=0,Be={}),Le++,Be[e]=t),t}(e):Ce(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(Ne&&void 0!==(t=De.get(e)))return t;if(void 0!==(t=e[Me]))return t;if(!xe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Me]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Re,1073741824&Re&&(Re=0),Ne)De.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(xe)Object.defineProperty(e,Me,{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[Me]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Me]=t}}return t}(e);if("function"==typeof e.toString)return Ce(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Ce(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}var Te=Object.isExtensible,xe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var De,Ne="function"==typeof WeakMap;Ne&&(De=new WeakMap);var Re=0,Me="__immutablehash__";"function"==typeof Symbol&&(Me=Symbol(Me));var Ie=16,Ae=255,Le=0,Be={};function Fe(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?et():qe(e)&&!u(e)?e:et().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function qe(e){return!(!e||!e[Ve])}t(Ue,Se),Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return tt(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,g,(function(){return t}))},Ue.prototype.remove=function(e){return tt(this,e,g)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return g}))},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=lt(this,an(e),t,n);return r===g?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):et()},Ue.prototype.merge=function(){return it(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){return it(this,t,e.call(arguments,1))},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ue.prototype.mergeDeep=function(){return it(this,at,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return it(this,st(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ue.prototype.sort=function(e){return Nt(Gt(this,e))},Ue.prototype.sortBy=function(e,t){return Nt(Gt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Qe(this,e,t)},Ue.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},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Ke,Ve="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function We(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function $e(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Qe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Xe(e._root)}function Ye(e,t){return U(e,t[0],t[1])}function Xe(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function et(){return Ke||(Ke=Ze(0))}function tt(e,t,n){var r,o;if(e._root){var i=S(w),a=S(E);if(r=nt(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===g?-1:1:0)}else{if(n===g)return e;o=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):et()}function nt(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===g?e:(O(s),O(a),new Je(t,r,[o,i]))}function rt(e){return e.constructor===Je||e.constructor===Ge}function ot(e,t,n,r,o){if(e.keyHash===r)return new Ge(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&v,s=(0===n?r:r>>>n)&v;return new He(t,1<<a|1<<s,a===s?[ot(e,t,n+m,r,o)]:(i=new Je(t,r,o),a<s?[e,i]:[i,e]))}function it(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return fe(e)}))),o.push(c)}return ct(e,t,o)}function at(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):me(e,t)?e:t}function st(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return me(t,o)?t:o}}function ct(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,g,(function(e){return e===g?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function lt(e,t,n,r){var o=e===g,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}ge(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?g:e.get(c,g),u=lt(l,t,n,r);return u===l?e:u===g?e.remove(c):(o?et():e).set(c,u)}function ut(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function pt(e,t,n,r){var o=r?e:P(e);return o[t]=n,o}ze[Ve]=!0,ze[y]=ze.remove,ze.removeIn=ze.deleteIn,We.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},We.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===g,c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var p=l<u;if(p?c[l][1]===o:s)return this;if(O(a),(s||!p)&&O(i),!s||1!==c.length){if(!p&&!s&&c.length>=ft)return function(e,t,n,r){e||(e=new _);for(var o=new Je(e,je(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var f=e&&e===this.ownerID,h=f?c:P(c);return p?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new We(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=1<<((0===e?t:t>>>e)&v),i=this.bitmap;return i&o?this.nodes[ut(i&o-1)].get(e+m,t,n,r):r},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&v,c=1<<s,l=this.bitmap,u=!!(l&c);if(!u&&o===g)return this;var p=ut(l&c-1),f=this.nodes,h=u?f[p]:void 0,d=nt(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!u&&d&&f.length>=ht)return function(e,t,n,r,o){for(var i=0,a=new Array(b),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new $e(e,i+1,a)}(e,f,l,s,d);if(u&&!d&&2===f.length&&rt(f[1^p]))return f[1^p];if(u&&d&&1===f.length&&rt(d))return d;var y=e&&e===this.ownerID,w=u?d?l:l^c:l|c,E=u?d?pt(f,p,d,y):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(f,p,y):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(f,p,d,y);return y?(this.bitmap=w,this.nodes=E,this):new He(e,w,E)},$e.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=(0===e?t:t>>>e)&v,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},$e.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&v,c=o===g,l=this.nodes,u=l[s];if(c&&!u)return this;var p=nt(u,e,t+m,n,r,o,i,a);if(p===u)return this;var f=this.count;if(u){if(!p&&--f<dt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new He(e,o,a)}(e,l,f,s)}else f++;var h=e&&e===this.ownerID,d=pt(l,s,p,h);return h?(this.count=f,this.nodes=d,this):new $e(e,f,d)},Ge.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},Ge.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=o===g;if(n!==this.keyHash)return s?this:(O(a),O(i),ot(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var p=l<u;if(p?c[l][1]===o:s)return this;if(O(a),(s||!p)&&O(i),s&&2===u)return new Je(e,this.keyHash,c[1^l]);var f=e&&e===this.ownerID,h=f?c:P(c);return p?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ge(e,this.keyHash,h)},Je.prototype.get=function(e,t,n,r){return me(n,this.entry[0])?this.entry[1]:r},Je.prototype.update=function(e,t,n,r,o,i,a){var s=o===g,c=me(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(O(a),s?void O(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Je(e,this.keyHash,[r,o]):(O(i),ot(this,e,t,je(r),[r,o])))},We.prototype.iterate=Ge.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=$e.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Je.prototype.iterate=function(e,t){return e(this.entry)},t(Qe,F),Qe.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ye(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return Ye(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ye(e,i.entry);t=this._stack=Xe(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ft=b/4,ht=b/2,dt=b/4;function yt(e){var t=Pt();if(null==e)return t;if(mt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Fe(r),r>0&&r<b?_t(0,r,m,null,new gt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function mt(e){return!(!e||!e[bt])}t(yt,Oe),yt.of=function(){return this(arguments)},yt.prototype.toString=function(){return this.__toString("List [","]")},yt.prototype.get=function(e,t){if((e=j(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&v]}return t},yt.prototype.set=function(e,t){return function(e,t,n){if((t=j(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Tt(e,t).set(0,n):Tt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=S(E);return t>=Dt(e._capacity)?r=kt(r,e.__ownerID,0,t,n,i):o=kt(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):_t(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},yt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},yt.prototype.insert=function(e,t){return this.splice(e,0,t)},yt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Pt()},yt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Tt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},yt.prototype.pop=function(){return Tt(this,0,-1)},yt.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Tt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},yt.prototype.shift=function(){return Tt(this,1)},yt.prototype.merge=function(){return xt(this,void 0,arguments)},yt.prototype.mergeWith=function(t){return xt(this,t,e.call(arguments,1))},yt.prototype.mergeDeep=function(){return xt(this,at,arguments)},yt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return xt(this,st(t),n)},yt.prototype.setSize=function(e){return Tt(this,0,e)},yt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:Tt(this,x(e,n),D(t,n))},yt.prototype.__iterator=function(e,t){var n=0,r=Ot(this,t);return new F((function(){var t=r();return t===St?{value:void 0,done:!0}:U(e,n++,t)}))},yt.prototype.__iterate=function(e,t){for(var n,r=0,o=Ot(this,t);(n=o())!==St&&!1!==e(n,r++,this););return r},yt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_t(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},yt.isList=mt;var bt="@@__IMMUTABLE_LIST__@@",vt=yt.prototype;function gt(e,t){this.array=e,this.ownerID=t}vt[bt]=!0,vt[y]=vt.remove,vt.setIn=ze.setIn,vt.deleteIn=vt.removeIn=ze.removeIn,vt.update=ze.update,vt.updateIn=ze.updateIn,vt.mergeIn=ze.mergeIn,vt.mergeDeepIn=ze.mergeDeepIn,vt.withMutations=ze.withMutations,vt.asMutable=ze.asMutable,vt.asImmutable=ze.asImmutable,vt.wasAltered=ze.wasAltered,gt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&v;if(r>=this.array.length)return new gt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=jt(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},gt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&v;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=jt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var wt,Et,St={};function Ot(e,t){var n=e._origin,r=e._capacity,o=Dt(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>b&&(l=b),function(){if(c===l)return St;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>b&&(u=b),function(){for(;;){if(s){var e=s();if(e!==St)return e;s=null}if(l===u)return St;var n=t?--u:l++;s=a(c&&c[n],o-m,i+(n<<o))}}}(e,s,c)}}function _t(e,t,n,r,o,i,a){var s=Object.create(vt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function Pt(){return wt||(wt=_t(0,0,m))}function kt(e,t,n,r,o,i){var a,s=r>>>n&v,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=kt(l,t,n-m,r,o,i);return u===l?e:((a=jt(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(O(i),a=jt(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function jt(e,t){return t&&e&&t===e.ownerID?e:new gt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Dt(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&v],r-=m;return n}}function Tt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new gt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=m);u&&(a+=u,o+=u,s+=u,i+=u);for(var p=Dt(i),f=Dt(s);f>=1<<c+m;)l=new gt(l&&l.array.length?[l]:[],r),c+=m;var h=e._tail,d=f<p?Ct(e,s-1):f>p?new gt([],r):h;if(h&&f>p&&a<i&&h.array.length){for(var y=l=jt(l,r),b=c;b>m;b-=m){var g=p>>>b&v;y=y.array[g]=jt(y.array[g],r)}y.array[p>>>m&v]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=f)a-=f,s-=f,c=m,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||f<p){for(u=0;l;){var w=a>>>c&v;if(w!==f>>>c&v)break;w&&(u+=(1<<c)*w),c-=m,l=l.array[w]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&f<p&&(l=l.removeAfter(r,c,f-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):_t(a,s,c,l,d)}function xt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return fe(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),ct(e,t,r)}function Dt(e){return e<b?0:e-1>>>m<<m}function Nt(e){return null==e?It():Rt(e)?e:It().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Rt(e){return qe(e)&&u(e)}function Mt(e,t,n,r){var o=Object.create(Nt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return Et||(Et=Mt(et(),Pt()))}function At(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=b&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Lt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Bt(e){this._iter=e,this.size=e.size}function Ft(e){this._iter=e,this.size=e.size}function Ut(e){this._iter=e,this.size=e.size}function qt(e){var t=nn(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=rn,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===I){var r=e.__iterator(t,n);return new F((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===M?R:M,n)},t}function Kt(e,t,n){var r=nn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,g);return i===g?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(I,o);return new F((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return U(r,s,t.call(n,a[1],s,e),o)}))},r}function Vt(e,t){var n=nn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=qt(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=rn,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 zt(e,t,n,r){var o=nn(e);return r&&(o.has=function(r){var o=e.get(r,g);return o!==g&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,g);return i!==g&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(I,i),s=0;return new F((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return U(o,r?l:s++,u,i)}}))},o}function Wt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),T(t,n,o))return e;var i=x(t,o),a=D(n,o);if(i!=i||a!=a)return Wt(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=nn(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ie(e)&&s>=0&&(l.get=function(t,n){return(t=j(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new F((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:U(t,c-1,t===R?void 0:e.value[1],e)}))},l}function Ht(e,t,n,r){var o=nn(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(I,i),c=!0,l=0;return new F((function(){var e,i,u;do{if((e=s.next()).done)return r||o===M?e:U(o,l++,o===R?void 0:e.value[1],e);var p=e.value;i=p[0],u=p[1],c&&(c=t.call(n,u,i,a))}while(c);return o===I?e:U(o,i,u,e)}))},o}function $t(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new F((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(r===I&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:U(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function Gt(e,t,n){t||(t=on);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?G(i):c(e)?J(i):Q(i)}function Jt(e,t,n){if(t||(t=on),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Qt(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Qt(t,e,n)?n:e}))}function Qt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function Yt(e,t,r){var o=nn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),z(o?e.reverse():e)})),a=0,s=!1;return new F((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:U(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Xt(e,t){return ie(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function en(e){return Fe(e.size),k(e)}function tn(e){return s(e)?r:c(e)?o:i}function nn(e){return Object.create((s(e)?G:c(e)?J:Q).prototype)}function rn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):$.prototype.cacheResult.call(this)}function on(e,t){return e>t?1:e<t?-1:0}function an(e){var t=z(e);if(!t){if(!H(e))throw new TypeError("Expected iterable or array-like: "+e);t=z(n(e))}return t}function sn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(pn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(cn);return o.constructor=r,r}t(Nt,Ue),Nt.of=function(){return this(arguments)},Nt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Nt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Nt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Nt.prototype.set=function(e,t){return At(this,e,t)},Nt.prototype.remove=function(e){return At(this,e,g)},Nt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Nt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Nt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Nt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Nt.isOrderedMap=Rt,Nt.prototype[d]=!0,Nt.prototype[y]=Nt.prototype.remove,t(Lt,G),Lt.prototype.get=function(e,t){return this._iter.get(e,t)},Lt.prototype.has=function(e){return this._iter.has(e)},Lt.prototype.valueSeq=function(){return this._iter.valueSeq()},Lt.prototype.reverse=function(){var e=this,t=Vt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Lt.prototype.map=function(e,t){var n=this,r=Kt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Lt.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?en(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Lt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?en(this):0;return new F((function(){var o=n.next();return o.done?o:U(e,t?--r:r++,o.value,o)}))},Lt.prototype[d]=!0,t(Bt,J),Bt.prototype.includes=function(e){return this._iter.includes(e)},Bt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Bt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value,t)}))},t(Ft,Q),Ft.prototype.has=function(e){return this._iter.includes(e)},Ft.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Ft.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){var t=n.next();return t.done?t:U(e,t.value,t.value,t)}))},t(Ut,G),Ut.prototype.entrySeq=function(){return this._iter.toSeq()},Ut.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},Ut.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return U(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Bt.prototype.cacheResult=Lt.prototype.cacheResult=Ft.prototype.cacheResult=Ut.prototype.cacheResult=rn,t(sn,Se),sn.prototype.toString=function(){return this.__toString(un(this)+" {","}")},sn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},sn.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},sn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=ln(this,et()))},sn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:ln(this,n)},sn.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:ln(this,t)},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},sn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},sn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?ln(this,t,e):(this.__ownerID=e,this._map=t,this)};var cn=sn.prototype;function ln(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function pn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function fn(e){return null==e?gn():hn(e)&&!u(e)?e:gn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function hn(e){return!(!e||!e[yn])}cn[y]=cn.remove,cn.deleteIn=cn.removeIn=ze.removeIn,cn.merge=ze.merge,cn.mergeWith=ze.mergeWith,cn.mergeIn=ze.mergeIn,cn.mergeDeep=ze.mergeDeep,cn.mergeDeepWith=ze.mergeDeepWith,cn.mergeDeepIn=ze.mergeDeepIn,cn.setIn=ze.setIn,cn.update=ze.update,cn.updateIn=ze.updateIn,cn.withMutations=ze.withMutations,cn.asMutable=ze.asMutable,cn.asImmutable=ze.asImmutable,t(fn,_e),fn.of=function(){return this(arguments)},fn.fromKeys=function(e){return this(r(e).keySeq())},fn.prototype.toString=function(){return this.__toString("Set {","}")},fn.prototype.has=function(e){return this._map.has(e)},fn.prototype.add=function(e){return bn(this,this._map.set(e,!0))},fn.prototype.remove=function(e){return bn(this,this._map.remove(e))},fn.prototype.clear=function(){return bn(this,this._map.clear())},fn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},fn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},fn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},fn.prototype.merge=function(){return this.union.apply(this,arguments)},fn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},fn.prototype.sort=function(e){return wn(Gt(this,e))},fn.prototype.sortBy=function(e,t){return wn(Gt(this,t,e))},fn.prototype.wasAltered=function(){return this._map.wasAltered()},fn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},fn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},fn.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)},fn.isSet=hn;var dn,yn="@@__IMMUTABLE_SET__@@",mn=fn.prototype;function bn(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 vn(e,t){var n=Object.create(mn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function gn(){return dn||(dn=vn(et()))}function wn(e){return null==e?Pn():En(e)?e:Pn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function En(e){return hn(e)&&u(e)}mn[yn]=!0,mn[y]=mn.remove,mn.mergeDeep=mn.merge,mn.mergeDeepWith=mn.mergeWith,mn.withMutations=ze.withMutations,mn.asMutable=ze.asMutable,mn.asImmutable=ze.asImmutable,mn.__empty=gn,mn.__make=vn,t(wn,fn),wn.of=function(){return this(arguments)},wn.fromKeys=function(e){return this(r(e).keySeq())},wn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},wn.isOrderedSet=En;var Sn,On=wn.prototype;function _n(e,t){var n=Object.create(On);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Pn(){return Sn||(Sn=_n(It()))}function kn(e){return null==e?Nn():jn(e)?e:Nn().unshiftAll(e)}function jn(e){return!(!e||!e[Tn])}On[d]=!0,On.__empty=Pn,On.__make=_n,t(kn,Oe),kn.of=function(){return this(arguments)},kn.prototype.toString=function(){return this.__toString("Stack [","]")},kn.prototype.get=function(e,t){var n=this._head;for(e=j(this,e);n&&e--;)n=n.next;return n?n.value:t},kn.prototype.peek=function(){return this._head&&this._head.value},kn.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):Dn(e,t)},kn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Fe(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):Dn(t,n)},kn.prototype.pop=function(){return this.slice(1)},kn.prototype.unshift=function(){return this.push.apply(this,arguments)},kn.prototype.unshiftAll=function(e){return this.pushAll(e)},kn.prototype.shift=function(){return this.pop.apply(this,arguments)},kn.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):Nn()},kn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=x(e,this.size);if(D(t,this.size)!==this.size)return Oe.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Dn(r,o)},kn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Dn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},kn.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},kn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return{value:void 0,done:!0}}))},kn.isStack=jn;var Cn,Tn="@@__IMMUTABLE_STACK__@@",xn=kn.prototype;function Dn(e,t,n,r){var o=Object.create(xn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Nn(){return Cn||(Cn=Dn(0))}function Rn(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}xn[Tn]=!0,xn.withMutations=ze.withMutations,xn.asMutable=ze.asMutable,xn.asImmutable=ze.asImmutable,xn.wasAltered=ze.wasAltered,n.Iterator=F,Rn(n,{toArray:function(){Fe(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Bt(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 Lt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Fe(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Nt(this.toKeyedSeq())},toOrderedSet:function(){return wn(s(this)?this.valueSeq():this)},toSet:function(){return fn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Ft(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return kn(s(this)?this.valueSeq():this)},toList:function(){return yt(s(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 Xt(this,function(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?se(e):ce(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new te(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return me(t,e)}))},entries:function(){return this.__iterator(I)},every:function(e,t){Fe(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Xt(this,zt(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return Fe(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Fe(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(R)},map:function(e,t){return Xt(this,Kt(this,e,t))},reduce:function(e,t,n){var r,o;return Fe(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xt(this,Vt(this,!0))},slice:function(e,t){return Xt(this,Wt(this,e,t,!0))},some:function(e,t){return!this.every(Bn(e),t)},sort:function(e){return Xt(this,Gt(this,e))},values:function(){return this.__iterator(M)},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 k(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return be(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(Ln).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Bn(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(C)},flatMap:function(e,t){return Xt(this,function(e,t,n){var r=tn(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Xt(this,$t(this,e,!0))},fromEntrySeq:function(){return new Ut(this)},get:function(e,t){return this.find((function(t,n){return me(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=an(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Nt():Ue()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=tn(e);return o.map((function(t){return Xt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return Jt(this,e)},maxBy:function(e,t){return Jt(this,t,e)},min:function(e){return Jt(this,e?Fn(e):Kn)},minBy:function(e,t){return Jt(this,t?Fn(t):Kn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Xt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Bn(e),t)},sortBy:function(e,t){return Xt(this,Gt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Xt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Xt(this,function(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(I,o),s=!0;return new F((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?r===I?e:U(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Bn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=Pe(t,3432918353),t=Pe(t<<15|t>>>-15,461845907),t=Pe(t<<13|t>>>-13,5),t=Pe((t=t+3864292196^e)^t>>>16,2246822507),ke((t=Pe(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Vn(je(e),je(t))|0}:function(e,t){r=r+Vn(je(e),je(t))|0}:t?function(e){r=31*r+je(e)|0}:function(e){r=r+je(e)|0}),r)}(this))}});var Mn=n.prototype;Mn[p]=!0,Mn[B]=Mn.values,Mn.__toJS=Mn.toArray,Mn.__toStringMapper=Un,Mn.inspect=Mn.toSource=function(){return this.toString()},Mn.chain=Mn.flatMap,Mn.contains=Mn.includes,function(){try{Object.defineProperty(Mn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),Rn(r,{flip:function(){return Xt(this,qt(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey((function(t){return me(t,e)}))},lastKeyOf:function(e){return this.findLastKey((function(t){return me(t,e)}))},mapEntries:function(e,t){var n=this,r=0;return Xt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Xt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var In=r.prototype;function An(e,t){return t}function Ln(e,t){return[t,e]}function Bn(e){return function(){return!e.apply(this,arguments)}}function Fn(e){return function(){return-e.apply(this,arguments)}}function Un(e){return"string"==typeof e?JSON.stringify(e):e}function qn(){return P(arguments)}function Kn(e,t){return e<t?1:e>t?-1:0}function Vn(e,t){return e^t+2654435769+(e<<6)+(e>>2)}return In[f]=!0,In[B]=Mn.entries,In.__toJS=Mn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Un(e)},Rn(o,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(e,t){return Xt(this,zt(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.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return Xt(this,Vt(this,!1))},slice:function(e,t){return Xt(this,Wt(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=x(e,e<0?this.count():this.size);var r=this.slice(0,e);return Xt(this,1===n?r:r.concat(P(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return Xt(this,$t(this,e,!1))},get:function(e,t){return(e=j(this,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=j(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Xt(this,function(e,t){var n=nn(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new F((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?U(n,a++,t):U(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(P(arguments)),t=Yt(this.toSeq(),J.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Xt(this,n)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!1))},zip:function(){return Xt(this,Yt(this,qn,[this].concat(P(arguments))))},zipWith:function(e){var t=P(arguments);return t[0]=this,Xt(this,Yt(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Rn(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=Mn.includes,Rn(G,r.prototype),Rn(J,o.prototype),Rn(Q,i.prototype),Rn(Se,r.prototype),Rn(Oe,o.prototype),Rn(_e,i.prototype),{Iterable:n,Seq:$,Collection:Ee,Map:Ue,OrderedMap:Nt,List:yt,Stack:kn,Set:fn,OrderedSet:wn,Record:sn,Range:we,Repeat:ve,is:me,fromJS:fe}}()},5487:(e,t,n)=>{"use strict";var r=n(4797),o=n(4340),i=n(8615),a=new RegExp("\r\n","g"),s={"text/rtf":1,"text/html":1};function c(e){if("file"==e.kind)return e.getAsFile()}var l=function(){function e(e){this.data=e,this.types=e.types?o(e.types):[]}var t=e.prototype;return t.isRichText=function(){return!(!this.getHTML()||!this.getText())||!this.isImage()&&this.types.some((function(e){return s[e]}))},t.getText=function(){var e;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(e=this.data.getData("text/plain")):e=this.data.getData("Text")),e?e.replace(a,"\n"):null},t.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},t.isLink=function(){return this.types.some((function(e){return-1!=e.indexOf("Url")||-1!=e.indexOf("text/uri-list")||e.indexOf("text/x-moz-url")}))},t.getLink=function(){return this.data.getData?-1!=this.types.indexOf("text/x-moz-url")?this.data.getData("text/x-moz-url").split("\n")[0]:-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url"):null},t.isImage=function(){var e=this.types.some((function(e){return-1!=e.indexOf("application/x-moz-file")}));if(e)return!0;for(var t=this.getFiles(),n=0;n<t.length;n++){var o=t[n].type;if(!r.isImage(o))return!1}return!0},t.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},t.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(c).filter(i.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},t.hasFiles=function(){return this.getFiles().length>0},e}();e.exports=l},1896:e=>{"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},4797:e=>{"use strict";var t={isImage:function(e){return"image"===n(e)[0]},isJpeg:function(e){var r=n(e);return t.isImage(e)&&("jpeg"===r[1]||"pjpeg"===r[1])}};function n(e){return e.split("/")}e.exports=t},4725:e=>{"use strict";function t(e,t){return!!t&&(e===t.documentElement||e===t.body)}var n={getTop:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollTop||n.documentElement.scrollTop:e.scrollTop},setTop:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollTop=r.documentElement.scrollTop=n:e.scrollTop=n},getLeft:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollLeft||n.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollLeft=r.documentElement.scrollLeft=n:e.scrollLeft=n}};e.exports=n},1115:(e,t,n)=>{"use strict";function r(e,t){var n=o.get(e,t);return"auto"===n||"scroll"===n}var o={get:n(8280),getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=o},3137:e=>{"use strict";e.exports={getPunctuation:function(){return"[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟：-？！-／［-｀｛-･⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]"}}},528:e=>{"use strict";var t=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_uri",void 0),this._uri=e}return e.prototype.toString=function(){return this._uri},e}();e.exports=t},4319:(e,t,n)=>{"use strict";var r=n(9898),o=n(1634),i="֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",a="؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾",s=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃǄ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ﬀ-ﬆﬓ-ﬗＡ-Ｚａ-ｚｦ-ｯｰｱ-ﾝﾞ-ﾟﾠ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ"+i+a+"]"),c=new RegExp("["+i+a+"]");function l(e){var t=s.exec(e);return null==t?null:t[0]}function u(e){var t=l(e);return null==t?r.NEUTRAL:c.exec(t)?r.RTL:r.LTR}function p(e,t){if(t=t||r.NEUTRAL,!e.length)return t;var n=u(e);return n===r.NEUTRAL?t:n}function f(e,t){return t||(t=r.getGlobalDir()),r.isStrong(t)||o(!1),p(e,t)}var h={firstStrongChar:l,firstStrongCharDir:u,resolveBlockDir:p,getDirection:f,isDirectionLTR:function(e,t){return f(e,t)===r.LTR},isDirectionRTL:function(e,t){return f(e,t)===r.RTL}};e.exports=h},9898:(e,t,n)=>{"use strict";var r=n(1634),o="LTR",i="RTL",a=null;function s(e){return e===o||e===i}function c(e){return s(e)||r(!1),e===o?"ltr":"rtl"}function l(e){a=e}var u={NEUTRAL:"NEUTRAL",LTR:o,RTL:i,isStrong:s,getHTMLDir:c,getHTMLDirIfDifferent:function(e,t){return s(e)||r(!1),s(t)||r(!1),e===t?null:c(e)},setGlobalDir:l,initGlobalDir:function(){l(o)},getGlobalDir:function(){return a||this.initGlobalDir(),a||r(!1),a}};e.exports=u},8472:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(4319),i=n(9898),a=n(1634),s=function(){function e(e){r(this,"_defaultDir",void 0),r(this,"_lastDir",void 0),e?i.isStrong(e)||a(!1):e=i.getGlobalDir(),this._defaultDir=e,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}();e.exports=s},7912:(e,t,n)=>{"use strict";var r=n(1634),o=55296,i=57343,a=/[\uD800-\uDFFF]/;function s(e){return o<=e&&e<=i}function c(e){return a.test(e)}function l(e,t){return 1+s(e.charCodeAt(t))}function u(e,t,n){if(t=t||0,n=void 0===n?1/0:n||0,!c(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var o=0;if(t>0){for(;t>0&&o<r;t--)o+=l(e,o);if(o>=r)return""}else if(t<0){for(o=r;t<0&&0<o;t++)o-=l(e,o-1);o<0&&(o=0)}var i=r;if(n<r)for(i=o;n>0&&i<r;n--)i+=l(e,i);return e.substring(o,i)}var p={getCodePoints:function(e){for(var t=[],n=0;n<e.length;n+=l(e,n))t.push(e.codePointAt(n));return t},getUTF16Length:l,hasSurrogateUnit:c,isCodeUnitInSurrogateRange:s,isSurrogatePair:function(e,t){if(0<=t&&t<e.length||r(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),a=e.charCodeAt(t+1);return o<=n&&n<=56319&&56320<=a&&a<=i},strlen:function(e){if(!c(e))return e.length;for(var t=0,n=0;n<e.length;n+=l(e,n))t++;return t},substring:function(e,t,n){(t=t||0)<0&&(t=0),(n=void 0===n?1/0:n||0)<0&&(n=0);var r=Math.abs(n-t);return u(e,t=t<n?t:n,r)},substr:u};e.exports=p},5858:(e,t,n)=>{"use strict";var r=n(1810),o=n(4837),i=n(2271),a=n(7021);function s(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return!!t&&(i=r?r(i):i,o.contains(i,t))}function c(e){return"Windows"===r.platformName?e.replace(/^\s*NT/,""):e}var l={isBrowser:function(e){return s(r.browserName,r.browserFullVersion,e)},isBrowserArchitecture:function(e){return s(r.browserArchitecture,null,e)},isDevice:function(e){return s(r.deviceName,null,e)},isEngine:function(e){return s(r.engineName,r.engineVersion,e)},isPlatform:function(e){return s(r.platformName,r.platformFullVersion,e,c)},isPlatformArchitecture:function(e){return s(r.platformArchitecture,null,e)}};e.exports=i(l,a)},1810:(e,t,n)=>{"use strict";var r,o="Unknown",i=(new(n(6660))).getResult(),a=function(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}(i.browser.version),s={browserArchitecture:i.cpu.architecture||o,browserFullVersion:i.browser.version||o,browserMinorVersion:a.minor||o,browserName:i.browser.name||o,browserVersion:i.browser.major||o,deviceName:i.device.model||o,engineName:i.engine.name||o,engineVersion:i.engine.version||o,platformArchitecture:i.cpu.architecture||o,platformName:(r=i.os.name,{"Mac OS":"Mac OS X"}[r]||r||o),platformVersion:i.os.version||o,platformFullVersion:i.os.version||o};e.exports=s},4837:(e,t,n)=>{"use strict";var r=n(1634),o=/\./,i=/\|\|/,a=/\s+\-\s+/,s=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,c=/^(\d*)(.*)/;function l(e,t){if(""===(e=e.trim()))return!0;var n,r=t.split(o),i=f(e),a=i.modifier,s=i.rangeComponents;switch(a){case"<":return u(r,s);case"<=":return-1===(n=v(r,s))||0===n;case">=":return p(r,s);case">":return 1===v(r,s);case"~":case"~>":return function(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var o=r.length-1,i=parseInt(r[o],10);return h(i)&&(r[o]=i+1+""),p(e,n)&&u(e,r)}(r,s);default:return function(e,t){return 0===v(e,t)}(r,s)}}function u(e,t){return-1===v(e,t)}function p(e,t){var n=v(e,t);return 1===n||0===n}function f(e){var t=e.split(o),n=t[0].match(s);return n||r(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function h(e){return!isNaN(e)&&isFinite(e)}function d(e){return!f(e).modifier}function y(e,t){for(var n=e.length;n<t;n++)e[n]="0"}function m(e,t){var n=e.match(c)[1],r=t.match(c)[1],o=parseInt(n,10),i=parseInt(r,10);return h(o)&&h(i)&&o!==i?b(o,i):b(e,t)}function b(e,t){return typeof e!=typeof t&&r(!1),e>t?1:e<t?-1:0}function v(e,t){for(var n=function(e,t){y(e=e.slice(),(t=t.slice()).length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]="0","*"===r[0]&&n===t.length-1))for(var o=n;o<e.length;o++)e[o]="0"}return y(t,e.length),[e,t]}(e,t),r=n[0],o=n[1],i=0;i<o.length;i++){var a=m(r[i],o[i]);if(a)return a}return 0}var g={contains:function(e,t){return function(e,t){var n=e.split(i);return n.length>1?n.some((function(e){return g.contains(e,t)})):function(e,t){var n=e.split(a);if(n.length>0&&n.length<=2||r(!1),1===n.length)return l(n[0],t);var o=n[0],i=n[1];return d(o)&&d(i)||r(!1),l(">="+o,t)&&l("<="+i,t)}(e=n[0].trim(),t)}(e.trim(),t.trim())}};e.exports=g},9056:e=>{"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,(function(e,t){return t.toUpperCase()}))}},9089:(e,t,n)=>{"use strict";var r=n(6427);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},4340:(e,t,n)=>{"use strict";var r=n(1634);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},9863:e=>{"use strict";function t(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter((function(t){return e[t]})).map(t).join(" "):Array.prototype.map.call(arguments,t).join(" ")}},8615:e=>{"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},8410:e=>{"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},1380:e=>{"use strict";var t="undefined"!=typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;e.exports=function(e){return(e=e||document).scrollingElement?e.scrollingElement:t||"CSS1Compat"!==e.compatMode?e.body:e.documentElement}},7875:(e,t,n)=>{"use strict";var r=n(7402);e.exports=function(e){var t=r(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}},7402:(e,t,n)=>{"use strict";var r=n(9089);e.exports=function(e){var t=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!r(t,e))return{left:0,right:0,top:0,bottom:0};var n=e.getBoundingClientRect();return{left:Math.round(n.left)-t.clientLeft,right:Math.round(n.right)-t.clientLeft,top:Math.round(n.top)-t.clientTop,bottom:Math.round(n.bottom)-t.clientTop}}},8284:(e,t,n)=>{"use strict";var r=n(1380),o=n(5542);e.exports=function(e){var t=r(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=o(e),i=e===t?e.ownerDocument.documentElement:e,a=e.scrollWidth-i.clientWidth,s=e.scrollHeight-i.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,s)),n}},8280:(e,t,n)=>{"use strict";var r=n(9056),o=n(5146);function i(e){return null==e?e:String(e)}e.exports=function(e,t){var n;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null)))return i(n.getPropertyValue(o(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null))return i(n.getPropertyValue(o(t)));if("display"===t)return"none"}return e.currentStyle?i("float"===t?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[r(t)]):i(e.style&&e.style[r(t)])}},5542:e=>{"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},3125:e=>{"use strict";function t(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function n(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function r(){return{width:window.innerWidth||t(),height:window.innerHeight||n()}}r.withoutScrollbars=function(){return{width:t(),height:n()}},e.exports=r},5146:e=>{"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},1634:e=>{"use strict";e.exports=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return String(r[a++])})))).name="Invariant Violation"}throw i.framesToPop=1,i}}},3924:e=>{"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},6427:(e,t,n)=>{"use strict";var r=n(3924);e.exports=function(e){return r(e)&&3==e.nodeType}},6778:e=>{"use strict";e.exports=function(e){var t=e||"",n=arguments.length;if(n>1)for(var r=1;r<n;r++){var o=arguments[r];o&&(t=(t?t+" ":"")+o)}return t}},2271:e=>{"use strict";var t=Object.prototype.hasOwnProperty;e.exports=function(e,n,r){if(!e)return null;var o={};for(var i in e)t.call(e,i)&&(o[i]=n.call(r,e[i],i,e));return o}},7021:e=>{"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},4356:e=>{"use strict";e.exports=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")}},1225:(e,t,n)=>{"use strict";n(259),e.exports=n.g.setImmediate},4942:(e,t,n)=>{"use strict";var r=n(8615);e.exports=r},4987:e=>{"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),i=0;i<r.length;i++){var a=r[i],s=e[a];(o?-1!==t.indexOf(a):t(a,s,e))&&(n[a]=s)}return n}},8486:e=>{"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,c=s&&s(Object);e.exports=function e(l,u,p){if("string"!=typeof u){if(c){var f=s(u);f&&f!==c&&e(l,f,p)}var h=o(u);i&&(h=h.concat(i(u)));for(var d=0;d<h.length;++d){var y=h[d];if(!(t[y]||n[y]||p&&p[y])){var m=a(u,y);try{r(l,y,m)}catch(e){}}}return l}return l}},3624:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:$(e)}function r(e){return s(e)?e:G(e)}function o(e){return c(e)?e:J(e)}function i(e){return a(e)&&!l(e)?e:Q(e)}function a(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y="delete",m=5,b=1<<m,v=b-1,g={},w={value:!1},E={value:!1};function S(e){return e.value=!1,e}function O(e){e&&(e.value=!0)}function _(){}function P(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function k(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function j(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?k(e)+t:t}function C(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function x(e,t){return N(e,t,0)}function D(e,t){return N(e,t,t)}function N(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var R=0,M=1,I=2,A="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=A||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function K(e){return!!W(e)}function V(e){return e&&"function"==typeof e.next}function z(e){var t=W(e);return t&&t.call(e)}function W(e){var t=e&&(A&&e[A]||e[L]);if("function"==typeof t)return t}function H(e){return e&&"number"==typeof e.length}function $(e){return null==e?ae():a(e)?e.toSeq():function(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function G(e){return null==e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function J(e){return null==e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():ce(e)}function Q(e){return(null==e?ae():a(e)?s(e)?e.entrySeq():e:ce(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=R,F.VALUES=M,F.ENTRIES=I,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t($,n),$.of=function(){return $(arguments)},$.prototype.toSeq=function(){return this},$.prototype.toString=function(){return this.__toString("Seq {","}")},$.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},$.prototype.__iterate=function(e,t){return ue(this,e,t,!0)},$.prototype.__iterator=function(e,t){return pe(this,e,t,!0)},t(G,$),G.prototype.toKeyedSeq=function(){return this},t(J,$),J.of=function(){return J(arguments)},J.prototype.toIndexedSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq [","]")},J.prototype.__iterate=function(e,t){return ue(this,e,t,!1)},J.prototype.__iterator=function(e,t){return pe(this,e,t,!1)},t(Q,$),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},$.isSeq=ie,$.Keyed=G,$.Set=Q,$.Indexed=J;var Y,X,Z,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ie(e){return!(!e||!e[ee])}function ae(){return Y||(Y=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():K(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ce(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function le(e){return H(e)?new te(e):V(e)?new oe(e):K(e)?new re(e):void 0}function ue(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function pe(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new F((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:U(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function fe(e,t){return t?he(t,e,"",{"":e}):de(e)}function he(e,t,n,r){return Array.isArray(t)?e.call(r,n,J(t).map((function(n,r){return he(e,n,r,t)}))):ye(t)?e.call(r,n,G(t).map((function(n,r){return he(e,n,r,t)}))):t}function de(e){return Array.isArray(e)?J(e).map(de).toList():ye(e)?G(e).map(de).toMap():e}function ye(e){return e&&(e.constructor===Object||void 0===e.constructor)}function me(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!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function be(e,t){if(e===t)return!0;if(!a(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||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&me(o[1],e)&&(n||me(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var p=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):o?!me(t,e.get(r,g)):!me(e.get(r,g),t))return p=!1,!1}));return p&&e.size===f}function ve(e,t){if(!(this instanceof ve))return new ve(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function ge(e,t){if(!e)throw new Error(t)}function we(e,t,n){if(!(this instanceof we))return new we(e,t,n);if(ge(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(Z)return Z;Z=this}}function Ee(){throw TypeError("Abstract")}function Se(){}function Oe(){}function _e(){}$.prototype[ee]=!0,t(te,J),te.prototype.get=function(e,t){return this.has(e)?this._array[j(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?{value:void 0,done:!0}:U(e,o,n[t?r-o++:o++])}))},t(ne,G),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new F((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:U(e,a,n[a])}))},ne.prototype[d]=!0,t(re,J),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=z(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=z(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,J),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(ve,J),ve.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},ve.prototype.get=function(e,t){return this.has(e)?this._value:t},ve.prototype.includes=function(e){return me(this._value,e)},ve.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new ve(this._value,D(t,n)-x(e,n))},ve.prototype.reverse=function(){return this},ve.prototype.indexOf=function(e){return me(this._value,e)?0:-1},ve.prototype.lastIndexOf=function(e){return me(this._value,e)?this.size:-1},ve.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},ve.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):{value:void 0,done:!0}}))},ve.prototype.equals=function(e){return e instanceof ve?me(this._value,e._value):be(e)},t(we,J),we.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},we.prototype.get=function(e,t){return this.has(e)?this._start+j(this,e)*this._step:t},we.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},we.prototype.slice=function(e,t){return T(e,t,this.size)?this:(e=x(e,this.size),(t=D(t,this.size))<=e?new we(0,0):new we(this.get(e,this._end),this.get(t,this._end),this._step))},we.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},we.prototype.lastIndexOf=function(e){return this.indexOf(e)},we.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},we.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new F((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:U(e,i++,a)}))},we.prototype.equals=function(e){return e instanceof we?this._start===e._start&&this._end===e._end&&this._step===e._step:be(this,e)},t(Ee,n),t(Se,Ee),t(Oe,Ee),t(_e,Ee),Ee.Keyed=Se,Ee.Indexed=Oe,Ee.Set=_e;var Pe="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function ke(e){return e>>>1&1073741824|3221225471&e}function je(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==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;)n^=e/=4294967295;return ke(n)}if("string"===t)return e.length>Ie?function(e){var t=Be[e];return void 0===t&&(t=Ce(e),Le===Ae&&(Le=0,Be={}),Le++,Be[e]=t),t}(e):Ce(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(Ne&&void 0!==(t=De.get(e)))return t;if(void 0!==(t=e[Me]))return t;if(!xe){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Me]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++Re,1073741824&Re&&(Re=0),Ne)De.set(e,t);else{if(void 0!==Te&&!1===Te(e))throw new Error("Non-extensible objects are not allowed as keys.");if(xe)Object.defineProperty(e,Me,{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[Me]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Me]=t}}return t}(e);if("function"==typeof e.toString)return Ce(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Ce(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return ke(t)}var Te=Object.isExtensible,xe=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var De,Ne="function"==typeof WeakMap;Ne&&(De=new WeakMap);var Re=0,Me="__immutablehash__";"function"==typeof Symbol&&(Me=Symbol(Me));var Ie=16,Ae=255,Le=0,Be={};function Fe(e){ge(e!==1/0,"Cannot perform this action with an infinite size.")}function Ue(e){return null==e?et():qe(e)&&!u(e)?e:et().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function qe(e){return!(!e||!e[Ve])}t(Ue,Se),Ue.of=function(){var t=e.call(arguments,0);return et().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Ue.prototype.toString=function(){return this.__toString("Map {","}")},Ue.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ue.prototype.set=function(e,t){return tt(this,e,t)},Ue.prototype.setIn=function(e,t){return this.updateIn(e,g,(function(){return t}))},Ue.prototype.remove=function(e){return tt(this,e,g)},Ue.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return g}))},Ue.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ue.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=lt(this,an(e),t,n);return r===g?void 0:r},Ue.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):et()},Ue.prototype.merge=function(){return it(this,void 0,arguments)},Ue.prototype.mergeWith=function(t){return it(this,t,e.call(arguments,1))},Ue.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ue.prototype.mergeDeep=function(){return it(this,at,arguments)},Ue.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return it(this,st(t),n)},Ue.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,et(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ue.prototype.sort=function(e){return Nt(Gt(this,e))},Ue.prototype.sortBy=function(e,t){return Nt(Gt(this,t,e))},Ue.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ue.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},Ue.prototype.asImmutable=function(){return this.__ensureOwner()},Ue.prototype.wasAltered=function(){return this.__altered},Ue.prototype.__iterator=function(e,t){return new Qe(this,e,t)},Ue.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},Ue.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ze(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ue.isMap=qe;var Ke,Ve="@@__IMMUTABLE_MAP__@@",ze=Ue.prototype;function We(e,t){this.ownerID=e,this.entries=t}function He(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function $e(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Je(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function Qe(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&Xe(e._root)}function Ye(e,t){return U(e,t[0],t[1])}function Xe(e,t){return{node:e,index:0,__prev:t}}function Ze(e,t,n,r){var o=Object.create(ze);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function et(){return Ke||(Ke=Ze(0))}function tt(e,t,n){var r,o;if(e._root){var i=S(w),a=S(E);if(r=nt(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===g?-1:1:0)}else{if(n===g)return e;o=1,r=new We(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Ze(o,r):et()}function nt(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===g?e:(O(s),O(a),new Je(t,r,[o,i]))}function rt(e){return e.constructor===Je||e.constructor===Ge}function ot(e,t,n,r,o){if(e.keyHash===r)return new Ge(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&v,s=(0===n?r:r>>>n)&v;return new He(t,1<<a|1<<s,a===s?[ot(e,t,n+m,r,o)]:(i=new Je(t,r,o),a<s?[e,i]:[i,e]))}function it(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return fe(e)}))),o.push(c)}return ct(e,t,o)}function at(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):me(e,t)?e:t}function st(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return me(t,o)?t:o}}function ct(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,g,(function(e){return e===g?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function lt(e,t,n,r){var o=e===g,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}ge(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?g:e.get(c,g),u=lt(l,t,n,r);return u===l?e:u===g?e.remove(c):(o?et():e).set(c,u)}function ut(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function pt(e,t,n,r){var o=r?e:P(e);return o[t]=n,o}ze[Ve]=!0,ze[y]=ze.remove,ze.removeIn=ze.deleteIn,We.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},We.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===g,c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var p=l<u;if(p?c[l][1]===o:s)return this;if(O(a),(s||!p)&&O(i),!s||1!==c.length){if(!p&&!s&&c.length>=ft)return function(e,t,n,r){e||(e=new _);for(var o=new Je(e,je(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var f=e&&e===this.ownerID,h=f?c:P(c);return p?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new We(e,h)}},He.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=1<<((0===e?t:t>>>e)&v),i=this.bitmap;return i&o?this.nodes[ut(i&o-1)].get(e+m,t,n,r):r},He.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&v,c=1<<s,l=this.bitmap,u=!!(l&c);if(!u&&o===g)return this;var p=ut(l&c-1),f=this.nodes,h=u?f[p]:void 0,d=nt(h,e,t+m,n,r,o,i,a);if(d===h)return this;if(!u&&d&&f.length>=ht)return function(e,t,n,r,o){for(var i=0,a=new Array(b),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new $e(e,i+1,a)}(e,f,l,s,d);if(u&&!d&&2===f.length&&rt(f[1^p]))return f[1^p];if(u&&d&&1===f.length&&rt(d))return d;var y=e&&e===this.ownerID,w=u?d?l:l^c:l|c,E=u?d?pt(f,p,d,y):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(f,p,y):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(f,p,d,y);return y?(this.bitmap=w,this.nodes=E,this):new He(e,w,E)},$e.prototype.get=function(e,t,n,r){void 0===t&&(t=je(n));var o=(0===e?t:t>>>e)&v,i=this.nodes[o];return i?i.get(e+m,t,n,r):r},$e.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=(0===t?n:n>>>t)&v,c=o===g,l=this.nodes,u=l[s];if(c&&!u)return this;var p=nt(u,e,t+m,n,r,o,i,a);if(p===u)return this;var f=this.count;if(u){if(!p&&--f<dt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new He(e,o,a)}(e,l,f,s)}else f++;var h=e&&e===this.ownerID,d=pt(l,s,p,h);return h?(this.count=f,this.nodes=d,this):new $e(e,f,d)},Ge.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(me(n,o[i][0]))return o[i][1];return r},Ge.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=je(r));var s=o===g;if(n!==this.keyHash)return s?this:(O(a),O(i),ot(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!me(r,c[l][0]);l++);var p=l<u;if(p?c[l][1]===o:s)return this;if(O(a),(s||!p)&&O(i),s&&2===u)return new Je(e,this.keyHash,c[1^l]);var f=e&&e===this.ownerID,h=f?c:P(c);return p?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ge(e,this.keyHash,h)},Je.prototype.get=function(e,t,n,r){return me(n,this.entry[0])?this.entry[1]:r},Je.prototype.update=function(e,t,n,r,o,i,a){var s=o===g,c=me(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(O(a),s?void O(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Je(e,this.keyHash,[r,o]):(O(i),ot(this,e,t,je(r),[r,o])))},We.prototype.iterate=Ge.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},He.prototype.iterate=$e.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},Je.prototype.iterate=function(e,t){return e(this.entry)},t(Qe,F),Qe.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return Ye(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return Ye(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return Ye(e,i.entry);t=this._stack=Xe(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var ft=b/4,ht=b/2,dt=b/4;function yt(e){var t=Pt();if(null==e)return t;if(mt(e))return e;var n=o(e),r=n.size;return 0===r?t:(Fe(r),r>0&&r<b?_t(0,r,m,null,new gt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function mt(e){return!(!e||!e[bt])}t(yt,Oe),yt.of=function(){return this(arguments)},yt.prototype.toString=function(){return this.__toString("List [","]")},yt.prototype.get=function(e,t){if((e=j(this,e))>=0&&e<this.size){var n=Ct(this,e+=this._origin);return n&&n.array[e&v]}return t},yt.prototype.set=function(e,t){return function(e,t,n){if((t=j(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?Tt(e,t).set(0,n):Tt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=S(E);return t>=Dt(e._capacity)?r=kt(r,e.__ownerID,0,t,n,i):o=kt(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):_t(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},yt.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},yt.prototype.insert=function(e,t){return this.splice(e,0,t)},yt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=m,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Pt()},yt.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Tt(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},yt.prototype.pop=function(){return Tt(this,0,-1)},yt.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){Tt(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},yt.prototype.shift=function(){return Tt(this,1)},yt.prototype.merge=function(){return xt(this,void 0,arguments)},yt.prototype.mergeWith=function(t){return xt(this,t,e.call(arguments,1))},yt.prototype.mergeDeep=function(){return xt(this,at,arguments)},yt.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return xt(this,st(t),n)},yt.prototype.setSize=function(e){return Tt(this,0,e)},yt.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:Tt(this,x(e,n),D(t,n))},yt.prototype.__iterator=function(e,t){var n=0,r=Ot(this,t);return new F((function(){var t=r();return t===St?{value:void 0,done:!0}:U(e,n++,t)}))},yt.prototype.__iterate=function(e,t){for(var n,r=0,o=Ot(this,t);(n=o())!==St&&!1!==e(n,r++,this););return r},yt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?_t(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},yt.isList=mt;var bt="@@__IMMUTABLE_LIST__@@",vt=yt.prototype;function gt(e,t){this.array=e,this.ownerID=t}vt[bt]=!0,vt[y]=vt.remove,vt.setIn=ze.setIn,vt.deleteIn=vt.removeIn=ze.removeIn,vt.update=ze.update,vt.updateIn=ze.updateIn,vt.mergeIn=ze.mergeIn,vt.mergeDeepIn=ze.mergeDeepIn,vt.withMutations=ze.withMutations,vt.asMutable=ze.asMutable,vt.asImmutable=ze.asImmutable,vt.wasAltered=ze.wasAltered,gt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&v;if(r>=this.array.length)return new gt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-m,n))===a&&i)return this}if(i&&!o)return this;var s=jt(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},gt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&v;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-m,n))===i&&o===this.array.length-1)return this}var a=jt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var wt,Et,St={};function Ot(e,t){var n=e._origin,r=e._capacity,o=Dt(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>b&&(l=b),function(){if(c===l)return St;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>b&&(u=b),function(){for(;;){if(s){var e=s();if(e!==St)return e;s=null}if(l===u)return St;var n=t?--u:l++;s=a(c&&c[n],o-m,i+(n<<o))}}}(e,s,c)}}function _t(e,t,n,r,o,i,a){var s=Object.create(vt);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function Pt(){return wt||(wt=_t(0,0,m))}function kt(e,t,n,r,o,i){var a,s=r>>>n&v,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=kt(l,t,n-m,r,o,i);return u===l?e:((a=jt(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(O(i),a=jt(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function jt(e,t){return t&&e&&t===e.ownerID?e:new gt(e?e.array.slice():[],t)}function Ct(e,t){if(t>=Dt(e._capacity))return e._tail;if(t<1<<e._level+m){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&v],r-=m;return n}}function Tt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new _,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new gt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=m);u&&(a+=u,o+=u,s+=u,i+=u);for(var p=Dt(i),f=Dt(s);f>=1<<c+m;)l=new gt(l&&l.array.length?[l]:[],r),c+=m;var h=e._tail,d=f<p?Ct(e,s-1):f>p?new gt([],r):h;if(h&&f>p&&a<i&&h.array.length){for(var y=l=jt(l,r),b=c;b>m;b-=m){var g=p>>>b&v;y=y.array[g]=jt(y.array[g],r)}y.array[p>>>m&v]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=f)a-=f,s-=f,c=m,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||f<p){for(u=0;l;){var w=a>>>c&v;if(w!==f>>>c&v)break;w&&(u+=(1<<c)*w),c-=m,l=l.array[w]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&f<p&&(l=l.removeAfter(r,c,f-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):_t(a,s,c,l,d)}function xt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return fe(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),ct(e,t,r)}function Dt(e){return e<b?0:e-1>>>m<<m}function Nt(e){return null==e?It():Rt(e)?e:It().withMutations((function(t){var n=r(e);Fe(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Rt(e){return qe(e)&&u(e)}function Mt(e,t,n,r){var o=Object.create(Nt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function It(){return Et||(Et=Mt(et(),Pt()))}function At(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===g){if(!c)return e;a.size>=b&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Mt(r,o)}function Lt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Bt(e){this._iter=e,this.size=e.size}function Ft(e){this._iter=e,this.size=e.size}function Ut(e){this._iter=e,this.size=e.size}function qt(e){var t=nn(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=rn,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===I){var r=e.__iterator(t,n);return new F((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===M?R:M,n)},t}function Kt(e,t,n){var r=nn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,g);return i===g?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(I,o);return new F((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return U(r,s,t.call(n,a[1],s,e),o)}))},r}function Vt(e,t){var n=nn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=qt(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=rn,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 zt(e,t,n,r){var o=nn(e);return r&&(o.has=function(r){var o=e.get(r,g);return o!==g&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,g);return i!==g&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(I,i),s=0;return new F((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return U(o,r?l:s++,u,i)}}))},o}function Wt(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),T(t,n,o))return e;var i=x(t,o),a=D(n,o);if(i!=i||a!=a)return Wt(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=nn(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ie(e)&&s>=0&&(l.get=function(t,n){return(t=j(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new F((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||t===M?e:U(t,c-1,t===R?void 0:e.value[1],e)}))},l}function Ht(e,t,n,r){var o=nn(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(I,i),c=!0,l=0;return new F((function(){var e,i,u;do{if((e=s.next()).done)return r||o===M?e:U(o,l++,o===R?void 0:e.value[1],e);var p=e.value;i=p[0],u=p[1],c&&(c=t.call(n,u,i,a))}while(c);return o===I?e:U(o,i,u,e)}))},o}function $t(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new F((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(r===I&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:U(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function Gt(e,t,n){t||(t=on);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?G(i):c(e)?J(i):Q(i)}function Jt(e,t,n){if(t||(t=on),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Qt(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Qt(t,e,n)?n:e}))}function Qt(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function Yt(e,t,r){var o=nn(e);return o.size=new te(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(M,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),z(o?e.reverse():e)})),a=0,s=!1;return new F((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:U(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Xt(e,t){return ie(e)?t:e.constructor(t)}function Zt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function en(e){return Fe(e.size),k(e)}function tn(e){return s(e)?r:c(e)?o:i}function nn(e){return Object.create((s(e)?G:c(e)?J:Q).prototype)}function rn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):$.prototype.cacheResult.call(this)}function on(e,t){return e>t?1:e<t?-1:0}function an(e){var t=z(e);if(!t){if(!H(e))throw new TypeError("Expected iterable or array-like: "+e);t=z(n(e))}return t}function sn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(pn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ue(i)},o=r.prototype=Object.create(cn);return o.constructor=r,r}t(Nt,Ue),Nt.of=function(){return this(arguments)},Nt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Nt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Nt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):It()},Nt.prototype.set=function(e,t){return At(this,e,t)},Nt.prototype.remove=function(e){return At(this,e,g)},Nt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Nt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Nt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Nt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Mt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Nt.isOrderedMap=Rt,Nt.prototype[d]=!0,Nt.prototype[y]=Nt.prototype.remove,t(Lt,G),Lt.prototype.get=function(e,t){return this._iter.get(e,t)},Lt.prototype.has=function(e){return this._iter.has(e)},Lt.prototype.valueSeq=function(){return this._iter.valueSeq()},Lt.prototype.reverse=function(){var e=this,t=Vt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Lt.prototype.map=function(e,t){var n=this,r=Kt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Lt.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?en(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Lt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(M,t),r=t?en(this):0;return new F((function(){var o=n.next();return o.done?o:U(e,t?--r:r++,o.value,o)}))},Lt.prototype[d]=!0,t(Bt,J),Bt.prototype.includes=function(e){return this._iter.includes(e)},Bt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Bt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t),r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value,t)}))},t(Ft,Q),Ft.prototype.has=function(e){return this._iter.includes(e)},Ft.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Ft.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){var t=n.next();return t.done?t:U(e,t.value,t.value,t)}))},t(Ut,G),Ut.prototype.entrySeq=function(){return this._iter.toSeq()},Ut.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Zt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},Ut.prototype.__iterator=function(e,t){var n=this._iter.__iterator(M,t);return new F((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Zt(r);var o=a(r);return U(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Bt.prototype.cacheResult=Lt.prototype.cacheResult=Ft.prototype.cacheResult=Ut.prototype.cacheResult=rn,t(sn,Se),sn.prototype.toString=function(){return this.__toString(un(this)+" {","}")},sn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},sn.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},sn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=ln(this,et()))},sn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+un(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:ln(this,n)},sn.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:ln(this,t)},sn.prototype.wasAltered=function(){return this._map.wasAltered()},sn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},sn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},sn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?ln(this,t,e):(this.__ownerID=e,this._map=t,this)};var cn=sn.prototype;function ln(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function un(e){return e._name||e.constructor.name||"Record"}function pn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ge(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function fn(e){return null==e?gn():hn(e)&&!u(e)?e:gn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function hn(e){return!(!e||!e[yn])}cn[y]=cn.remove,cn.deleteIn=cn.removeIn=ze.removeIn,cn.merge=ze.merge,cn.mergeWith=ze.mergeWith,cn.mergeIn=ze.mergeIn,cn.mergeDeep=ze.mergeDeep,cn.mergeDeepWith=ze.mergeDeepWith,cn.mergeDeepIn=ze.mergeDeepIn,cn.setIn=ze.setIn,cn.update=ze.update,cn.updateIn=ze.updateIn,cn.withMutations=ze.withMutations,cn.asMutable=ze.asMutable,cn.asImmutable=ze.asImmutable,t(fn,_e),fn.of=function(){return this(arguments)},fn.fromKeys=function(e){return this(r(e).keySeq())},fn.prototype.toString=function(){return this.__toString("Set {","}")},fn.prototype.has=function(e){return this._map.has(e)},fn.prototype.add=function(e){return bn(this,this._map.set(e,!0))},fn.prototype.remove=function(e){return bn(this,this._map.remove(e))},fn.prototype.clear=function(){return bn(this,this._map.clear())},fn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},fn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},fn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},fn.prototype.merge=function(){return this.union.apply(this,arguments)},fn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},fn.prototype.sort=function(e){return wn(Gt(this,e))},fn.prototype.sortBy=function(e,t){return wn(Gt(this,t,e))},fn.prototype.wasAltered=function(){return this._map.wasAltered()},fn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},fn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},fn.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)},fn.isSet=hn;var dn,yn="@@__IMMUTABLE_SET__@@",mn=fn.prototype;function bn(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 vn(e,t){var n=Object.create(mn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function gn(){return dn||(dn=vn(et()))}function wn(e){return null==e?Pn():En(e)?e:Pn().withMutations((function(t){var n=i(e);Fe(n.size),n.forEach((function(e){return t.add(e)}))}))}function En(e){return hn(e)&&u(e)}mn[yn]=!0,mn[y]=mn.remove,mn.mergeDeep=mn.merge,mn.mergeDeepWith=mn.mergeWith,mn.withMutations=ze.withMutations,mn.asMutable=ze.asMutable,mn.asImmutable=ze.asImmutable,mn.__empty=gn,mn.__make=vn,t(wn,fn),wn.of=function(){return this(arguments)},wn.fromKeys=function(e){return this(r(e).keySeq())},wn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},wn.isOrderedSet=En;var Sn,On=wn.prototype;function _n(e,t){var n=Object.create(On);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Pn(){return Sn||(Sn=_n(It()))}function kn(e){return null==e?Nn():jn(e)?e:Nn().unshiftAll(e)}function jn(e){return!(!e||!e[Tn])}On[d]=!0,On.__empty=Pn,On.__make=_n,t(kn,Oe),kn.of=function(){return this(arguments)},kn.prototype.toString=function(){return this.__toString("Stack [","]")},kn.prototype.get=function(e,t){var n=this._head;for(e=j(this,e);n&&e--;)n=n.next;return n?n.value:t},kn.prototype.peek=function(){return this._head&&this._head.value},kn.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):Dn(e,t)},kn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Fe(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):Dn(t,n)},kn.prototype.pop=function(){return this.slice(1)},kn.prototype.unshift=function(){return this.push.apply(this,arguments)},kn.prototype.unshiftAll=function(e){return this.pushAll(e)},kn.prototype.shift=function(){return this.pop.apply(this,arguments)},kn.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):Nn()},kn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=x(e,this.size);if(D(t,this.size)!==this.size)return Oe.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Dn(r,o)},kn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Dn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},kn.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},kn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new F((function(){if(r){var t=r.value;return r=r.next,U(e,n++,t)}return{value:void 0,done:!0}}))},kn.isStack=jn;var Cn,Tn="@@__IMMUTABLE_STACK__@@",xn=kn.prototype;function Dn(e,t,n,r){var o=Object.create(xn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Nn(){return Cn||(Cn=Dn(0))}function Rn(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}xn[Tn]=!0,xn.withMutations=ze.withMutations,xn.asMutable=ze.asMutable,xn.asImmutable=ze.asImmutable,xn.wasAltered=ze.wasAltered,n.Iterator=F,Rn(n,{toArray:function(){Fe(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Bt(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 Lt(this,!0)},toMap:function(){return Ue(this.toKeyedSeq())},toObject:function(){Fe(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Nt(this.toKeyedSeq())},toOrderedSet:function(){return wn(s(this)?this.valueSeq():this)},toSet:function(){return fn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Ft(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return kn(s(this)?this.valueSeq():this)},toList:function(){return yt(s(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 Xt(this,function(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?se(e):ce(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new te(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return me(t,e)}))},entries:function(){return this.__iterator(I)},every:function(e,t){Fe(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Xt(this,zt(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 Fe(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Fe(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(R)},map:function(e,t){return Xt(this,Kt(this,e,t))},reduce:function(e,t,n){var r,o;return Fe(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Xt(this,Vt(this,!0))},slice:function(e,t){return Xt(this,Wt(this,e,t,!0))},some:function(e,t){return!this.every(Bn(e),t)},sort:function(e){return Xt(this,Gt(this,e))},values:function(){return this.__iterator(M)},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 k(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ue().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return be(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(Ln).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Bn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,i){if(e.call(t,n,o,i))return r=[o,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(C)},flatMap:function(e,t){return Xt(this,function(e,t,n){var r=tn(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Xt(this,$t(this,e,!0))},fromEntrySeq:function(){return new Ut(this)},get:function(e,t){return this.find((function(t,n){return me(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=an(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,g):g)===g)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Nt():Ue()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=tn(e);return o.map((function(t){return Xt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,g)!==g},hasIn:function(e){return this.getIn(e,g)!==g},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return me(t,e)}))},keySeq:function(){return this.toSeq().map(An).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Jt(this,e)},maxBy:function(e,t){return Jt(this,t,e)},min:function(e){return Jt(this,e?Fn(e):Kn)},minBy:function(e,t){return Jt(this,t?Fn(t):Kn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Xt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Bn(e),t)},sortBy:function(e,t){return Xt(this,Gt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Xt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Xt(this,function(e,t,n){var r=nn(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(I,o),s=!0;return new F((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?r===I?e:U(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Bn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=Pe(t,3432918353),t=Pe(t<<15|t>>>-15,461845907),t=Pe(t<<13|t>>>-13,5),t=Pe((t=t+3864292196^e)^t>>>16,2246822507),ke((t=Pe(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Vn(je(e),je(t))|0}:function(e,t){r=r+Vn(je(e),je(t))|0}:t?function(e){r=31*r+je(e)|0}:function(e){r=r+je(e)|0}),r)}(this))}});var Mn=n.prototype;Mn[p]=!0,Mn[B]=Mn.values,Mn.__toJS=Mn.toArray,Mn.__toStringMapper=Un,Mn.inspect=Mn.toSource=function(){return this.toString()},Mn.chain=Mn.flatMap,Mn.contains=Mn.includes,Rn(r,{flip:function(){return Xt(this,qt(this))},mapEntries:function(e,t){var n=this,r=0;return Xt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Xt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var In=r.prototype;function An(e,t){return t}function Ln(e,t){return[t,e]}function Bn(e){return function(){return!e.apply(this,arguments)}}function Fn(e){return function(){return-e.apply(this,arguments)}}function Un(e){return"string"==typeof e?JSON.stringify(e):String(e)}function qn(){return P(arguments)}function Kn(e,t){return e<t?1:e>t?-1:0}function Vn(e,t){return e^t+2654435769+(e<<6)+(e>>2)}return In[f]=!0,In[B]=Mn.entries,In.__toJS=Mn.toObject,In.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Un(e)},Rn(o,{toKeyedSeq:function(){return new Lt(this,!1)},filter:function(e,t){return Xt(this,zt(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 Xt(this,Vt(this,!1))},slice:function(e,t){return Xt(this,Wt(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=x(e,e<0?this.count():this.size);var r=this.slice(0,e);return Xt(this,1===n?r:r.concat(P(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 Xt(this,$t(this,e,!1))},get:function(e,t){return(e=j(this,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=j(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Xt(this,function(e,t){var n=nn(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(M,r),a=0;return new F((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?U(n,a++,t):U(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(P(arguments)),t=Yt(this.toSeq(),J.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Xt(this,n)},keySeq:function(){return we(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Xt(this,Ht(this,e,t,!1))},zip:function(){return Xt(this,Yt(this,qn,[this].concat(P(arguments))))},zipWith:function(e){var t=P(arguments);return t[0]=this,Xt(this,Yt(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Rn(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=Mn.includes,i.prototype.contains=i.prototype.includes,Rn(G,r.prototype),Rn(J,o.prototype),Rn(Q,i.prototype),Rn(Se,r.prototype),Rn(Oe,o.prototype),Rn(_e,i.prototype),{Iterable:n,Seq:$,Collection:Ee,Map:Ue,OrderedMap:Nt,List:yt,Stack:kn,Set:fn,OrderedSet:wn,Record:sn,Range:we,Repeat:ve,is:me,fromJS:fe}}()},2091:e=>{"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},9134:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},4351:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,o){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},a.type=r.type||"text/javascript",a.charset=r.charset||"utf8",a.async=!("async"in r)||!!r.async,a.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(a,r.attrs),r.text&&(a.text=""+r.text),("onload"in a?t:n)(a,o),a.onload||t(a,o),i.appendChild(a)}},3124:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="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},o=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},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}}(),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(8592)),s=/(\{[\d|\w]+\})/,c=/(\$ref\{[\w|.]+\})/,l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"function"==typeof n&&(n={customLanguageInterface:n}),this._opts=o({},{customLanguageInterface:a.getInterfaceLanguage,pseudo:!1,pseudoMultipleLanguages:!1,logsEnabled:!0},n),this._interfaceLanguage=this._opts.customLanguageInterface(),this._language=this._interfaceLanguage,this.setContent(t)}return i(e,[{key:"setContent",value:function(e){var t=this,n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Object.keys(e),1)[0];this._defaultLanguage=n,this._defaultLanguageFirstLevelKeys=[],this._props=e,a.validateTranslationKeys(Object.keys(e[this._defaultLanguage])),Object.keys(this._props[this._defaultLanguage]).forEach((function(e){"string"==typeof t._props[t._defaultLanguage][e]&&t._defaultLanguageFirstLevelKeys.push(e)})),this.setLanguage(this._interfaceLanguage),this._opts.pseudo&&this._pseudoAllValues(this._props)}},{key:"_pseudoAllValues",value:function(e){var t=this;Object.keys(e).forEach((function(n){if("object"===r(e[n]))t._pseudoAllValues(e[n]);else if("string"==typeof e[n]){if(0===e[n].indexOf("[")&&e[n].lastIndexOf("]")===e[n].length-1)return;for(var o=e[n].split(" "),i=0;i<o.length;i+=1)if(o[i].match(s));else if(o[i].match(c));else{var l=o[i].length;t._opts.pseudoMultipleLanguages&&(l=parseInt(1.4*l,10)),o[i]=a.randomPseudo(l)}e[n]="["+o.join(" ")+"]"}}))}},{key:"setLanguage",value:function(e){var t=this,n=a.getBestMatchingLanguage(e,this._props),r=Object.keys(this._props)[0];if(this._language=n,this._props[n]){for(var i=0;i<this._defaultLanguageFirstLevelKeys.length;i+=1)delete this[this._defaultLanguageFirstLevelKeys[i]];var s=o({},this._props[this._language]);Object.keys(s).forEach((function(e){t[e]=s[e]})),r!==this._language&&(s=this._props[r],this._fallbackValues(s,this))}}},{key:"_fallbackValues",value:function(e,t){var n=this;Object.keys(e).forEach((function(r){Object.prototype.hasOwnProperty.call(e,r)&&!t[r]&&""!==t[r]?(t[r]=e[r],n._opts.logsEnabled&&console.log("🚧 👷 key '"+r+"' not found in localizedStrings for language "+n._language+" 🚧")):"string"!=typeof t[r]&&n._fallbackValues(e[r],t[r])}))}},{key:"getLanguage",value:function(){return this._language}},{key:"getInterfaceLanguage",value:function(){return this._interfaceLanguage}},{key:"getAvailableLanguages",value:function(){var e=this;return this._availableLanguages||(this._availableLanguages=[],Object.keys(this._props).forEach((function(t){e._availableLanguages.push(t)}))),this._availableLanguages}},{key:"formatString",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=e||"";return"string"==typeof i&&(i=this.getString(e,null,!0)||i),i.split(c).filter((function(e){return!!e})).map((function(n){if(n.match(c)){var r=n.slice(5,-1);return t.getString(r)||(t._opts.logsEnabled&&console.log("No Localization ref found for '"+n+"' in string '"+e+"'"),"$ref(id:"+r+")")}return n})).join("").split(s).filter((function(e){return!!e})).map((function(e){if(e.match(s)){var t=e.slice(1,-1),n=r[t];if(void 0===n){var o=r[0][t];if(void 0===o)return n;n=o}return n}return e})).join("")}},{key:"getString",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=this._props[t||this._language],o=e.split("."),i=0;i<o.length;i+=1){if(void 0===r[o[i]])throw Error(o[i]);r=r[o[i]]}return r}catch(r){!n&&this._opts.logsEnabled&&console.log("No localization found for key '"+e+"' and language '"+t+"', failed on "+r.message)}return null}},{key:"getContent",value:function(){return this._props}}]),e}();t.default=l},8592:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceLanguage=function(){var e="en-US";if("undefined"==typeof navigator)return e;var t=navigator;if(t){if(t.language)return t.language;if(t.languages&&t.languages[0])return t.languages[0];if(t.userLanguage)return t.userLanguage;if(t.browserLanguage)return t.browserLanguage}return e},t.getBestMatchingLanguage=function(e,t){if(t[e])return e;var n=e.indexOf("-"),r=n>=0?e.substring(0,n):e;return t[r]?r:Object.keys(t)[0]},t.validateTranslationKeys=function(e){var t=["_interfaceLanguage","_language","_defaultLanguage","_defaultLanguageFirstLevelKeys","_props"];e.forEach((function(e){if(-1!==t.indexOf(e))throw new Error(e+" cannot be used as a key. It is a reserved word.")}))},t.randomPseudo=function(e){for(var t="",n=0;n<e;n+=1)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}},1416:(e,t,n)=>{var r=n(9138)(n(1433),"DataView");e.exports=r},9073:(e,t,n)=>{var r=n(2316),o=n(6458),i=n(2149),a=n(4297),s=n(3121);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},2707:(e,t,n)=>{var r=n(9714),o=n(3812),i=n(4727),a=n(8379),s=n(8291);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},1955:(e,t,n)=>{var r=n(9138)(n(1433),"Map");e.exports=r},369:(e,t,n)=>{var r=n(2092),o=n(9626),i=n(9925),a=n(6809),s=n(4385);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=s,e.exports=c},2616:(e,t,n)=>{var r=n(9138)(n(1433),"Promise");e.exports=r},157:(e,t,n)=>{var r=n(9138)(n(1433),"Set");e.exports=r},6469:(e,t,n)=>{var r=n(2707),o=n(1848),i=n(7406),a=n(8569),s=n(3109),c=n(3389);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=a,l.prototype.has=s,l.prototype.set=c,e.exports=l},2781:(e,t,n)=>{var r=n(1433).Symbol;e.exports=r},8944:(e,t,n)=>{var r=n(1433).Uint8Array;e.exports=r},8499:(e,t,n)=>{var r=n(9138)(n(1433),"WeakMap");e.exports=r},149:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},1414:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}},1163:(e,t,n)=>{var r=n(6204),o=n(1256),i=n(6397),a=n(492),s=n(2845),c=n(7995),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&o(e),p=!n&&!u&&a(e),f=!n&&!u&&!p&&c(e),h=n||u||p||f,d=h?r(e.length,String):[],y=d.length;for(var m in e)!t&&!l.call(e,m)||h&&("length"==m||p&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,y))||d.push(m);return d}},8740:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},2863:(e,t,n)=>{var r=n(4772),o=n(9316),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];i.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},8301:(e,t,n)=>{var r=n(9316);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},1145:(e,t,n)=>{var r=n(2083),o=n(1178);e.exports=function(e,t){return e&&r(t,o(t),e)}},4306:(e,t,n)=>{var r=n(2083),o=n(5405);e.exports=function(e,t){return e&&r(t,o(t),e)}},4772:(e,t,n)=>{var r=n(8559);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},2931:(e,t,n)=>{var r=n(6469),o=n(149),i=n(2863),a=n(1145),s=n(4306),c=n(7030),l=n(8835),u=n(859),p=n(6728),f=n(966),h=n(9697),d=n(1201),y=n(6785),m=n(3283),b=n(9181),v=n(6397),g=n(492),w=n(422),E=n(8953),S=n(3764),O=n(1178),_=n(5405),P="[object Arguments]",k="[object Function]",j="[object Object]",C={};C[P]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[j]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[k]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,T,x,D,N){var R,M=1&n,I=2&n,A=4&n;if(T&&(R=D?T(t,x,D,N):T(t)),void 0!==R)return R;if(!E(t))return t;var L=v(t);if(L){if(R=y(t),!M)return l(t,R)}else{var B=d(t),F=B==k||"[object GeneratorFunction]"==B;if(g(t))return c(t,M);if(B==j||B==P||F&&!D){if(R=I||F?{}:b(t),!M)return I?p(t,s(R,t)):u(t,a(R,t))}else{if(!C[B])return D?t:{};R=m(t,B,M)}}N||(N=new r);var U=N.get(t);if(U)return U;N.set(t,R),S(t)?t.forEach((function(r){R.add(e(r,n,T,r,t,N))})):w(t)&&t.forEach((function(r,o){R.set(o,e(r,n,T,o,t,N))}));var q=L?void 0:(A?I?h:f:I?_:O)(t);return o(q||t,(function(r,o){q&&(r=t[o=r]),i(R,o,e(r,n,T,o,t,N))})),R}},3508:(e,t,n)=>{var r=n(8953),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},4403:(e,t,n)=>{var r=n(8740),o=n(6397);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},7148:(e,t,n)=>{var r=n(2781),o=n(7903),i=n(1738),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},9250:(e,t,n)=>{var r=n(7148),o=n(2934);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},4800:(e,t,n)=>{var r=n(1201),o=n(2934);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},6567:(e,t,n)=>{var r=n(8446),o=n(8092),i=n(8953),a=n(1485),s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,p=l.hasOwnProperty,f=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:s).test(a(e))}},7866:(e,t,n)=>{var r=n(1201),o=n(2934);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},7129:(e,t,n)=>{var r=n(7148),o=n(3330),i=n(2934),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!a[r(e)]}},1452:(e,t,n)=>{var r=n(7499),o=n(9566),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},1491:(e,t,n)=>{var r=n(8953),o=n(7499),i=n(8201),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6204:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},8812:(e,t,n)=>{var r=n(2140),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},41:e=>{e.exports=function(e){return function(t){return e(t)}}},7177:(e,t,n)=>{var r=n(8944);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},7030:(e,t,n)=>{e=n.nmd(e);var r=n(1433),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},4893:(e,t,n)=>{var r=n(7177);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},4021:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},1548:(e,t,n)=>{var r=n(2781),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6733:(e,t,n)=>{var r=n(7177);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},8835:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},2083:(e,t,n)=>{var r=n(2863),o=n(4772);e.exports=function(e,t,n,i){var a=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var l=t[s],u=i?i(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),a?o(n,l,u):r(n,l,u)}return n}},859:(e,t,n)=>{var r=n(2083),o=n(8876);e.exports=function(e,t){return r(e,o(e),t)}},6728:(e,t,n)=>{var r=n(2083),o=n(8355);e.exports=function(e,t){return r(e,o(e),t)}},8109:(e,t,n)=>{var r=n(1433)["__core-js_shared__"];e.exports=r},8559:(e,t,n)=>{var r=n(9138),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5380:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},966:(e,t,n)=>{var r=n(4403),o=n(8876),i=n(1178);e.exports=function(e){return r(e,i,o)}},9697:(e,t,n)=>{var r=n(4403),o=n(8355),i=n(5405);e.exports=function(e){return r(e,i,o)}},5535:(e,t,n)=>{var r=n(5662);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},9138:(e,t,n)=>{var r=n(6567),o=n(6772);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},3347:(e,t,n)=>{var r=n(1019)(Object.getPrototypeOf,Object);e.exports=r},7903:(e,t,n)=>{var r=n(2781),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[s]=n:delete e[s]),o}},8876:(e,t,n)=>{var r=n(1414),o=n(3629),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return i.call(e,t)})))}:o;e.exports=s},8355:(e,t,n)=>{var r=n(8740),o=n(3347),i=n(8876),a=n(3629),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:a;e.exports=s},1201:(e,t,n)=>{var r=n(1416),o=n(1955),i=n(2616),a=n(157),s=n(8499),c=n(7148),l=n(1485),u="[object Map]",p="[object Promise]",f="[object Set]",h="[object WeakMap]",d="[object DataView]",y=l(r),m=l(o),b=l(i),v=l(a),g=l(s),w=c;(r&&w(new r(new ArrayBuffer(1)))!=d||o&&w(new o)!=u||i&&w(i.resolve())!=p||a&&w(new a)!=f||s&&w(new s)!=h)&&(w=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case y:return d;case m:return u;case b:return p;case v:return f;case g:return h}return t}),e.exports=w},6772:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2316:(e,t,n)=>{var r=n(4558);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},6458:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},2149:(e,t,n)=>{var r=n(4558),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},4297:(e,t,n)=>{var r=n(4558),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},3121:(e,t,n)=>{var r=n(4558);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6785:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},3283:(e,t,n)=>{var r=n(7177),o=n(4893),i=n(4021),a=n(1548),s=n(6733);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return a(e)}}},9181:(e,t,n)=>{var r=n(3508),o=n(3347),i=n(7499);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},2845:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},5662:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},8092:(e,t,n)=>{var r,o=n(8109),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},7499:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},9714:e=>{e.exports=function(){this.__data__=[],this.size=0}},3812:(e,t,n)=>{var r=n(8301),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},4727:(e,t,n)=>{var r=n(8301);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8379:(e,t,n)=>{var r=n(8301);e.exports=function(e){return r(this.__data__,e)>-1}},8291:(e,t,n)=>{var r=n(8301);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},2092:(e,t,n)=>{var r=n(9073),o=n(2707),i=n(1955);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},9626:(e,t,n)=>{var r=n(5535);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},9925:(e,t,n)=>{var r=n(5535);e.exports=function(e){return r(this,e).get(e)}},6809:(e,t,n)=>{var r=n(5535);e.exports=function(e){return r(this,e).has(e)}},4385:(e,t,n)=>{var r=n(5535);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},4558:(e,t,n)=>{var r=n(9138)(Object,"create");e.exports=r},9566:(e,t,n)=>{var r=n(1019)(Object.keys,Object);e.exports=r},8201:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},3685:(e,t,n)=>{e=n.nmd(e);var r=n(5380),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,s=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},1738:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1019:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},1433:(e,t,n)=>{var r=n(5380),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},1848:(e,t,n)=>{var r=n(2707);e.exports=function(){this.__data__=new r,this.size=0}},7406:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},8569:e=>{e.exports=function(e){return this.__data__.get(e)}},3109:e=>{e.exports=function(e){return this.__data__.has(e)}},3389:(e,t,n)=>{var r=n(2707),o=n(1955),i=n(369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},1485:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},2140:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},1499:(e,t,n)=>{var r=n(2931);e.exports=function(e){return r(e,5)}},6177:(e,t,n)=>{var r=n(8953),o=n(3664),i=n(5378),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,p,f,h,d=0,y=!1,m=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=c,r=l;return c=l=void 0,d=t,p=e.apply(r,n)}function g(e){var n=e-h;return void 0===h||n>=t||n<0||m&&e-d>=u}function w(){var e=o();if(g(e))return E(e);f=setTimeout(w,function(e){var n=t-(e-h);return m?s(n,u-(e-d)):n}(e))}function E(e){return f=void 0,b&&c?v(e):(c=l=void 0,p)}function S(){var e=o(),n=g(e);if(c=arguments,l=this,h=e,n){if(void 0===f)return function(e){return d=e,f=setTimeout(w,t),y?v(e):p}(h);if(m)return clearTimeout(f),f=setTimeout(w,t),v(h)}return void 0===f&&(f=setTimeout(w,t)),p}return t=i(t)||0,r(n)&&(y=!!n.leading,u=(m="maxWait"in n)?a(i(n.maxWait)||0,t):u,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==f&&clearTimeout(f),d=0,c=h=l=f=void 0},S.flush=function(){return void 0===f?p:E(o())},S}},9316:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},1256:(e,t,n)=>{var r=n(9250),o=n(2934),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},6397:e=>{var t=Array.isArray;e.exports=t},8330:(e,t,n)=>{var r=n(8446),o=n(3330);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},492:(e,t,n)=>{e=n.nmd(e);var r=n(1433),o=n(659),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||o;e.exports=c},8446:(e,t,n)=>{var r=n(7148),o=n(8953);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3330:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},422:(e,t,n)=>{var r=n(4800),o=n(41),i=n(3685),a=i&&i.isMap,s=a?o(a):r;e.exports=s},8953:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2934:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3764:(e,t,n)=>{var r=n(7866),o=n(41),i=n(3685),a=i&&i.isSet,s=a?o(a):r;e.exports=s},5414:(e,t,n)=>{var r=n(7148),o=n(2934);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7995:(e,t,n)=>{var r=n(7129),o=n(41),i=n(3685),a=i&&i.isTypedArray,s=a?o(a):r;e.exports=s},1178:(e,t,n)=>{var r=n(1163),o=n(1452),i=n(8330);e.exports=function(e){return i(e)?r(e):o(e)}},5405:(e,t,n)=>{var r=n(1163),o=n(1491),i=n(8330);e.exports=function(e){return i(e)?r(e,!0):o(e)}},3664:(e,t,n)=>{var r=n(1433);e.exports=function(){return r.Date.now()}},3629:e=>{e.exports=function(){return[]}},659:e=>{e.exports=function(){return!1}},2858:(e,t,n)=>{var r=n(6177),o=n(8953);e.exports=function(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(e,t,{leading:i,maxWait:t,trailing:a})}},5378:(e,t,n)=>{var r=n(8812),o=n(8953),i=n(5414),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},1664:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,a,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var l in i=Object(arguments[c]))n.call(i,l)&&(s[l]=i[l]);if(t){a=t(i);for(var u=0;u<a.length;u++)r.call(i,a[u])&&(s[a[u]]=i[a[u]])}}return s}},8802:(e,t,n)=>{var r=n(9134);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(t,n):r(t)?function(t,n,r){for(var o=[],i=0;i<t.length;i++)o.push(e(t[i],n,r).source);return u(new RegExp("(?:"+o.join("|")+")",p(r)),n)}(t,n,o):function(e,t,n){return f(i(e,n),t,n)}(t,n,o)},e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var p=n[0],f=n[1],h=n.index;if(s+=e.slice(a,h),a=h+p.length,f)s+=f[1];else{var d=e[a],y=n[2],m=n[3],b=n[4],v=n[5],g=n[6],w=n[7];s&&(r.push(s),s="");var E=null!=y&&null!=d&&d!==y,S="+"===g||"*"===g,O="?"===g||"*"===g,_=n[2]||u,P=b||v;r.push({name:m||i++,prefix:y||"",delimiter:_,optional:O,repeat:S,partial:E,asterisk:!!w,pattern:P?l(P):w?".*":"[^"+c(_)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",p(t)));return function(t,o){for(var i="",s=t||{},c=(o||{}).pretty?a:encodeURIComponent,l=0;l<e.length;l++){var u=e[l];if("string"!=typeof u){var p,f=s[u.name];if(null==f){if(u.optional){u.partial&&(i+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(f)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var h=0;h<f.length;h++){if(p=c(f[h]),!n[l].test(p))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(p)+"`");i+=(0===h?u.prefix:u.delimiter)+p}}else{if(p=u.asterisk?encodeURI(f).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):c(f),!n[l].test(p))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+p+'"');i+=u.prefix+p}}else i+=u}return i}}function c(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function p(e){return e&&e.sensitive?"":"i"}function f(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)a+=c(l);else{var f=c(l.prefix),h="(?:"+l.pattern+")";t.push(l),l.repeat&&(h+="(?:"+f+h+")*"),a+=h=l.optional?l.partial?f+"("+h+")?":"(?:"+f+"("+h+"))?":f+"("+h+")"}}var d=c(n.delimiter||"/"),y=a.slice(-d.length)===d;return o||(a=(y?a.slice(0,-d.length):a)+"(?:"+d+"(?=$))?"),a+=i?"$":o&&y?"":"(?="+d+"|$)",u(new RegExp("^"+a,p(n)),t)}},362:(e,t,n)=>{"use strict";var r=n(6441);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("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");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},2688:(e,t,n)=>{e.exports=n(362)()},6441:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1971:(e,t,n)=>{"use strict";const r=n(9676),o=n(378),i=n(3580),a=n(4987),s=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?o(e):e}function p(e){return Array.isArray(e)?e.sort():"object"==typeof e?p(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function f(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function h(e){const t=(e=f(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function y(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const a=o||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,a]=i(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=d(n[e],t);else r[e]=d(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e}),Object.create(null))}t.extract=h,t.parse=y,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",o,"]"].join("")]:[...n,[l(t,e),"[",l(o,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[l(n,e),t,l(o,e)].join("")]:[[r,l(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?l(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":o.reduce(r(n),[]).join("&"):l(n,t)+"="+l(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:y(h(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=f(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),a=Object.assign(i,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:a(i,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},5812:(e,t,n)=>{"use strict";var r=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},o=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}}(),i=n(8486),a=n(156),s=n(9318);e.exports=function(e){var t=e.displayName||e.name,n=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(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}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.handleClickOutside=t.handleClickOutside.bind(t),t}return function(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)}(n,t),o(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"handleClickOutside",value:function(e){var t=this.__domNode;t&&t.contains(e.target)||!this.__wrappedInstance||"function"!=typeof this.__wrappedInstance.handleClickOutside||this.__wrappedInstance.handleClickOutside(e)}},{key:"render",value:function(){var t=this,n=this.props,o=n.wrappedRef,i=function(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}(n,["wrappedRef"]);return a.createElement(e,r({},i,{ref:function(e){t.__wrappedInstance=e,t.__domNode=s.findDOMNode(e),o&&o(e)}}))}}]),n}(a.Component);return n.displayName="clickOutside("+t+")",i(n,e)}},7383:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,c,l,u;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(!i(e[c],a[c]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(e[c]!==a[c])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof a.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof a.toString)return e.toString()===a.toString();if((s=(l=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(t&&e instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!e.$$typeof)&&!i(e[l[c]],a[l[c]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},2740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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(156),i=s(o),a=s(n(2688));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(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,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){return this.props.useCapture,this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,i=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;r=this.props.isReverse?i:this.calculateOffset(e,i)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,o=t.hasMore,a=(t.initialLoad,t.isReverse),s=t.loader,c=(t.loadMore,t.pageStart,t.ref),l=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(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}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));l.ref=function(t){e.scrollComponent=t,c&&c(t)};var u=[n];return o&&(s?a?u.unshift(s):u.push(s):this.defaultLoader&&(a?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),i.default.createElement(r,l,u)}}]),t}(o.Component);c.propTypes={children:a.default.node.isRequired,element:a.default.node,hasMore:a.default.bool,initialLoad:a.default.bool,isReverse:a.default.bool,loader:a.default.node,loadMore:a.default.func.isRequired,pageStart:a.default.number,ref:a.default.func,getScrollParent:a.default.func,threshold:a.default.number,useCapture:a.default.bool,useWindow:a.default.bool},c.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=c,e.exports=t.default},808:(e,t,n)=>{e.exports=n(2740)},8299:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case l:case f:case m:case y:case c:return e;default:return t}}case o:return t}}}function S(e){return E(e)===p}t.AsyncMode=u,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isAsyncMode=function(e){return S(e)||E(e)===u},t.isConcurrentMode=S,t.isContextConsumer=function(e){return E(e)===l},t.isContextProvider=function(e){return E(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===f},t.isFragment=function(e){return E(e)===i},t.isLazy=function(e){return E(e)===m},t.isMemo=function(e){return E(e)===y},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===s},t.isStrictMode=function(e){return E(e)===a},t.isSuspense=function(e){return E(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===s||e===a||e===h||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===f||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w||e.$$typeof===b)},t.typeOf=E},4271:(e,t,n)=>{"use strict";e.exports=n(8299)},9805:(e,t,n)=>{"use strict";var r=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},o=a(n(156)),i=a(n(3124));function a(e){return e&&e.__esModule?e:{default:e}}var s=/(\{[\d|\w]+\})/;i.default.prototype.formatString=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=!1,c=(e||"").split(s).filter((function(e){return!!e})).map((function(e,t){if(e.match(s)){var i=e.slice(1,-1),c=n[i];if(null==c){var l=n[0][i];if(void 0===l)return c;c=l}return o.default.isValidElement(c)?(a=!0,o.default.Children.toArray(c).map((function(e){return r({},e,{key:t.toString()})}))):c}return e}));return a?c:c.join("")},t.A=i.default},2249:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),o=n(1368),i=n(135);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){return 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},s(e)}function c(){return c=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},c.apply(this,arguments)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(d,e);var t,n,o,a=(o=d,function(){var e,t=p(o);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?u(e):t}(this,e)});function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"mounted",!1),h(u(e),"isReady",!1),h(u(e),"isPlaying",!1),h(u(e),"isLoading",!0),h(u(e),"loadOnReady",null),h(u(e),"startOnPlay",!0),h(u(e),"seekOnPlay",null),h(u(e),"onDurationCalled",!1),h(u(e),"getInternalPlayer",(function(t){return e.player?e.player[t]:null})),h(u(e),"progress",(function(){if(e.props.url&&e.player&&e.isReady){var t=e.getCurrentTime()||0,n=e.getSecondsLoaded(),r=e.getDuration();if(r){var o={playedSeconds:t,played:t/r};null!==n&&(o.loadedSeconds=n,o.loaded=n/r),o.playedSeconds===e.prevPlayed&&o.loadedSeconds===e.prevLoaded||e.props.onProgress(o),e.prevPlayed=o.playedSeconds,e.prevLoaded=o.loadedSeconds}}e.progressTimeout=setTimeout(e.progress,e.props.progressFrequency||e.props.progressInterval)})),h(u(e),"handleReady",(function(){if(e.mounted){e.isReady=!0,e.isLoading=!1;var t=e.props,n=t.onReady,r=t.playing,o=t.volume,i=t.muted;n(),i||null===o||e.player.setVolume(o),e.loadOnReady?(e.player.load(e.loadOnReady,!0),e.loadOnReady=null):r&&e.player.play(),e.handleDurationCheck()}})),h(u(e),"handlePlay",(function(){e.isPlaying=!0,e.isLoading=!1;var t=e.props,n=t.onStart,r=t.onPlay,o=t.playbackRate;e.startOnPlay&&(e.player.setPlaybackRate&&1!==o&&e.player.setPlaybackRate(o),n(),e.startOnPlay=!1),r(),e.seekOnPlay&&(e.seekTo(e.seekOnPlay),e.seekOnPlay=null),e.handleDurationCheck()})),h(u(e),"handlePause",(function(t){e.isPlaying=!1,e.isLoading||e.props.onPause(t)})),h(u(e),"handleEnded",(function(){var t=e.props,n=t.activePlayer,r=t.loop,o=t.onEnded;n.loopOnEnded&&r&&e.seekTo(0),r||(e.isPlaying=!1,o())})),h(u(e),"handleError",(function(){var t;e.isLoading=!1,(t=e.props).onError.apply(t,arguments)})),h(u(e),"handleDurationCheck",(function(){clearTimeout(e.durationCheckTimeout);var t=e.getDuration();t?e.onDurationCalled||(e.props.onDuration(t),e.onDurationCalled=!0):e.durationCheckTimeout=setTimeout(e.handleDurationCheck,100)})),h(u(e),"handleLoaded",(function(){e.isLoading=!1})),h(u(e),"ref",(function(t){t&&(e.player=t)})),e}return t=d,n=[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.player.disablePIP&&this.player.disablePIP(),this.mounted=!1}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,s=n.muted,c=n.playbackRate,l=n.pip,u=n.loop,p=n.activePlayer;if(!(0,i.isEqual)(e.url,r)){if(this.isLoading&&!p.forceLoad)return console.warn("ReactPlayer: the attempt to load ".concat(r," is being deferred until the player has loaded")),void(this.loadOnReady=r);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}e.playing||!o||this.isPlaying||this.player.play(),e.playing&&!o&&this.isPlaying&&this.player.pause(),!e.pip&&l&&this.player.enablePIP&&this.player.enablePIP(),e.pip&&!l&&this.player.disablePIP&&this.player.disablePIP(),e.volume!==a&&null!==a&&this.player.setVolume(a),e.muted!==s&&(s?this.player.mute():(this.player.unmute(),null!==a&&setTimeout((function(){return t.player.setVolume(a)})))),e.playbackRate!==c&&this.player.setPlaybackRate&&this.player.setPlaybackRate(c),e.loop!==u&&this.player.setLoop&&this.player.setLoop(u)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():null}},{key:"seekTo",value:function(e,t){var n=this;if(!this.isReady&&0!==e)return this.seekOnPlay=e,void setTimeout((function(){n.seekOnPlay=null}),5e3);if(t?"fraction"===t:e>0&&e<1){var r=this.player.getDuration();return r?void this.player.seekTo(r*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return e?r.default.createElement(e,c({},this.props,{ref:this.ref,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}],n&&l(t.prototype,n),d}(r.Component);t.default=d,h(d,"displayName","Player"),h(d,"propTypes",o.propTypes),h(d,"defaultProps",o.defaultProps)},2490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}(n(156));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return i="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},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h="64px",d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(d,e);var t,n,o,a=(o=d,function(){var e,t=u(o);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=u(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?l(e):t}(this,e)});function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return f(l(e=a.call.apply(a,[this].concat(n))),"mounted",!1),f(l(e),"state",{image:null}),e}return t=d,(n=[{key:"componentDidMount",value:function(){this.mounted=!0,this.fetchImage(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.url,r=t.light;e.url===n&&e.light===r||this.fetchImage(this.props)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"fetchImage",value:function(e){var t=this,n=e.url,r=e.light;if("string"!=typeof r)return this.setState({image:null}),window.fetch("https://noembed.com/embed?url=".concat(n)).then((function(e){return e.json()})).then((function(e){if(e.thumbnail_url&&t.mounted){var n=e.thumbnail_url.replace("height=100","height=480");t.setState({image:n})}}));this.setState({image:r})}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.playIcon,o=this.state.image,i={display:"flex",alignItems:"center",justifyContent:"center"},a={preview:s({width:"100%",height:"100%",backgroundImage:o?"url(".concat(o,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},i),shadow:s({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:h,width:h,height:h},i),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},c=r.default.createElement("div",{style:a.shadow,className:"react-player__shadow"},r.default.createElement("div",{style:a.playIcon,className:"react-player__play-icon"}));return r.default.createElement("div",{style:a.preview,className:"react-player__preview",onClick:t},n||c)}}])&&c(t.prototype,n),d}(r.Component);t.default=d},1160:(e,t,n)=>{"use strict";t.Ay=void 0;var r=h(n(156)),o=n(1368),i=n(135),a=p(n(5283)),s=p(n(2249)),c=p(n(2490)),l=h(n(4084)),u=p(n(2195));p(n(9498)),p(n(3139)),p(n(1379)),p(n(2731)),p(n(6975)),p(n(5262)),p(n(8428)),p(n(1584)),p(n(4592));function p(e){return e&&e.__esModule?e:{default:e}}function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==d(e)&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function d(e){return d="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},d(e)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function b(){return b=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},b.apply(this,arguments)}function v(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function O(e,t){return O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},O(e,t)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=Object.keys(o.propTypes),k=[],j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&O(e,t)}(h,e);var t,n,p,f=(p=h,function(){var e,t=S(p);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=S(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?E(e):t}(this,e)});function h(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _(E(e=f.call.apply(f,[this].concat(n))),"config",(0,i.getConfig)(e.props,o.defaultProps,!0)),_(E(e),"state",{showPreview:!!e.props.light}),_(E(e),"handleClickPreview",(function(){e.setState({showPreview:!1})})),_(E(e),"showPreview",(function(){e.setState({showPreview:!0})})),_(E(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),_(E(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),_(E(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),_(E(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),_(E(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),_(E(e),"handleReady",(function(){e.props.onReady(E(e))})),_(E(e),"wrapperRef",(function(t){e.wrapper=t})),_(E(e),"activePlayerRef",(function(t){e.player=t})),e}return t=h,(n=[{key:"componentDidMount",value:function(){this.props.progressFrequency&&console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,i.isEqual)(this.props,e)||!(0,i.isEqual)(this.state,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props.light;this.config=(0,i.getConfig)(this.props,o.defaultProps),!e.light&&t&&this.setState({showPreview:!0}),e.light&&!t&&this.setState({showPreview:!1})}},{key:"getActivePlayer",value:function(e){for(var t=0,n=[].concat(v(k),v(a.default));t<n.length;t++){var r=n[t];if(r.canPlay(e))return r}return l.FilePlayer}},{key:"renderActivePlayer",value:function(e,t){return e?r.default.createElement(s.default,b({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.handleReady})):null}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.controls,a=e.style,s=e.width,l=e.height,p=e.light,f=e.playIcon,h=e.wrapper,d=this.state.showPreview&&t,y=(0,i.omit)(this.props,P,o.DEPRECATED_CONFIG_PROPS),g=this.getActivePlayer(t),w=this.renderActivePlayer(t,g),E=(0,u.default)(t,n,this.config),S=[w].concat(v(E)).sort(this.sortPlayers),O=r.default.createElement(c.default,{url:t,light:p,playIcon:f,onClick:this.handleClickPreview});return r.default.createElement(h,b({ref:this.wrapperRef,style:m({},a,{width:s,height:l})},y),d?O:S)}}])&&w(t.prototype,n),h}(r.Component);t.Ay=j,_(j,"addCustomPlayer",(function(e){k.push(e)})),_(j,"removeCustomPlayers",(function(){k=[]})),_(j,"displayName","ReactPlayer"),_(j,"propTypes",o.propTypes),_(j,"defaultProps",o.defaultProps),_(j,"canPlay",(function(e){for(var t=0,n=[].concat(v(k),v(a.default));t<n.length;t++)if(n[t].canPlay(e))return!0;return!1})),_(j,"canEnablePIP",(function(e){for(var t=0,n=[].concat(v(k),v(a.default));t<n.length;t++){var r=n[t];if(r.canEnablePIP&&r.canEnablePIP(e))return!0}return!1}))},1584:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DailyMotion=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=d(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),m(h(e),"onDurationChange",(function(){var t=e.getDuration();e.props.onDuration(t)})),m(h(e),"mute",(function(){e.callPlayer("setMuted",!0)})),m(h(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),m(h(e),"ref",(function(t){e.container=t})),e}return t=s,(n=[{key:"load",value:function(e){var t,n,r=this,o=this.props,a=o.controls,s=o.config,c=o.onError,l=o.playing,f=(t=e.match(b),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];this.player?this.player.load(f,{start:(0,i.parseStartTime)(e),autoplay:l}):(0,i.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",(function(e){return e.player})).then((function(t){if(r.container){var n=t.player;r.player=new n(r.container,{width:"100%",height:"100%",video:f,params:u({controls:a,autoplay:r.props.playing,mute:r.props.muted,start:(0,i.parseStartTime)(e),origin:window.location.origin},s.dailymotion.params),events:{apiready:r.props.onReady,seeked:function(){return r.props.onSeek(r.player.currentTime)},video_end:r.props.onEnded,durationchange:r.onDurationChange,pause:r.props.onPause,playing:r.props.onPlay,waiting:r.props.onBuffer,error:function(e){return c(e)}}})}}),c)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&f(t.prototype,n),s}(o.Component);t.DailyMotion=v,m(v,"displayName","DailyMotion"),m(v,"canPlay",(function(e){return b.test(e)})),m(v,"loopOnEnded",!0);var g=(0,a.default)(v);t.default=g},2731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Facebook=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d="https://connect.facebook.net/en_US/sdk.js",y="fbAsyncInit",m=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?u(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),h(u(e),"playerID",e.props.config.facebook.playerId||"".concat("facebook-player-").concat((0,i.randomString)())),h(u(e),"mute",(function(){e.callPlayer("mute")})),h(u(e),"unmute",(function(){e.callPlayer("unmute")})),e}return t=s,(n=[{key:"load",value:function(e,t){var n=this;t?(0,i.getSDK)(d,"FB",y).then((function(e){return e.XFBML.parse()})):(0,i.getSDK)(d,"FB",y).then((function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:n.props.config.facebook.version}),e.Event.subscribe("xfbml.render",(function(e){n.props.onLoaded()})),e.Event.subscribe("xfbml.ready",(function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("finishedBuffering",n.props.onBufferEnd),n.player.subscribe("error",n.props.onError),n.props.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")}))}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}])&&l(t.prototype,n),s}(o.Component);t.Facebook=b,h(b,"displayName","Facebook"),h(b,"canPlay",(function(e){return m.test(e)})),h(b,"loopOnEnded",!0);var v=(0,a.default)(b);t.default=v},4084:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FilePlayer=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(){return l=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.apply(this,arguments)}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var m="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,b=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,v=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,g=/\.(m3u8)($|\?)/i,w=/\.(mpd)($|\?)/i,E=/www\.dropbox\.com\/.+/;function S(e){if(e instanceof Array){var t,n=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("string"==typeof r&&S(r))return!0;if(S(r.src))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}return!!(0,i.isMediaStream)(e)||b.test(e)||v.test(e)||g.test(e)||w.test(e)}function O(e){return e||(e=document.createElement("video")),e.webkitSupportsPresentationMode&&"function"==typeof e.webkitSetPresentationMode&&!/iPhone|iPod/.test(navigator.userAgent)}var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(p(e=a.call.apply(a,[this].concat(n))),"onReady",(function(){var t;return(t=e.props).onReady.apply(t,arguments)})),d(p(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),d(p(e),"onBuffer",(function(){var t;return(t=e.props).onBuffer.apply(t,arguments)})),d(p(e),"onBufferEnd",(function(){var t;return(t=e.props).onBufferEnd.apply(t,arguments)})),d(p(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),d(p(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),d(p(e),"onError",(function(){var t;return(t=e.props).onError.apply(t,arguments)})),d(p(e),"onEnablePIP",(function(){var t;return(t=e.props).onEnablePIP.apply(t,arguments)})),d(p(e),"onDisablePIP",(function(t){var n=e.props,r=n.onDisablePIP,o=n.playing;r(t),o&&e.play()})),d(p(e),"onPresentationModeChange",(function(t){if(e.player&&O(e.player)){var n=e.player.webkitPresentationMode;"picture-in-picture"===n?e.onEnablePIP(t):"inline"===n&&e.onDisablePIP(t)}})),d(p(e),"onSeek",(function(t){e.props.onSeek(t.target.currentTime)})),d(p(e),"mute",(function(){e.player.muted=!0})),d(p(e),"unmute",(function(){e.player.muted=!1})),d(p(e),"renderSourceElement",(function(e,t){return"string"==typeof e?o.default.createElement("source",{key:t,src:e}):o.default.createElement("source",l({key:t},e))})),d(p(e),"renderTrack",(function(e,t){return o.default.createElement("track",l({key:t},e))})),d(p(e),"ref",(function(t){e.player&&(e.prevPlayer=e.player),e.player=t})),e}return t=s,(n=[{key:"componentDidMount",value:function(){this.addListeners(this.player),m&&this.player.load()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer),this.addListeners(this.player))}},{key:"componentWillUnmount",value:function(){this.removeListeners(this.player),this.hls&&this.hls.destroy()}},{key:"addListeners",value:function(e){var t=this.props.playsinline;e.addEventListener("canplay",this.onReady),e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),t&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}},{key:"removeListeners",value:function(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange)}},{key:"shouldUseAudio",value:function(e){return!e.config.file.forceVideo&&!e.config.file.attributes.poster&&(b.test(e.url)||e.config.file.forceAudio)}},{key:"shouldUseHLS",value:function(e){return g.test(e)&&!m||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return w.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this,n=this.props.config.file,r=n.hlsVersion,o=n.dashVersion;if(this.shouldUseHLS(e)&&(0,i.getSDK)("https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js".replace("VERSION",r),"Hls").then((function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,(function(e,r){t.props.onError(e,r,t.hls,n)})),t.hls.loadSource(e),t.hls.attachMedia(t.player)})),this.shouldUseDASH(e)&&(0,i.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js".replace("VERSION",o),"dashjs").then((function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.on("error",t.props.onError),t.dash.getDebug().setLogToBrowserConsole(!1)})),e instanceof Array)this.player.load();else if((0,i.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():O(this.player)&&"picture-in-picture"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():O(this.player)&&"inline"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){if(!this.player)return null;var e=this.player,t=e.duration,n=e.seekable;return t===1/0&&n.length>0?n.end(n.length-1):t}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,i.isMediaStream)(e)||t||n))return E.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,i=e.controls,a=e.muted,s=e.config,c=e.width,u=e.height,p=this.shouldUseAudio(this.props)?"audio":"video",f={width:"auto"===c?c:"100%",height:"auto"===u?u:"100%"};return o.default.createElement(p,l({ref:this.ref,src:this.getSource(t),style:f,preload:"auto",autoPlay:n||void 0,controls:i,muted:a,loop:r},s.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),s.file.tracks.map(this.renderTrack))}}])&&u(t.prototype,n),s}(o.Component);t.FilePlayer=_,d(_,"displayName","FilePlayer"),d(_,"canPlay",S),d(_,"canEnablePIP",(function(e){return S(e)&&(!!document.pictureInPictureEnabled||O())&&!b.test(e)}));var P=(0,a.default)(_);t.default=P},4592:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Mixcloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/mixcloud\.com\/([^/]+\/[^/]+)/,m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(p(e),"duration",null),d(p(e),"currentTime",null),d(p(e),"secondsLoaded",null),d(p(e),"mute",(function(){})),d(p(e),"unmute",(function(){})),d(p(e),"ref",(function(t){e.iframe=t})),e}return t=s,n=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then((function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then((function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on((function(e,n){t.currentTime=e,t.duration=n})),t.props.onReady()}))}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(y)[1],a=(0,i.queryString)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.mixcloud.options,{feed:"/".concat(r,"/")}));return o.default.createElement("iframe",{key:r,ref:this.ref,style:{width:"100%",height:"100%"},src:"https://www.mixcloud.com/widget/iframe/?".concat(a),frameBorder:"0"})}}],n&&u(t.prototype,n),s}(o.Component);t.Mixcloud=m,d(m,"displayName","Mixcloud"),d(m,"canPlay",(function(e){return y.test(e)})),d(m,"loopOnEnded",!0);var b=(0,a.default)(m);t.default=b},3139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SoundCloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(p(e),"duration",null),d(p(e),"currentTime",null),d(p(e),"fractionLoaded",null),d(p(e),"mute",(function(){e.setVolume(0)})),d(p(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),d(p(e),"ref",(function(t){e.iframe=t})),e}return t=s,n=[{key:"load",value:function(e,t){var n=this;(0,i.getSDK)("https://w.soundcloud.com/player/api.js","SC").then((function(r){if(n.iframe){var o=r.Widget.Events,i=o.PLAY,a=o.PLAY_PROGRESS,s=o.PAUSE,c=o.FINISH,u=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(i,n.props.onPlay),n.player.bind(s,n.props.onPause),n.player.bind(a,(function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress})),n.player.bind(c,(function(){return n.props.onEnded()})),n.player.bind(u,(function(e){return n.props.onError(e)}))),n.player.load(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration((function(e){n.duration=e/1e3,n.props.onReady()}))}}))}}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:e,frameBorder:0,allow:"autoplay"})}}],n&&u(t.prototype,n),s}(o.Component);t.SoundCloud=m,d(m,"displayName","SoundCloud"),d(m,"canPlay",(function(e){return y.test(e)})),d(m,"loopOnEnded",!0);var b=(0,a.default)(m);t.default=b},6975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Streamable=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=/streamable\.com\/([a-z0-9]+)$/,y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=p(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?u(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return h(u(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),h(u(e),"duration",null),h(u(e),"currentTime",null),h(u(e),"secondsLoaded",null),h(u(e),"mute",(function(){e.callPlayer("mute")})),h(u(e),"unmute",(function(){e.callPlayer("unmute")})),h(u(e),"ref",(function(t){e.iframe=t})),e}return t=s,(n=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then((function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),t.player.on("ready",t.props.onReady),t.player.on("play",t.props.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.duration,r=e.seconds;t.duration=n,t.currentTime=r})),t.player.on("buffered",(function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)})),t.props.muted&&t.player.mute())}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(d)[1];return o.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(e),frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allowFullScreen:!0})}}])&&l(t.prototype,n),s}(o.Component);t.Streamable=y,h(y,"displayName","Streamable"),h(y,"canPlay",(function(e){return d.test(e)}));var m=(0,a.default)(y);t.default=m},8428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Twitch=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,m=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(p(e),"playerID",e.props.config.twitch.playerId||"".concat("twitch-player-").concat((0,i.randomString)())),d(p(e),"mute",(function(){e.callPlayer("setMuted",!0)})),d(p(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),e}return t=s,n=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,s=r.config,c=r.controls,u=m.test(e),p=u?e.match(m)[1]:e.match(y)[1];t?u?this.player.setChannel(p):this.player.setVideo("v"+p):(0,i.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then((function(e){n.player=new e.Player(n.playerID,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({video:u?"":p,channel:u?p:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted,controls:!!u||c},s.twitch.options));var t=e.Player,r=t.READY,i=t.PLAYING,a=t.PAUSE,f=t.ENDED,h=t.ONLINE,y=t.OFFLINE;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(i,n.props.onPlay),n.player.addEventListener(a,n.props.onPause),n.player.addEventListener(f,n.props.onEnded),n.player.addEventListener(h,n.props.onLoaded),n.player.addEventListener(y,n.props.onLoaded)}),a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}],n&&u(t.prototype,n),s}(o.Component);t.Twitch=b,d(b,"displayName","Twitch"),d(b,"canPlay",(function(e){return y.test(e)||m.test(e)})),d(b,"loopOnEnded",!0);var v=(0,a.default)(b);t.default=v},1379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Vimeo=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=/vimeo\.com\/.+/,m=/vimeo\.com\/external\/[0-9]+\..+/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=f(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),d(p(e),"duration",null),d(p(e),"currentTime",null),d(p(e),"secondsLoaded",null),d(p(e),"mute",(function(){e.setVolume(0)})),d(p(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),d(p(e),"ref",(function(t){e.container=t})),e}return t=s,n=[{key:"load",value:function(e){var t=this;this.duration=null,(0,i.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then((function(n){t.container&&(t.player=new n.Player(t.container,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({url:e,autoplay:t.props.playing,muted:t.props.muted,loop:t.props.loop,playsinline:t.props.playsinline,controls:t.props.controls},t.props.config.vimeo.playerOptions)),t.player.ready().then((function(){var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"})).catch(t.props.onError),t.player.on("loaded",(function(){t.props.onReady(),t.refreshDuration()})),t.player.on("play",(function(){t.props.onPlay(),t.refreshDuration()})),t.player.on("pause",t.props.onPause),t.player.on("seeked",(function(e){return t.props.onSeek(e.seconds)})),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.seconds;t.currentTime=n})),t.player.on("progress",(function(e){var n=e.seconds;t.secondsLoaded=n})))}),this.props.onError)}},{key:"refreshDuration",value:function(){var e=this;this.player.getDuration().then((function(t){e.duration=t}))}},{key:"play",value:function(){var e=this.callPlayer("play");e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e={width:"100%",height:"100%",overflow:"hidden",display:this.props.display};return o.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}],n&&u(t.prototype,n),s}(o.Component);t.Vimeo=b,d(b,"displayName","Vimeo"),d(b,"forceLoad",!0),d(b,"canPlay",(function(e){return!m.test(e)&&y.test(e)}));var v=(0,a.default)(b);t.default=v},5262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Wistia=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=h(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return y(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),y(f(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),y(f(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),y(f(e),"onSeek",(function(){var t;return(t=e.props).onSeek.apply(t,arguments)})),y(f(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),y(f(e),"mute",(function(){e.callPlayer("mute")})),y(f(e),"unmute",(function(){e.callPlayer("unmute")})),e}return t=s,(n=[{key:"getID",value:function(e){return e&&e.match(m)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,s=n.onReady,c=n.config,l=n.onError;(0,i.getSDK)("https://fast.wistia.com/assets/external/E-v1.js","Wistia").then((function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:u({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},c.wistia.options),onReady:function(e){t.player=e,t.unbind(),t.player.bind("play",t.onPlay),t.player.bind("pause",t.onPause),t.player.bind("seek",t.onSeek),t.player.bind("end",t.onEnded),s()}})}),l)}},{key:"unbind",value:function(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.unbind(),this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_".concat(e);return o.default.createElement("div",{key:e,className:t,style:{width:"100%",height:"100%"}})}}])&&p(t.prototype,n),s}(o.Component);t.Wistia=b,y(b,"displayName","Wistia"),y(b,"canPlay",(function(e){return m.test(e)})),y(b,"loopOnEnded",!0);var v=(0,a.default)(b);t.default=v},9498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.YouTube=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(135),a=(r=n(1057))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/,v=/list=([a-zA-Z0-9_-]+)/;function g(e){return v.test(e)?{listType:"playlist",list:(t=e.match(v),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1]}:{};var t,n}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t,n,r,a=(r=s,function(){var e,t=h(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?f(e):t}(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return y(f(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),y(f(e),"onStateChange",(function(t){var n=t.data,r=e.props,o=r.onPlay,i=r.onPause,a=r.onBuffer,s=r.onBufferEnd,c=r.onEnded,l=r.onReady,u=r.loop,p=window.YT.PlayerState,f=p.PLAYING,h=p.PAUSED,d=p.BUFFERING,y=p.ENDED,m=p.CUED;if(n===f&&(o(),s()),n===h&&i(),n===d&&a(),n===y){var b=!!e.callPlayer("getPlaylist");u&&!b&&e.play(),c()}n===m&&l()})),y(f(e),"mute",(function(){e.callPlayer("mute")})),y(f(e),"unmute",(function(){e.callPlayer("unMute")})),y(f(e),"ref",(function(t){e.container=t})),e}return t=s,(n=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,s=r.playsinline,c=r.controls,l=r.loop,p=r.config,f=r.onError,h=p.youtube,d=h.playerVars,y=h.embedOptions,m=e&&e.match(b)[1];if(t)return v.test(e)?void this.player.loadPlaylist(g(e)):void this.player.cueVideoById({videoId:m,startSeconds:(0,i.parseStartTime)(e)||d.start,endSeconds:(0,i.parseEndTime)(e)||d.end});(0,i.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",(function(e){return e.loaded})).then((function(t){n.container&&(n.player=new t.Player(n.container,u({width:"100%",height:"100%",videoId:m,playerVars:u({autoplay:o?1:0,mute:a?1:0,controls:c?1:0,start:(0,i.parseStartTime)(e),end:(0,i.parseEndTime)(e),origin:window.location.origin,playsinline:s},g(e),{},d),events:{onReady:function(){l&&n.player.setLoop(!0),n.props.onReady()},onStateChange:n.onStateChange,onError:function(e){return f(e.data)}}},y)))}),f)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e),this.props.playing||this.pause()}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&p(t.prototype,n),s}(o.Component);t.YouTube=w,y(w,"displayName","YouTube"),y(w,"canPlay",(function(e){return b.test(e)}));var E=(0,a.default)(w);t.default=E},5283:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(9498),o=n(3139),i=n(1379),a=n(2731),s=n(6975),c=n(5262),l=n(8428),u=n(1584),p=n(4592),f=n(4084),h=[r.YouTube,o.SoundCloud,i.Vimeo,a.Facebook,s.Streamable,c.Wistia,l.Twitch,u.DailyMotion,p.Mixcloud,f.FilePlayer];t.default=h},2195:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var i,a=[],s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(p);try{for(s.s();!(i=s.n()).done;){var c=i.value;!c.Player.canPlay(e)&&n[c.configKey].preload&&a.push(r.default.createElement(o.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,controls:t,playing:!0,muted:!0,display:"none"}))}}catch(e){s.e(e)}finally{s.f()}return a};var r=l(n(156)),o=l(n(2249)),i=n(9498),a=n(3139),s=n(1379),c=n(1584);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=[{Player:i.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:a.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:s.Vimeo,configKey:"vimeo",url:"https://vimeo.com/300970506"},{Player:c.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}]},1368:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r,o=(r=n(2688))&&r.__esModule?r:{default:r},i=o.default.string,a=o.default.bool,s=o.default.number,c=o.default.array,l=o.default.oneOfType,u=o.default.shape,p=o.default.object,f=o.default.func,h=o.default.node,d={url:l([i,c,p]),playing:a,loop:a,controls:a,volume:s,muted:a,playbackRate:s,width:l([i,s]),height:l([i,s]),style:p,progressInterval:s,playsinline:a,pip:a,light:l([a,i]),playIcon:h,wrapper:l([i,f,u({render:f.isRequired})]),config:u({soundcloud:u({options:p,preload:a}),youtube:u({playerVars:p,embedOptions:p,preload:a}),facebook:u({appId:i,version:i,playerId:i}),dailymotion:u({params:p,preload:a}),vimeo:u({playerOptions:p,preload:a}),file:u({attributes:p,tracks:c,forceVideo:a,forceAudio:a,forceHLS:a,forceDASH:a,hlsOptions:p,hlsVersion:i,dashVersion:i}),wistia:u({options:p}),mixcloud:u({options:p}),twitch:u({options:p,playerId:i})}),onReady:f,onStart:f,onPlay:f,onPause:f,onBuffer:f,onBufferEnd:f,onEnded:f,onError:f,onDuration:f,onSeek:f,onProgress:f,onEnablePIP:f,onDisablePIP:f};t.propTypes=d,t.defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,light:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},preload:!1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{},hlsVersion:"0.13.1",dashVersion:"2.9.2"},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onBufferEnd:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){},onEnablePIP:function(){},onDisablePIP:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","fileConfig","wistiaConfig"]},1057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n;return n=t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(g,t);var n,r,c,p=(n=g,function(){var e,t=y(n);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()){var r=y(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?d(e):t}(this,e)});function g(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(d(e=p.call.apply(p,[this].concat(n))),"config",(0,a.getConfig)(e.props,i.defaultProps,!0)),b(d(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),b(d(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),b(d(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),b(d(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),b(d(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),b(d(e),"ref",(function(t){e.player=t})),e}return r=g,(c=[{key:"shouldComponentUpdate",value:function(e){return!(0,a.isEqual)(this.props,e)}},{key:"componentDidUpdate",value:function(){this.config=(0,a.getConfig)(this.props,i.defaultProps)}},{key:"render",value:function(){var t=this.config.file,n=t.forceVideo,r=t.forceAudio,c=t.forceHLS,l=t.forceDASH,p=n||r||c||l;if(!e.canPlay(this.props.url)&&!p)return null;var h=this.props,d=h.style,y=h.width,m=h.height,b=h.wrapper,g=(0,a.omit)(this.props,v,i.DEPRECATED_CONFIG_PROPS);return o.default.createElement(b,u({style:f({},d,{width:y,height:m})},g),o.default.createElement(s.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}])&&h(r.prototype,c),g}(o.Component),b(t,"displayName","".concat(e.displayName,"Player")),b(t,"propTypes",i.propTypes),b(t,"defaultProps",i.defaultProps),b(t,"canPlay",e.canPlay),n};var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(156)),i=n(1368),a=n(135),s=(r=n(2249))&&r.__esModule?r:{default:r};function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){return l="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},l(e)}function u(){return 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},u.apply(this,arguments)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=Object.keys(i.propTypes)},135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseStartTime=function(e){return m(e,f)},t.parseEndTime=function(e){return m(e,h)},t.randomString=function(){return Math.random().toString(36).substr(2,5)},t.queryString=function(e){return Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&")},t.getSDK=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise((function(r,o){if(b[e])b[e].push({resolve:r,reject:o});else{b[e]=[{resolve:r,reject:o}];var a=function(t){b[e].forEach((function(e){return e.resolve(t)}))};if(n){var s=window[n];window[n]=function(){s&&s(),a(window[t])}}i(e,(function(r){r?(b[e].forEach((function(e){return e.reject(r)})),b[e]=null):n||a(window[t])}))}}))},t.getConfig=function(e,t,n){var r,o=(0,i.default)(t.config,e.config),s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=u(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(a.DEPRECATED_CONFIG_PROPS);try{for(s.s();!(r=s.n()).done;){var c=r.value;if(e[c]){var p=c.replace(/Config$/,"");if(o=(0,i.default)(o,l({},p,e[c])),n){var f="ReactPlayer: %c".concat(c," %cis deprecated, please use the config prop instead – ").concat("https://github.com/CookPete/react-player#config-prop");console.warn(f,"font-weight: bold","")}}}}catch(e){s.e(e)}finally{s.f()}return o},t.omit=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=(t=[]).concat.apply(t,r),a={},s=0,c=Object.keys(e);s<c.length;s++){var l=c[s];-1===i.indexOf(l)&&(a[l]=e[l])}return a},t.callPlayer=function(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: ".concat(this.constructor.displayName," player could not call %c").concat(e,"%c – ");return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return(t=this.player)[e].apply(t,o)},t.isObject=v,t.isEqual=function e(t,n){if("function"==typeof t&&"function"==typeof n)return!0;if((0,r.isValidElement)(t)&&(0,r.isValidElement)(n))return!0;if(t instanceof Array&&n instanceof Array){if(t.length!==n.length)return!1;for(var o=0;o!==t.length;o++)if(!e(t[o],n[o]))return!1;return!0}if(v(t)&&v(n)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];if(!e(t[s],n[s]))return!1}return!0}return t===n},t.isMediaStream=function(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream};var r=n(156),o=s(n(4351)),i=s(n(4156)),a=n(1368);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="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},c(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=/[?&#](?:start|t)=([0-9hms]+)/,h=/[?&#]end=([0-9hms]+)/,d=/(\d+)(h|m|s)/g,y=/^\d+$/;function m(e,t){var n=e.match(t);if(n){var r=n[1];if(r.match(d))return function(e){for(var t,n,r=0,o=d.exec(e);null!==o;){var i=(n=3,function(e){if(Array.isArray(e))return e}(t=o)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||u(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[1],s=i[2];"h"===s&&(r+=60*parseInt(a,10)*60),"m"===s&&(r+=60*parseInt(a,10)),"s"===s&&(r+=parseInt(a,10)),o=d.exec(e)}return r}(r);if(y.test(r))return parseInt(r)}}var b={};function v(e){return null!==e&&"object"===c(e)}},8325:(e,t,n)=>{"use strict";var r=n(4271),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var b=a[m];if(!(i[b]||r&&r[b]||y&&y[b]||s&&s[b])){var v=f(n,b);try{l(t,b,v)}catch(e){}}}}return t}},9406:(e,t,n)=>{"use strict";var r,o=n(156),i=(r=o)&&"object"==typeof r&&"default"in r?r.default:r;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var c,l=[];function u(){c=e(l.map((function(e){return e.props}))),p.canUseDOM?t(c):n&&(c=n(c))}var p=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.peek=function(){return c},o.rewind=function(){if(o.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=c;return c=void 0,l=[],e};var a=o.prototype;return a.UNSAFE_componentWillMount=function(){l.push(this),u()},a.componentDidUpdate=function(){u()},a.componentWillUnmount=function(){var e=l.indexOf(this);l.splice(e,1),u()},a.render=function(){return i.createElement(r,this.props)},o}(o.PureComponent);return a(p,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),a(p,"canUseDOM",s),p}}},259:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,r,o,i,a,s=1,c={},l=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){o.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(h,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return c[s]=o,n(s),s++},p.clearImmediate=f}function f(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(undefined,n)}}(t)}finally{f(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},3580:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},9676:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},6660:function(e,t,n){var r;!function(o,i){"use strict";var a="function",s="undefined",c="object",l="string",u="major",p="model",f="name",h="type",d="vendor",y="version",m="architecture",b="console",v="mobile",g="tablet",w="smarttv",E="wearable",S="embedded",O="Amazon",_="Apple",P="ASUS",k="BlackBerry",j="Browser",C="Chrome",T="Firefox",x="Google",D="Huawei",N="LG",R="Microsoft",M="Motorola",I="Opera",A="Samsung",L="Sharp",B="Sony",F="Xiaomi",U="Zebra",q="Facebook",K="Chromium OS",V="Mac OS",z=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},W=function(e,t){return typeof e===l&&-1!==H(t).indexOf(H(e))},H=function(e){return e.toLowerCase()},$=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},G=function(e,t){for(var n,r,o,s,l,u,p=0;p<t.length&&!l;){var f=t[p],h=t[p+1];for(n=r=0;n<f.length&&!l&&f[n];)if(l=f[n++].exec(e))for(o=0;o<h.length;o++)u=l[++r],typeof(s=h[o])===c&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):i:this[s[0]]=u?s[1].call(this,u,s[2]):i:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):i):this[s]=u||i;p+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(W(t[n][r],e))return"?"===n?i:n}else if(W(t[n],e))return"?"===n?i:n;return e},Q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,y],[/opios[\/ ]+([\w\.]+)/i],[y,[f,I+" Mini"]],[/\bopr\/([\w\.]+)/i],[y,[f,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[f,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,y],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[f,"UC"+j]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[f,"Smart Lenovo "+j]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+j],y],[/\bfocus\/([\w\.]+)/i],[y,[f,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[f,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[f,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[f,"MIUI "+j]],[/fxios\/([-\w\.]+)/i],[y,[f,T]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+j]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+j],y],[/samsungbrowser\/([\w\.]+)/i],[y,[f,A+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],y],[/metasr[\/ ]?([\d\.]+)/i],[y,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[f,y],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,q],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[f,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,C+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[f,"Android "+j]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[y,J,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[f,T+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,y],[/(cobalt)\/([\w\.]+)/i],[f,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,H]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",H]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[d,A],[h,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[d,A],[h,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,_],[h,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,_],[h,g]],[/(macintosh);/i],[p,[d,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,L],[h,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[d,D],[h,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,D],[h,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[d,F],[h,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[d,F],[h,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,"OPPO"],[h,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,"Vivo"],[h,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,"Realme"],[h,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[d,M],[h,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,M],[h,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,N],[h,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,N],[h,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[d,"Lenovo"],[h,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[d,"Nokia"],[h,v]],[/(pixel c)\b/i],[p,[d,x],[h,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[d,x],[h,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[d,B],[h,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[d,B],[h,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[d,"OnePlus"],[h,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,O],[h,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[d,O],[h,v]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[h,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,k],[h,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,P],[h,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,P],[h,v]],[/(nexus 9)/i],[p,[d,"HTC"],[h,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g," "],[h,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,"Acer"],[h,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,"Meizu"],[h,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,"Ulefone"],[h,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,p,[h,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,p,[h,g]],[/(surface duo)/i],[p,[d,R],[h,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,"Fairphone"],[h,v]],[/(u304aa)/i],[p,[d,"AT&T"],[h,v]],[/\bsie-(\w*)/i],[p,[d,"Siemens"],[h,v]],[/\b(rct\w+) b/i],[p,[d,"RCA"],[h,g]],[/\b(venue[\d ]{2,7}) b/i],[p,[d,"Dell"],[h,g]],[/\b(q(?:mv|ta)\w+) b/i],[p,[d,"Verizon"],[h,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[d,"Barnes & Noble"],[h,g]],[/\b(tm\d{3}\w+) b/i],[p,[d,"NuVision"],[h,g]],[/\b(k88) b/i],[p,[d,"ZTE"],[h,g]],[/\b(nx\d{3}j) b/i],[p,[d,"ZTE"],[h,v]],[/\b(gen\d{3}) b.+49h/i],[p,[d,"Swiss"],[h,v]],[/\b(zur\d{3}) b/i],[p,[d,"Swiss"],[h,g]],[/\b((zeki)?tb.*\b) b/i],[p,[d,"Zeki"],[h,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],p,[h,g]],[/\b(ns-?\w{0,9}) b/i],[p,[d,"Insignia"],[h,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[d,"NextBook"],[h,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],p,[h,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],p,[h,v]],[/\b(ph-1) /i],[p,[d,"Essential"],[h,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[d,"Envizen"],[h,g]],[/\b(trio[-\w\. ]+) b/i],[p,[d,"MachSpeed"],[h,g]],[/\btu_(1491) b/i],[p,[d,"Rotor"],[h,g]],[/(shield[\w ]+) b/i],[p,[d,"Nvidia"],[h,g]],[/(sprint) (\w+)/i],[d,p,[h,v]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[d,R],[h,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,U],[h,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,U],[h,v]],[/smart-tv.+(samsung)/i],[d,[h,w]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[d,A],[h,w]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,N],[h,w]],[/(apple) ?tv/i],[d,[p,_+" TV"],[h,w]],[/crkey/i],[[p,C+"cast"],[d,x],[h,w]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,O],[h,w]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,L],[h,w]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,B],[h,w]],[/(mitv-\w{5}) bui/i],[p,[d,F],[h,w]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[h,w]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,$],[p,$],[h,w]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,w]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,p,[h,b]],[/droid.+; (shield) bui/i],[p,[d,"Nvidia"],[h,b]],[/(playstation [345portablevi]+)/i],[p,[d,B],[h,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,R],[h,b]],[/((pebble))app/i],[d,p,[h,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,_],[h,E]],[/droid.+; (glass) \d/i],[p,[d,x],[h,E]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,U],[h,E]],[/(quest( 2| pro)?)/i],[p,[d,q],[h,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,S]],[/(aeobc)\b/i],[p,[d,O],[h,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[h,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[h,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,v]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[y,J,Q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,J,Q],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,V],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,y],[/\(bb(10);/i],[y,[f,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[f,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[f,C+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,K],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,y],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,y]]},X=function(e,t){if(typeof e===c&&(t=e,e=i),!(this instanceof X))return new X(e,t).getResult();var n=typeof o!==s&&o.navigator?o.navigator:i,r=e||(n&&n.userAgent?n.userAgent:""),b=n&&n.userAgentData?n.userAgentData:i,w=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(Y,t):Y,E=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[f]=i,t[y]=i,G.call(t,r,w.browser),t[u]=typeof(e=t[y])===l?e.replace(/[^\d\.]/g,"").split(".")[0]:i,E&&n&&n.brave&&typeof n.brave.isBrave==a&&(t[f]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,G.call(e,r,w.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[p]=i,e[h]=i,G.call(e,r,w.device),E&&!e[h]&&b&&b.mobile&&(e[h]=v),E&&"Macintosh"==e[p]&&n&&typeof n.standalone!==s&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[p]="iPad",e[h]=g),e},this.getEngine=function(){var e={};return e[f]=i,e[y]=i,G.call(e,r,w.engine),e},this.getOS=function(){var e={};return e[f]=i,e[y]=i,G.call(e,r,w.os),E&&!e[f]&&b&&"Unknown"!=b.platform&&(e[f]=b.platform.replace(/chrome os/i,K).replace(/macos/i,V)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===l&&e.length>500?$(e,500):e,this},this.setUA(r),this};X.VERSION="0.7.37",X.BROWSER=z([f,y,u]),X.CPU=z([m]),X.DEVICE=z([p,d,h,b,v,w,g,E,S]),X.ENGINE=X.OS=z([f,y]),typeof t!==s?(e.exports&&(t=e.exports=X),t.UAParser=X):n.amdO?(r=function(){return X}.call(t,n,t,e))===i||(e.exports=r):typeof o!==s&&(o.UAParser=X);var Z=typeof o!==s&&(o.jQuery||o.Zepto);if(Z&&!Z.ua){var ee=new X;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:this)},156:t=>{"use strict";t.exports=e},9318:e=>{"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.amdO={},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";o.r(i),o.d(i,{AssetProjectEditor:()=>bA,AssetView:()=>XC,CatteryApp:()=>sC,CourseView:()=>ED,DashboardApp:()=>dl,DiscussionApp:()=>WE,Enums:()=>c,ExploreApp:()=>nP,ExtensionProjectEditor:()=>rL,ExtensionView:()=>sT,InfiniteScrollGalleryContainer:()=>tl,MultiSelectEditor:()=>wa,PlaylistPlayer:()=>LD,PlaylistView:()=>lx,PortfolioView:()=>mC,ProfileApp:()=>$_,ProfileAvatarEditor:()=>EL,ProfileRenameInput:()=>fL,ProjectEditor:()=>II,QuickSearch:()=>Ee,Resources:()=>s,SearchApp:()=>Nr,ShareApp:()=>tP,SimpleGalleryView:()=>vS,TrainingView:()=>MC,WatchApp:()=>OO});const e=new(o(9805).A)({en:{BasicTraining:"Basic Training",Captions:"Caption Languages",Categories:"Categories",Category:"Category",CourseFiles:"Course Files",CoursePlayButton:{StartTheCourse:"Start the Course",WatchAgain:"Watch Again",ContinueWatching:"Continue Watching"},Current:"Current",Discussion:"Discussion",Docs:"Docs",Experience:{Beginner:"Beginner",Intermediate:"Intermediate",Experienced:"Experienced",Advanced:"Advanced",All:"All Skill Levels"},Files:"Files",Instructor:"Instructor",Instructors:"Instructors",Learn:"Learn",Length:"Length",Level:"Level",Overview:"Overview",Products:"Products",ShowMore:"Show More",Tags:"Tags",Tutorials:"Tutorials",VersionRequired:"Version Required",Video:"Video",Videos:"Videos"},ja:{BasicTraining:"ベーシックトレーニング",Categories:"カテゴリー",Category:"カテゴリー",CourseFiles:"学習用ファイル",CoursePlayButton:{StartTheCourse:"コースを開始",WatchAgain:"もう一度観ます",ContinueWatching:"見続けます"},Current:"現在",Discussion:"ディスカッション",Docs:"ドキュメント",Experience:{Beginner:"初級",Intermediate:"中級",Advanced:"上級"},Instructor:"インストラクター",Learn:"学びましょう",Length:"長さ",Level:"レベル",Overview:"概要",Products:"製品",ShowMore:"さらに表示する",Tags:"タグ",Tutorials:"チュートリアル",Video:"ビデオ",Videos:"ビデオ"},ko:{BasicTraining:"기본 교육",Categories:"카테고리",Category:"카테고리",CourseFiles:"코스 파일",CoursePlayButton:{StartTheCourse:"코스 시작하기",WatchAgain:"다시보기",ContinueWatching:"보고 계속"},Current:"현재",Discussion:"토론하기",Docs:"문서",Experience:{Beginner:"초급",Intermediate:"중급",Advanced:"고급"},Instructor:"강사",Learn:"학습하기",Length:"길이",Level:"레벨",Overview:"개요",Products:"프로덕트",ShowMore:"더 보기",Tags:"태그",Tutorials:"튜토리얼",Video:"비디오",Videos:"비디오"},zh:{BasicTraining:"基础训练",Categories:"分类",Category:"类别",CourseFiles:"课程文件",CoursePlayButton:{StartTheCourse:"开始课程",WatchAgain:"再次在手表",ContinueWatching:"继续观看"},Current:"当前",Discussion:"讨论",Docs:"文件",Experience:{Beginner:"初学者",Intermediate:"中间",Advanced:"高级"},Instructor:"讲师",Learn:"学习",Length:"长度",Level:"水平",Overview:"概观",Products:"制品",ShowMore:"展示更多",Tags:"标签",Tutorials:"教程",Video:"视频",Videos:"影片"}});function t(e){return t="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},t(e)}function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function r(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"setLanguage",value:function(e){null===e&&(e="en"),this.language=e,this.UI.setLanguage(e)}},{key:"getLanguage",value:function(){return this.language}}],null&&n(e.prototype,null),t&&n(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();!function(e,t,n){(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(a,"UI",e);const s=a,c={ProjectTypes:{Portfolio:3,Training:4,Asset:1,Extension:2},NotificationPeriod:{None:0,BookmarkOnly:10,OncePerView:50,AllUpdates:100},LoadStatus:{PreLoad:"PreLoad",Loading:"Loading",Loaded:"Loaded",Error:"Error"},ConsumerTypes:{Collection:"collections",Project:"projects"}};var l=o(156),u=o.n(l),p=o(2858),f=o.n(p),h=o(2688),d=o.n(h),y=o(9318),m=o.n(y),b=!("undefined"==typeof window||!window.document||!window.document.createElement),v=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}}(),g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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,e),v(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return b?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),m().createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(u().Component);g.propTypes={children:d().node.isRequired,node:d().any};const w=g;var E=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}}(),S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(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,e),E(t,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(e){this.renderPortal()}},{key:"componentWillUnmount",value:function(){m().unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(e){this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var t=this.props.children;"function"==typeof this.props.children.type&&(t=u().cloneElement(this.props.children)),this.portal=m().unstable_renderSubtreeIntoContainer(this,t,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),t}(u().Component);const O=S;S.propTypes={children:d().node.isRequired,node:d().any};const _=m().createPortal?w:O;var P=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}}(),k=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.portalNode=null,n.state={active:!!e.defaultOpen},n.openPortal=n.openPortal.bind(n),n.closePortal=n.closePortal.bind(n),n.wrapWithPortal=n.wrapWithPortal.bind(n),n.handleOutsideMouseClick=n.handleOutsideMouseClick.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(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,e),P(t,[{key:"componentDidMount",value:function(){this.props.closeOnEsc&&document.addEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.addEventListener("click",this.handleOutsideMouseClick)}},{key:"componentWillUnmount",value:function(){this.props.closeOnEsc&&document.removeEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.removeEventListener("click",this.handleOutsideMouseClick)}},{key:"openPortal",value:function(e){this.state.active||(e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.setState({active:!0},this.props.onOpen))}},{key:"closePortal",value:function(){this.state.active&&this.setState({active:!1},this.props.onClose)}},{key:"wrapWithPortal",value:function(e){var t=this;return this.state.active?u().createElement(_,{node:this.props.node,key:"react-portal",ref:function(e){return t.portalNode=e}},e):null}},{key:"handleOutsideMouseClick",value:function(e){if(this.state.active){var t=this.portalNode&&(this.portalNode.props.node||this.portalNode.defaultNode);!t||t.contains(e.target)||e.button&&0!==e.button||this.closePortal()}}},{key:"handleKeydown",value:function(e){27===e.keyCode&&this.state.active&&this.closePortal()}},{key:"render",value:function(){return this.props.children({openPortal:this.openPortal,closePortal:this.closePortal,portal:this.wrapWithPortal,isOpen:this.state.active})}}]),t}(u().Component);k.propTypes={children:d().func.isRequired,defaultOpen:d().bool,node:d().any,closeOnEsc:d().bool,closeOnOutsideClick:d().bool,onOpen:d().func,onClose:d().func},k.defaultProps={onOpen:function(){},onClose:function(){}};const j=k;function C(e){return C="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},C(e)}function T(){return T=Object.assign?Object.assign.bind():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},T.apply(this,arguments)}function x(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,D(r.key),r)}}function D(e){var t=function(e,t){if("object"!=C(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==C(t)?t:t+""}function N(e,t,n){return t=M(t),function(e,t){if(t&&("object"===C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,R()?Reflect.construct(t,n||[],M(e).constructor):t.apply(e,n))}function R(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(R=function(){return!!e})()}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},M(e)}function I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}var A=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=N(this,t,[e])).handleOverlayClick=n.handleOverlayClick.bind(n),n.handleCloseClick=n.handleCloseClick.bind(n),n.handlePortalClose=n.handlePortalClose.bind(n),n.preventClose=n.preventClose.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&I(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.windowScrollTop=$(window).scrollTop();var e=-1*this.windowScrollTop+"px",t=$("body");this.bodyStyle=t.attr("style"),$("body").attr("style","position: fixed; width: 100%; top: "+e)}},{key:"componentWillUnmount",value:function(){$("body").removeAttr("style"),$(window).scrollTop(this.windowScrollTop)}},{key:"handleOverlayClick",value:function(e){e.stopPropagation(),!0===this.props.closeOnOutsideClick&&(this.isClosed=!0,this.props.onClose&&this.props.onClose())}},{key:"handleCloseClick",value:function(e){e.stopPropagation(),this.isClosed=!0,this.props.onClose&&this.props.onClose()}},{key:"handlePortalClose",value:function(){this.props.closeOnEsc&&this.props.onClose&&!this.isClosed&&this.props.onClose()}},{key:"preventClose",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e="tf-overlay-content ".concat(this.props.contentClass?this.props.contentClass:""),t=null;this.props.overlayStyle&&(t={style:this.props.overlayStyle});var n=null;this.props.containerStyle&&(n={style:this.props.containerStyle});var r=null;this.props.contentStyle&&(r={style:this.props.contentStyle});var o=this;return u().createElement(j,{closeOnEsc:this.props.closeOnEsc,onClose:this.handlePortalClose,defaultOpen:!0},(function(i){i.openPortal;var a=i.closePortal,s=(i.isOpen,i.portal);return u().createElement(u().Fragment,null,s(u().createElement("div",T({className:"tf-overlay",onClick:o.handleOverlayClick},t),u().createElement("div",T({className:"tf-overlay-container",onClick:o.handleOverlayClick},n),u().createElement("div",{className:"close"},1==o.props.closeOnEsc&&u().createElement("span",{className:"close-hint"},"hit ",u().createElement("span",{className:"key"},"ESC")," to close"),o.props.showClose&&u().createElement("button",{type:"button",className:"close light",onClick:a},u().createElement("i",{className:"glyphicon glyphicon-remove"}))),u().createElement("div",T({className:e,onClick:o.preventClose},r),o.props.children)))))}))}}])&&x(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);A.propTypes={showClose:d().bool,closeOnEsc:d().bool,closeOnOutsideClick:d().bool,onClose:d().func,contentStyle:d().object,contentClass:d().string},A.defaultProps={showClose:!1,closeOnEsc:!1,closeOnOutsideClick:!1};const L=A;function B(e){return B="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},B(e)}function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U(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,K(r.key),r)}}function q(e,t,n){return t&&U(e.prototype,t),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function K(e){var t=function(e,t){if("object"!=B(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:t+""}function V(e,t,n){return t=W(t),function(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,z()?Reflect.construct(t,n||[],W(e).constructor):t.apply(e,n))}function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(z=function(){return!!e})()}function W(e){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},W(e)}function H(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},G(e,t)}var J=function(e){function t(e){var n;return F(this,t),(n=V(this,t,[e])).getValues=n.getValues.bind(n),n.handleClick=n.handleClick.bind(n),n.selected=n.props.selected?n.props.selected:[],n}return H(t,e),q(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.selected=e.selected?e.selected:[]}},{key:"getValues",value:function(){return this.selected.length>0?this.selected:null}},{key:"handleClick",value:function(e,t){if(1==t)this.selected.push(this.props.options[e].value);else{var n=this.selected.indexOf(this.props.options[e].value);n>-1&&this.selected.splice(n,1)}this.props.onChange&&this.props.onChange(this.selected)}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){var r=e.selected.indexOf(t.value);return u().createElement(Q,{key:n,text:t.text,value:t.value,toggled:-1!=r,onClick:e.handleClick.bind(null,n)})}));return u().createElement("div",{className:this.props.className},t)}}])}(u().Component);J.defaultProps={className:"toggle-button-group"};var Q=function(e){function t(e){var n;return F(this,t),(n=V(this,t,[e])).getValue=n.getValue.bind(n),n.handleClick=n.handleClick.bind(n),n.state={toggled:!0===n.props.toggled},n}return H(t,e),q(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.toggled!=this.state.toggled&&this.setState({toggled:e.toggled})}},{key:"getValue",value:function(){return this.state.toggled}},{key:"handleClick",value:function(){var e=this,t=!this.state.toggled;this.setState({toggled:t},(function(){e.props.onClick&&e.props.onClick(t)}))}},{key:"render",value:function(){var e=1==this.state.toggled?"btn-primary":"";return u().createElement("button",{type:"button",value:this.props.value,onClick:this.handleClick,className:e},this.props.text)}}])}(u().Component);const Y=J;function X(e){return X="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},X(e)}function Z(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,ee(r.key),r)}}function ee(e){var t=function(e,t){if("object"!=X(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==X(t)?t:t+""}function te(e,t,n){return t=re(t),function(e,t){if(t&&("object"===X(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ne()?Reflect.construct(t,n||[],re(e).constructor):t.apply(e,n))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}function re(e){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},re(e)}function oe(e,t){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oe(e,t)}const ie=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=te(this,t,[e])).handleProductsToggle=n.handleProductsToggle.bind(n),n.products=null,n.productOptions=[{text:"Nuke",value:"Nuke"},{text:"Hiero",value:"Hiero"},{text:"Katana",value:"Katana"},{text:"Modo",value:"Modo"},{text:"Mari",value:"Mari"},{text:"Cara VR",value:"CaraVR"},{text:"Colorway",value:"Colorway"},{text:"Flix",value:"Flix"}],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oe(e,t)}(t,e),n=t,(r=[{key:"handleProductsToggle",value:function(e){this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){return u().createElement(Y,{ref:"products",className:this.props.className,selected:this.props.selected,options:this.productOptions,onChange:this.handleProductsToggle})}}])&&Z(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function ae(e){return ae="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},ae(e)}function se(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,ce(r.key),r)}}function ce(e){var t=function(e,t){if("object"!=ae(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ae(t)?t:t+""}function le(e,t,n){return t=pe(t),function(e,t){if(t&&("object"===ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ue()?Reflect.construct(t,n||[],pe(e).constructor):t.apply(e,n))}function ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ue=function(){return!!e})()}function pe(e){return pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pe(e)}function fe(e,t){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fe(e,t)}const he=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),le(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"search-cta"},u().createElement("span",{className:"hint hint-submit"},"hit ",u().createElement("span",{className:"key"},"ENTER")," to "),u().createElement("a",{href:"#",onClick:this.props.onSearch,className:"search-submit"},"see all results"))}}])&&se(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function de(e){return de="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},de(e)}function ye(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,me(r.key),r)}}function me(e){var t=function(e,t){if("object"!=de(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=de(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==de(t)?t:t+""}function be(e,t,n){return t=ge(t),function(e,t){if(t&&("object"===de(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ve()?Reflect.construct(t,n||[],ge(e).constructor):t.apply(e,n))}function ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ve=function(){return!!e})()}function ge(e){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ge(e)}function we(e,t){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},we(e,t)}const Ee=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=be(this,t,[e])).state={results:[],showSearch:!1,allowQuery:!1},n.query="",n.products=null,n.handleKeyDown=n.handleKeyDown.bind(n),n.handleKeyUp=n.handleKeyUp.bind(n),n.handleProductsToggle=n.handleProductsToggle.bind(n),n.doQuery=n.doQuery.bind(n),n.onSearchClick=n.onSearchClick.bind(n),n.onSearchClose=n.onSearchClose.bind(n),n.searchSubmit=n.searchSubmit.bind(n),n.fullSearch=n.fullSearch.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=f()(this.doQuery,500)}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&(e.preventDefault(),this.fullSearch())}},{key:"handleKeyUp",value:function(e){var t=this.refs.input.value;if(t!=this.query){if(this.query=t,0==t.length&&this.state.results.length>0)return void this.setState({results:[]});this.query.length>=3?this.setState({allowQuery:!0},(function(){this.doQuery()})):this.setState({allowQuery:!1})}}},{key:"handleProductsToggle",value:function(e){this.products=e,this.state.allowQuery&&this.doQuery()}},{key:"doQuery",value:function(){if(!(this.query.length<3)){var e={query:this.query,products:this.products,count:10};$.ajax({type:"POST",url:"/api/search/hints",contentType:"application/json; charset=utf-8",data:JSON.stringify(e),dataType:"json",context:this}).then((function(e){null!=e&&0!=e.length&&this.setState({results:e})}))}}},{key:"onSearchClick",value:function(e){e.preventDefault(),this.setState({showSearch:!0},(function(){this.refs.input.focus()}))}},{key:"onSearchClose",value:function(e){this.setState({showSearch:!1})}},{key:"searchSubmit",value:function(e){e.preventDefault(),this.fullSearch()}},{key:"fullSearch",value:function(){var e=TFWeb.Resources.getLanguage(),t="/search?q=".concat(encodeURIComponent(this.refs.input.value)).concat(null!=this.products&&this.products.length>0?"&products="+this.products.toString():"");e&&"en"!=e&&(t="/".concat(e).concat(t)),window.location.href=t}},{key:"render",value:function(){var e=this.state.results.map((function(e,t){var n=null;e.thumbUrl&&(n=u().createElement("a",{href:e.url,className:"thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var r=[];return r.push(u().createElement("li",{key:"t"},e.type)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(u().createElement("li",{key:t,className:"product"},e))})),u().createElement("li",{key:t},n,u().createElement("a",{className:"title",href:e.url},e.title,e.path&&u().createElement("span",null,e.path)),null!=r&&r.length>0&&u().createElement("ul",null,r))}));return u().createElement("a",{href:"#",className:"nav-link nav-link--search--local nav-link--icon",onClick:this.onSearchClick},u().createElement("span",{className:"nav-link__title"},"Search"),1==this.state.showSearch&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!1,showClose:!0,onClose:this.onSearchClose,containerStyle:{padding:"0"},contentStyle:{width:"100%"}},u().createElement("div",{className:"search-control"},u().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,type:"text",placeholder:"Ask me anything...",className:"form-control"}),u().createElement(ie,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),this.state.allowQuery&&u().createElement(he,{onSearch:this.searchSubmit}),null!=e&&e.length>0&&u().createElement("ol",{className:"quicksearch-results"},e),this.state.allowQuery&&this.state.results&&this.state.results.length>0&&u().createElement("div",{className:"search-submit"},u().createElement("a",{href:"#",onClick:this.searchSubmit},"see all results")))))}}])&&ye(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Se(e,t){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Se(e,t)}function Oe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Se(e,t)}function _e(){return _e=Object.assign?Object.assign.bind():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},_e.apply(this,arguments)}function Pe(e){return"/"===e.charAt(0)}function ke(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}const je=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&Pe(e),a=t&&Pe(t),s=i||a;if(e&&Pe(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var c=o[o.length-1];n="."===c||".."===c||""===c}else n=!1;for(var l=0,u=o.length;u>=0;u--){var p=o[u];"."===p?ke(o,u):".."===p?(ke(o,u),l++):l&&(ke(o,u),l--)}if(!s)for(;l--;l)o.unshift("..");!s||""===o[0]||o[0]&&Pe(o[0])||o.unshift("");var f=o.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};var Ce=!0,Te="Invariant failed";function xe(e,t){if(!e){if(Ce)throw new Error(Te);var n="function"==typeof t?t():t,r=n?"".concat(Te,": ").concat(n):Te;throw new Error(r)}}function De(e){return"/"===e.charAt(0)?e:"/"+e}function Ne(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function Re(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function Me(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function Ie(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=_e({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=je(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function Ae(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var Le=!("undefined"==typeof window||!window.document||!window.document.createElement);function Be(e,t){t(window.confirm(e))}var Fe="popstate",Ue="hashchange";function qe(){try{return window.history.state||{}}catch(e){return{}}}var Ke=1073741823,Ve="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==o.g?o.g:{};const ze=u().createContext||function(e,t){var n,r,o,i="__create-react-context-"+((Ve[o="__global_unique_id__"]=(Ve[o]||0)+1)+"__"),a=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=function(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}(t.props.value),t}Oe(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?n=0:(n="function"==typeof t?t(r,o):Ke,0!=(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(l.Component);a.childContextTypes=((n={})[i]=d().object.isRequired,n);var s=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){e.observedBits&n&&e.setState({value:e.getValue()})},e}Oe(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?Ke:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?Ke:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(l.Component);return s.contextTypes=((r={})[i]=d().object,r),{Provider:a,Consumer:s}};var We=o(8802),He=o.n(We);function $e(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}o(4271);var Ge=o(8325),Je=o.n(Ge),Qe=function(e){var t=ze();return t.displayName=e,t},Ye=Qe("Router-History"),Xe=Qe("Router"),Ze=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Oe(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return u().createElement(Xe.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},u().createElement(Ye.Provider,{children:this.props.children||null,value:this.props.history}))},t}(u().Component);u().Component,u().Component;var et={},tt=0;function nt(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,s=void 0!==a&&a,c=n.sensitive,l=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=et[n]||(et[n]={});if(r[e])return r[e];var o=[],i={regexp:He()(e,o,t),keys:o};return tt<1e4&&(r[e]=i,tt++),i}(n,{end:i,strict:s,sensitive:l}),o=r.regexp,a=r.keys,c=o.exec(e);if(!c)return null;var u=c[0],p=c.slice(1),f=e===u;return i&&!f?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:f,params:a.reduce((function(e,t,n){return e[t.name]=p[n],e}),{})}}),null)}var rt=function(e){function t(){return e.apply(this,arguments)||this}return Oe(t,e),t.prototype.render=function(){var e=this;return u().createElement(Xe.Consumer,null,(function(t){t||xe(!1);var n=e.props.location||t.location,r=_e({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?nt(n.pathname,e.props):t.match}),o=e.props,i=o.children,a=o.component,s=o.render;return Array.isArray(i)&&function(e){return 0===u().Children.count(e)}(i)&&(i=null),u().createElement(Xe.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:a?u().createElement(a,r):s?s(r):null:"function"==typeof i?i(r):null)}))},t}(u().Component);u().Component;var ot=function(e){function t(){return e.apply(this,arguments)||this}return Oe(t,e),t.prototype.render=function(){var e=this;return u().createElement(Xe.Consumer,null,(function(t){t||xe(!1);var n,r,o=e.props.location||t.location;return u().Children.forEach(e.props.children,(function(e){if(null==r&&u().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?nt(o.pathname,_e({},e.props,{path:i})):t.match}})),r?u().cloneElement(n,{location:o,computedMatch:r}):null}))},t}(u().Component);function it(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=$e(t,["wrappedComponentRef"]);return u().createElement(Xe.Consumer,null,(function(t){return t||xe(!1),u().createElement(e,_e({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,Je()(n,e)}u().useContext;var at=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=function(e){void 0===e&&(e={}),Le||xe(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,a=i.forceRefresh,s=void 0!==a&&a,c=i.getUserConfirmation,l=void 0===c?Be:c,u=i.keyLength,p=void 0===u?6:u,f=e.basename?Re(De(e.basename)):"";function h(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return f&&(i=Ne(i,f)),Ie(i,r,n)}function d(){return Math.random().toString(36).substr(2,p)}var y=Ae();function m(e){_e(C,e),C.length=n.length,y.notifyListeners(C.location,C.action)}function b(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||w(h(e.state))}function v(){w(h(qe()))}var g=!1;function w(e){g?(g=!1,m()):y.confirmTransitionTo(e,"POP",l,(function(t){t?m({action:"POP",location:e}):function(e){var t=C.location,n=S.indexOf(t.key);-1===n&&(n=0);var r=S.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(g=!0,_(o))}(e)}))}var E=h(qe()),S=[E.key];function O(e){return f+Me(e)}function _(e){n.go(e)}var P=0;function k(e){1===(P+=e)&&1===e?(window.addEventListener(Fe,b),o&&window.addEventListener(Ue,v)):0===P&&(window.removeEventListener(Fe,b),o&&window.removeEventListener(Ue,v))}var j=!1,C={length:n.length,action:"POP",location:E,createHref:O,push:function(e,t){var o="PUSH",i=Ie(e,t,d(),C.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.pushState({key:a,state:c},null,t),s)window.location.href=t;else{var l=S.indexOf(C.location.key),u=S.slice(0,l+1);u.push(i.key),S=u,m({action:o,location:i})}else window.location.href=t}}))},replace:function(e,t){var o="REPLACE",i=Ie(e,t,d(),C.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.replaceState({key:a,state:c},null,t),s)window.location.replace(t);else{var l=S.indexOf(C.location.key);-1!==l&&(S[l]=i.key),m({action:o,location:i})}else window.location.replace(t)}}))},go:_,goBack:function(){_(-1)},goForward:function(){_(1)},block:function(e){void 0===e&&(e=!1);var t=y.setPrompt(e);return j||(k(1),j=!0),function(){return j&&(j=!1,k(-1)),t()}},listen:function(e){var t=y.appendListener(e);return k(1),function(){k(-1),t()}}};return C}(t.props),t}return Oe(t,e),t.prototype.render=function(){return u().createElement(Ze,{history:this.history,children:this.props.children})},t}(u().Component);u().Component;var st=function(e,t){return"function"==typeof e?e(t):e},ct=function(e,t){return"string"==typeof e?Ie(e,null,null,t):e},lt=function(e){return e},ut=u().forwardRef;void 0===ut&&(ut=lt);var pt=ut((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=$e(e,["innerRef","navigate","onClick"]),a=i.target,s=_e({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=lt!==ut&&t||n,u().createElement("a",s)})),ft=ut((function(e,t){var n=e.component,r=void 0===n?pt:n,o=e.replace,i=e.to,a=e.innerRef,s=$e(e,["component","replace","to","innerRef"]);return u().createElement(Xe.Consumer,null,(function(e){e||xe(!1);var n=e.history,c=ct(st(i,e.location),e.location),l=c?n.createHref(c):"",p=_e({},s,{href:l,navigate:function(){var t=st(i,e.location),r=Me(e.location)===Me(ct(t));(o||r?n.replace:n.push)(t)}});return lt!==ut?p.ref=t||a:p.innerRef=a,u().createElement(r,p)}))})),ht=function(e){return e},dt=u().forwardRef;void 0===dt&&(dt=ht);var yt,mt,bt,vt,gt=dt((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,a=e.activeStyle,s=e.className,c=e.exact,l=e.isActive,p=e.location,f=e.sensitive,h=e.strict,d=e.style,y=e.to,m=e.innerRef,b=$e(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return u().createElement(Xe.Consumer,null,(function(e){e||xe(!1);var n=p||e.location,o=ct(st(y,n),n),v=o.pathname,g=v&&v.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),w=g?nt(n.pathname,{path:g,exact:c,sensitive:f,strict:h}):null,E=!!(l?l(w,n):w),S="function"==typeof s?s(E):s,O="function"==typeof d?d(E):d;E&&(S=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(S,i),O=_e({},O,a));var _=_e({"aria-current":E&&r||null,className:S,style:O,to:o},b);return ht!==dt?_.ref=t||m:_.innerRef=m,u().createElement(ft,_)}))})),wt=o(9406),Et=o.n(wt),St=o(7383),Ot=o.n(St),_t=o(1664),Pt=o.n(_t),kt="bodyAttributes",jt="htmlAttributes",Ct={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},Tt=(Object.keys(Ct).map((function(e){return Ct[e]})),"charset"),xt="cssText",Dt="href",Nt="innerHTML",Rt="itemprop",Mt="rel",It={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},At=Object.keys(It).reduce((function(e,t){return e[It[t]]=t,e}),{}),Lt=[Ct.NOSCRIPT,Ct.SCRIPT,Ct.STYLE],Bt="data-react-helmet",Ft="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},Ut=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}}(),qt=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},Kt=function(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},Vt=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},zt=function(e){var t=Jt(e,Ct.TITLE),n=Jt(e,"titleTemplate");if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Jt(e,"defaultTitle");return t||r||void 0},Wt=function(e){return Jt(e,"onChangeClientState")||function(){}},Ht=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return qt({},e,t)}),{})},$t=function(e,t){return t.filter((function(e){return void 0!==e[Ct.BASE]})).map((function(e){return e[Ct.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o<r.length;o++){var i=r[o].toLowerCase();if(-1!==e.indexOf(i)&&n[i])return t.concat(n)}return t}),[])},Gt=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&en("Helmet: "+e+' should be of type "Array". Instead found type "'+Ft(t[e])+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var o={};n.filter((function(e){for(var n=void 0,i=Object.keys(e),a=0;a<i.length;a++){var s=i[a],c=s.toLowerCase();-1===t.indexOf(c)||n===Mt&&"canonical"===e[n].toLowerCase()||c===Mt&&"stylesheet"===e[c].toLowerCase()||(n=c),-1===t.indexOf(s)||s!==Nt&&s!==xt&&s!==Rt||(n=s)}if(!n||!e[n])return!1;var l=e[n].toLowerCase();return r[n]||(r[n]={}),o[n]||(o[n]={}),!r[n][l]&&(o[n][l]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var i=Object.keys(o),a=0;a<i.length;a++){var s=i[a],c=Pt()({},r[s],o[s]);r[s]=c}return e}),[]).reverse()},Jt=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Qt=(yt=Date.now(),function(e){var t=Date.now();t-yt>16?(yt=t,e(t)):setTimeout((function(){Qt(e)}),0)}),Yt=function(e){return clearTimeout(e)},Xt="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Qt:o.g.requestAnimationFrame||Qt,Zt="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Yt:o.g.cancelAnimationFrame||Yt,en=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},tn=null,nn=function(e,t){var n=e.baseTag,r=e.bodyAttributes,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.onChangeClientState,l=e.scriptTags,u=e.styleTags,p=e.title,f=e.titleAttributes;an(Ct.BODY,r),an(Ct.HTML,o),on(p,f);var h={baseTag:sn(Ct.BASE,n),linkTags:sn(Ct.LINK,i),metaTags:sn(Ct.META,a),noscriptTags:sn(Ct.NOSCRIPT,s),scriptTags:sn(Ct.SCRIPT,l),styleTags:sn(Ct.STYLE,u)},d={},y={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(d[e]=n),r.length&&(y[e]=h[e].oldTags)})),t&&t(),c(e,d,y)},rn=function(e){return Array.isArray(e)?e.join(""):e},on=function(e,t){void 0!==e&&document.title!==e&&(document.title=rn(e)),an(Ct.TITLE,t)},an=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(Bt),o=r?r.split(","):[],i=[].concat(o),a=Object.keys(t),s=0;s<a.length;s++){var c=a[s],l=t[c]||"";n.getAttribute(c)!==l&&n.setAttribute(c,l),-1===o.indexOf(c)&&o.push(c);var u=i.indexOf(c);-1!==u&&i.splice(u,1)}for(var p=i.length-1;p>=0;p--)n.removeAttribute(i[p]);o.length===i.length?n.removeAttribute(Bt):n.getAttribute(Bt)!==a.join(",")&&n.setAttribute(Bt,a.join(","))}},sn=function(e,t){var n=document.head||document.querySelector(Ct.HEAD),r=n.querySelectorAll(e+"["+Bt+"]"),o=Array.prototype.slice.call(r),i=[],a=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===Nt)n.innerHTML=t.innerHTML;else if(r===xt)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s=void 0===t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(Bt,"true"),o.some((function(e,t){return a=t,n.isEqualNode(e)}))?o.splice(a,1):i.push(n)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:o,newTags:i}},cn=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},ln=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[It[n]||n]=e[n],t}),t)},un=function(e,t,n){switch(e){case Ct.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[Bt]=!0,o=ln(n,r),[u().createElement(Ct.TITLE,o,e)];var e,n,r,o},toString:function(){return function(e,t,n,r){var o=cn(n),i=rn(t);return o?"<"+e+" "+Bt+'="true" '+o+">"+Vt(i,r)+"</"+e+">":"<"+e+" "+Bt+'="true">'+Vt(i,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case kt:case jt:return{toComponent:function(){return ln(t)},toString:function(){return cn(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[Bt]=!0,r);return Object.keys(t).forEach((function(e){var n=It[e]||e;if(n===Nt||n===xt){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),u().createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!(e===Nt||e===xt)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+Vt(r[t],n)+'"';return e?e+" "+o:o}),""),i=r.innerHTML||r.cssText||"",a=-1===Lt.indexOf(e);return t+"<"+e+" "+Bt+'="true" '+o+(a?"/>":">"+i+"</"+e+">")}),"")}(e,t,n)}}}},pn=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.scriptTags,l=e.styleTags,u=e.title,p=void 0===u?"":u,f=e.titleAttributes;return{base:un(Ct.BASE,t,r),bodyAttributes:un(kt,n,r),htmlAttributes:un(jt,o,r),link:un(Ct.LINK,i,r),meta:un(Ct.META,a,r),noscript:un(Ct.NOSCRIPT,s,r),script:un(Ct.SCRIPT,c,r),style:un(Ct.STYLE,l,r),title:un(Ct.TITLE,{title:p,titleAttributes:f},r)}},fn=Et()((function(e){return{baseTag:$t([Dt,"target"],e),bodyAttributes:Ht(kt,e),defer:Jt(e,"defer"),encode:Jt(e,"encodeSpecialCharacters"),htmlAttributes:Ht(jt,e),linkTags:Gt(Ct.LINK,[Mt,Dt],e),metaTags:Gt(Ct.META,["name",Tt,"http-equiv","property",Rt],e),noscriptTags:Gt(Ct.NOSCRIPT,[Nt],e),onChangeClientState:Wt(e),scriptTags:Gt(Ct.SCRIPT,["src",Nt],e),styleTags:Gt(Ct.STYLE,[xt],e),title:zt(e),titleAttributes:Ht("titleAttributes",e)}}),(function(e){tn&&Zt(tn),e.defer?tn=Xt((function(){nn(e,(function(){tn=null}))})):(nn(e),tn=null)}),pn)((function(){return null})),hn=(mt=fn,vt=bt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(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}(this,e.apply(this,arguments))}return function(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,e),t.prototype.shouldComponentUpdate=function(e){return!Ot()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case Ct.SCRIPT:case Ct.NOSCRIPT:return{innerHTML:t};case Ct.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,o=e.newChildProps,i=e.nestedChildren;return qt({},r,((t={})[n.type]=[].concat(r[n.type]||[],[qt({},o,this.mapNestedChildrenToProps(n,i))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,i=e.newChildProps,a=e.nestedChildren;switch(r.type){case Ct.TITLE:return qt({},o,((t={})[r.type]=a,t.titleAttributes=qt({},i),t));case Ct.BODY:return qt({},o,{bodyAttributes:qt({},i)});case Ct.HTML:return qt({},o,{htmlAttributes:qt({},i)})}return qt({},o,((n={})[r.type]=qt({},i),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=qt({},t);return Object.keys(e).forEach((function(t){var r;n=qt({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return u().Children.forEach(e,(function(e){if(e&&e.props){var o=e.props,i=o.children,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[At[n]||n]=e[n],t}),t)}(Kt(o,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case Ct.LINK:case Ct.META:case Ct.NOSCRIPT:case Ct.SCRIPT:case Ct.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:a,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=Kt(e,["children"]),r=qt({},n);return t&&(r=this.mapChildrenToProps(t,r)),u().createElement(mt,r)},Ut(t,null,[{key:"canUseDOM",set:function(e){mt.canUseDOM=e}}]),t}(u().Component),bt.propTypes={base:d().object,bodyAttributes:d().object,children:d().oneOfType([d().arrayOf(d().node),d().node]),defaultTitle:d().string,defer:d().bool,encodeSpecialCharacters:d().bool,htmlAttributes:d().object,link:d().arrayOf(d().object),meta:d().arrayOf(d().object),noscript:d().arrayOf(d().object),onChangeClientState:d().func,script:d().arrayOf(d().object),style:d().arrayOf(d().object),title:d().string,titleAttributes:d().object,titleTemplate:d().string},bt.defaultProps={defer:!0,encodeSpecialCharacters:!0},bt.peek=mt.peek,bt.rewind=function(){var e=mt.rewind();return e||(e=pn({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},vt);hn.renderStatic=hn.rewind;const dn=hn;var yn=o(1971);function mn(e){return mn="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},mn(e)}var bn={viewport:function(){var e=window,t="inner";return!1 in window&&(t="client",e=document.documentElement||document.body),{width:e[t+"Width"],height:e[t+"Height"]}},isUrl:function(e){return new RegExp(/(http|https):\/\//).test(e)},createMarkup:function(e){return{__html:e}},generateUID:function(){return((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)+"."+((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)},updateScrollPosition:function(e){var t=window.location.hash;if(t){var n=t.replace("#",""),r=document.querySelector("a[name='"+n+"']");r&&r.scrollIntoView()}else!0===e&&window.scrollTo(0,0)},isOnScreen:function(e){var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)},setEndOfContenteditable:function(e){var t,n;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(n=window.getSelection()).removeAllRanges(),n.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())},jsonToOptions:function(e){for(var t=[],n=e.length,r=0;r<n;r++){var o=$("<option/>");if(o.attr({value:e[r].Value}).text(e[r].Text),""==e[r].Value&&o.addClass("ignore"),null!=e[r].DataAttributes&&e[r].DataAttributes.length>0)for(var i=0;i<e[r].DataAttributes.length;i++)o.attr(e[r].DataAttributes[i].Name,e[r].DataAttributes[i].Value);t.push(o)}return t},getFileExtension:function(e){var t=e.split(".");return 1===t.length||""===t[0]&&2===t.length?null:"."+t.pop().toLowerCase()},getFileNameWithoutExtension:function(e){return e.substr(0,e.lastIndexOf("."))||e},indexOfFile:function(e,t){for(var n=0;n<t.length;n++)if(t[n].name==e)return n;return-1},indexOfOption:function(e,t){for(var n=0;n<e.length;n++)if(e[n].value==t)return n;return-1},createSlug:function(e){var t=e.toLowerCase().replace(/[^a-z0-9\s-]+/gi,"-");return t=(t=t.replace(/[^a-z0-9-]+/gi,"-")).replace(/(-{2,})/gi,"-"),bn.lrTrim(t,"-")},lrTrim:function(e,t,n){if(n=n||"g","string"!=typeof e||"string"!=typeof t||"string"!=typeof n)throw new TypeError("argument must be string");if(!/^[gi]*$/.test(n))throw new TypeError("Invalid flags supplied '"+n.match(new RegExp("[^gi]*"))+"'");return t=bn.escapeRegex(t),e.replace(new RegExp("^["+t+"]+|["+t+"]+$",n),"")},format:function(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/\{(\d+)\}/g,(function(e,n){return t[n]}))},escapeRegex:function(e){return e.replace(/[\[\](){}?*+\^$\\.|\-]/g,"\\$&")},arrayUnique:function(e){for(var t=e.concat(),n=0;n<t.length;++n)for(var r=n+1;r<t.length;++r)t[n]===t[r]&&t.splice(r--,1);return t},clone:function(e){return JSON.parse(JSON.stringify(e))},cloneArray:function(e){return JSON.parse(JSON.stringify(e))},base64toBlob:function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i<r.length;i+=n){for(var a=r.slice(i,i+n),s=new Array(a.length),c=0;c<a.length;c++)s[c]=a.charCodeAt(c);var l=new Uint8Array(s);o.push(l)}return new Blob(o,{type:t})},niceDuration:function(e){var t=Math.floor(e/60/60);e-=60*t*60;var n=Math.floor(e/60),r=Math.trunc(e%60),o="".concat(n,"m ").concat(r,"s");return t>0&&(o="".concat(t,"h ")+o),o},niceFileSize:function(e){var t=e+" Bytes";return e>=1073741824?t=(e/1073741824).toFixed(1)+" GB":e>=1048576?t=(e/1048576).toFixed(1)+" MB":e>=1024&&(t=(e/1024).toFixed(1)+" KB"),t},replaceNullWithUndefined:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){for(var t in e)e.hasOwnProperty(t)&&(null===e[t]?e[t]=void 0:"object"===mn(e[t])&&null!==e[t]&&replaceNullWithUndefined(e[t]))}))};const vn=bn;function gn(e){return gn="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},gn(e)}function wn(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,En(r.key),r)}}function En(e){var t=function(e,t){if("object"!=gn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gn(t)?t:t+""}function Sn(e,t,n){return t=_n(t),function(e,t){if(t&&("object"===gn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,On()?Reflect.construct(t,n||[],_n(e).constructor):t.apply(e,n))}function On(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(On=function(){return!!e})()}function _n(e){return _n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_n(e)}function Pn(e,t){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pn(e,t)}const kn=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Sn(this,t,[e])).nextActiveSquare=n.nextActiveSquare.bind(n),n.updateActiveSquare=n.updateActiveSquare.bind(n),n.active_square=1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pn(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.updateActiveSquare()}},{key:"nextActiveSquare",value:function(){++this.active_square,this.active_square>3&&(this.active_square=0),this.updateActiveSquare()}},{key:"updateActiveSquare",value:function(){var e=(this.active_square+1)%4,t=(this.active_square+2)%4,n=(this.active_square+3)%4,r=this;$('#loader .loader-square[data-squareid="'+this.active_square+'"]').fadeTo(500,1,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)})),setTimeout((function(){$('#loader .loader-square[data-squareid="'+e+'"]').fadeTo(500,.5,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)}))}),100),setTimeout((function(){$('#loader .loader-square[data-squareid="'+t+'"]').fadeTo(500,.2,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200,r.nextActiveSquare)}),500)}))}),200),$('#loader .loader-square[data-squareid="'+n+'"]').fadeTo(0,0)}},{key:"render",value:function(){return u().createElement("div",{id:"loader"},u().createElement("div",{className:"loader-container"},u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"0"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"1"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"3"}," ")),u().createElement("div",{className:"loader-square-container"},u().createElement("span",{className:"loader-square","data-squareid":"2"}," "))))}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function jn(e){return jn="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},jn(e)}function Cn(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,Tn(r.key),r)}}function Tn(e){var t=function(e,t){if("object"!=jn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jn(t)?t:t+""}function xn(e,t,n){return t=Nn(t),function(e,t){if(t&&("object"===jn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dn()?Reflect.construct(t,n||[],Nn(e).constructor):t.apply(e,n))}function Dn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dn=function(){return!!e})()}function Nn(e){return Nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nn(e)}function Rn(e,t){return Rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rn(e,t)}var Mn={first:'<i class="fa fa-angle-double-left" aria-hidden="true"></i>',prev:'<i class="fa fa-angle-left" aria-hidden="true"></i>',prevSet:"...",nextSet:"...",next:'<i class="fa fa-angle-right" aria-hidden="true"></i>',last:'<i class="fa fa-angle-double-right" aria-hidden="true"></i>'},In=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=xn(this,t,[e])).handleKeyPress=n.handleKeyPress.bind(n),n.handleFirstPage=n.handleFirstPage.bind(n),n.handlePreviousPage=n.handlePreviousPage.bind(n),n.handleNextPage=n.handleNextPage.bind(n),n.handleLastPage=n.handleLastPage.bind(n),n.handleMorePrevPages=n.handleMorePrevPages.bind(n),n.handleMoreNextPages=n.handleMoreNextPages.bind(n),n.handlePageChanged=n.handlePageChanged.bind(n),n.buildUrl=n.buildUrl.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rn(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.removeEventListener("keydown",this.handleKeyPress)}},{key:"getTitles",value:function(e){return this.props.titles[e]||Mn[e]}},{key:"calcBlocks",value:function(){var e=this.props,t=e.total,n=e.visiblePages,r=e.current+1;return{total:Math.ceil(t/n),current:Math.ceil(r/n)-1,size:n}}},{key:"isPrevDisabled",value:function(){return this.props.current<=0}},{key:"isNextDisabled",value:function(){return this.props.current>=this.props.total-1}},{key:"isPrevMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||0===e.current}},{key:"isNextMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||e.current===e.total-1}},{key:"visibleRange",value:function(){var e=this.calcBlocks(),t=e.current*e.size,n=this.props.total-t;return[t+1,t+(n>e.size?e.size:n)+1]}},{key:"handleKeyPress",value:function(e){37==e.keyCode?this.handlePreviousPage(e):39==e.keyCode&&this.handleNextPage(e)}},{key:"handleFirstPage",value:function(e){e.preventDefault(),this.isPrevDisabled()||this.handlePageChanged(0)}},{key:"handlePreviousPage",value:function(e){e.preventDefault(),this.isPrevDisabled()||this.handlePageChanged(this.props.current-1)}},{key:"handleNextPage",value:function(e){e.preventDefault(),this.isNextDisabled()||this.handlePageChanged(this.props.current+1)}},{key:"handleLastPage",value:function(e){e.preventDefault(),this.isNextDisabled()||this.handlePageChanged(this.props.total-1)}},{key:"handleMorePrevPages",value:function(e){e.preventDefault();var t=this.calcBlocks();this.handlePageChanged(t.current*t.size-1)}},{key:"handleMoreNextPages",value:function(e){e.preventDefault();var t=this.calcBlocks();this.handlePageChanged((t.current+1)*t.size)}},{key:"handlePageChanged",value:function(e,t){t&&t.preventDefault();var n=this.props.onPageChanged;n&&n(e)}},{key:"renderPages",value:function(e){var t=this;return function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(e[0],e[1]).map((function(e,n){var r=e-1,o=t.handlePageChanged.bind(t,r),i=t.props.current===r;return u().createElement(An,{key:n,index:n,isActive:i,className:"btn-numbered-page",onClick:o,url:t.buildUrl(r)},e)}))}},{key:"buildUrl",value:function(e){if(!this.props.baseUrl)return null;var t=this.props.baseUrl,n=t.indexOf("?");return e&&e>0&&(t="".concat(t).concat(-1==n?"?":"&","page=").concat(e)),t}},{key:"render",value:function(){var e=this.getTitles.bind(this),t=this.props.current-1,n=this.props.current+1,r=this.props.total-1;return u().createElement("nav",{className:"page-control"},this.props.children,u().createElement("ul",{className:"pagination pagination-sm"},u().createElement(An,{className:"btn-first-page",key:"btn-first-page",isHidden:this.isPrevDisabled(),onClick:this.handleFirstPage,url:this.buildUrl(0)},e("first")),u().createElement(An,{className:"btn-prev-page",key:"btn-prev-page",isHidden:this.isPrevDisabled(),onClick:this.handlePreviousPage,url:this.buildUrl(t)},e("prev")),u().createElement(An,{className:"btn-prev-more",key:"btn-prev-more",isHidden:this.isPrevMoreHidden(),onClick:this.handleMorePrevPages},e("prevSet")),this.renderPages(this.visibleRange()),u().createElement(An,{className:"btn-next-more",key:"btn-next-more",isHidden:this.isNextMoreHidden(),onClick:this.handleMoreNextPages},e("nextSet")),u().createElement(An,{className:"btn-next-page",key:"btn-next-page",isHidden:this.isNextDisabled(),onClick:this.handleNextPage,url:this.buildUrl(n)},e("next")),u().createElement(An,{className:"btn-last-page",key:"btn-last-page",isHidden:this.isNextDisabled(),onClick:this.handleLastPage,url:this.buildUrl(r)},e("last"))))}}])&&Cn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);In.propTypes={current:d().number.isRequired,total:d().number.isRequired,visiblePages:d().number,titles:d().object,onPageChanged:d().func,enableKeyEvents:d().bool,baseUrl:d().string},In.defaultProps={titles:Mn,visiblePages:8,enableKeyEvents:!1};var An=function(e){if(e.isHidden)return null;var t=e.className?"".concat(e.className," "):"",n="".concat(t).concat(e.isActive?" active":"").concat(e.isDisabled?" disabled":"");return u().createElement("li",{key:e.index,className:n},u().createElement("a",{onClick:e.onClick,href:e.url,dangerouslySetInnerHTML:{__html:e.children}}))};An.propTypes={isHidden:d().bool,isActive:d().bool,isDisabled:d().bool,className:d().string,onClick:d().func};const Ln=In;function Bn(e){return Bn="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},Bn(e)}function Fn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Un(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,Kn(r.key),r)}}function qn(e,t,n){return t&&Un(e.prototype,t),n&&Un(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kn(e){var t=function(e,t){if("object"!=Bn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bn(t)?t:t+""}function Vn(e,t,n){return t=Wn(t),function(e,t){if(t&&("object"===Bn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zn()?Reflect.construct(t,n||[],Wn(e).constructor):t.apply(e,n))}function zn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zn=function(){return!!e})()}function Wn(e){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wn(e)}function Hn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$n(e,t)}function $n(e,t){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$n(e,t)}var Gn=function(e){function t(e){var n;return Fn(this,t),(n=Vn(this,t,[e])).handleChange=n.handleChange.bind(n),n.handleMultiChange=n.handleMultiChange.bind(n),n}return Hn(t,e),qn(t,[{key:"handleChange",value:function(e){var t=JSON.parse(JSON.stringify(this.props.filter));t[e.target.name].value=e.target.value,this.props.onChange&&this.props.onChange(t)}},{key:"handleMultiChange",value:function(e,t){var n=JSON.parse(JSON.stringify(this.props.filter));n[e].value=t,this.props.onChange&&this.props.onChange(n)}},{key:"render",value:function(){var e=[],t=[];for(var n in this.props.filter)if(this.props.filter.hasOwnProperty(n)){var r=this.props.filter[n];if(null!=r){var o=u().createElement("select",{key:n,name:n,value:r.value,onChange:this.handleChange},r.options.map((function(e,t){return u().createElement("option",{key:t,value:e.value},e.text)})));switch(r.type){case"Filter":e.push(o);break;case"Sort":t.push(o);break;case"MultiFilter":e.push(u().createElement(Jn,{key:n,name:n,filter:r,onChange:this.handleMultiChange}))}}}return u().createElement("div",null,t.length>0&&u().createElement("div",{className:"sort-filter"},u().createElement("h5",null,"Sort"),t),e.length>0&&u().createElement("div",null,e))}}])}(u().Component);Gn.propTypes={filter:d().object,onChange:d().func};var Jn=function(e){function t(e){var n;Fn(this,t),(n=Vn(this,t,[e])).setSelected=n.setSelected.bind(n),n.handleClick=n.handleClick.bind(n),n.clearSelected=n.clearSelected.bind(n),n.updateSelected=n.updateSelected.bind(n),n.getSelected=n.getSelected.bind(n),n.findOption=n.findOption.bind(n);var r=JSON.parse(JSON.stringify(n.props.filter.options));return n.setSelected(r,n.props.filter.value),n.state={options:r,hasSelectedOptions:null!=n.props.filter.value&&""!=n.props.filter.value&&n.props.filter.value.length&&n.props.filter.value.length>0},n}return Hn(t,e),qn(t,[{key:"setSelected",value:function(e,t){if(null!=t&&""!=t&&t.length&&t.length>0)for(var n=0;n<t.length;n++){var r=this.findOption(e,t[n]);null!=r&&(r.isSelected=!0)}}},{key:"handleClick",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.options)),r=this.findOption(n,e);this.updateSelected(r,t);var o=this.getSelected(n),i=this;this.setState({options:n,hasSelectedOptions:null!=o&&o.length>0},(function(){i.props.onChange&&i.props.onChange(i.props.name,o)}))}},{key:"clearSelected",value:function(){for(var e=JSON.parse(JSON.stringify(this.state.options)),t=0;t<=e.length-1;t++)this.updateSelected(e[t],!1);var n=this;this.setState({options:e,hasSelectedOptions:!1},(function(){n.props.onChange&&n.props.onChange(n.props.name,null)}))}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"getSelected",value:function(e){for(var t=[],n=0;n<=e.length-1;n++)if(!0===e[n].isSelected&&t.push(e[n].value),null!=e[n].children&&e[n].children.length>0){var r=this.getSelected(e[n].children);null!=r&&r.length>0&&(t=t.concat(r))}return t}},{key:"findOption",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].value==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findOption(e[n].children,t);if(null!=r)return r}}return null}},{key:"render",value:function(){var e=this,t=this.state.options.map((function(t,n){return null!=t.children&&t.children.length>0?u().createElement(Qn,{key:n,option:t,onClick:e.handleClick}):u().createElement(Yn,{key:n,option:t,onClick:e.handleClick})}));return u().createElement("div",{className:"multi-filter"},u().createElement("h5",null,this.props.name,this.state.hasSelectedOptions&&u().createElement("a",{onClick:this.clearSelected},"Clear")),u().createElement("ul",null,t))}}])}(u().Component);Jn.propTypes={name:d().string,filter:d().object};var Qn=function(e){function t(){return Fn(this,t),Vn(this,t,arguments)}return Hn(t,e),qn(t,[{key:"render",value:function(){var e=this,n=this.props.option.children.map((function(n,r){return null!=n.children&&n.children.length>0?u().createElement(t,{key:r,option:n,onClick:e.props.onClick}):u().createElement("li",{key:r},u().createElement(Yn,{option:n,onClick:e.props.onClick}))}));return u().createElement("li",null,u().createElement(Yn,{option:this.props.option,onClick:this.props.onClick}),u().createElement("ul",null,n))}}])}(u().Component),Yn=function(e){function t(e){var n;return Fn(this,t),(n=Vn(this,t,[e])).handleClick=n.handleClick.bind(n),n}return Hn(t,e),qn(t,[{key:"handleClick",value:function(e){this.props.onClick&&this.props.onClick(this.props.option.value,this.refs.checkbox.checked)}},{key:"render",value:function(){var e=this.props.option.hasOwnProperty("isSelected")&&!0===this.props.option.isSelected;return u().createElement("label",null,u().createElement("input",{ref:"checkbox",type:"checkbox",checked:e,onChange:this.handleClick}),this.props.option.display)}}])}(u().Component);const Xn=Gn;function Zn(e){return Zn="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},Zn(e)}function er(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tr(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,rr(r.key),r)}}function nr(e,t,n){return t&&tr(e.prototype,t),n&&tr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function rr(e){var t=function(e,t){if("object"!=Zn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Zn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zn(t)?t:t+""}function or(e,t,n){return t=ar(t),function(e,t){if(t&&("object"===Zn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ir()?Reflect.construct(t,n||[],ar(e).constructor):t.apply(e,n))}function ir(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ir=function(){return!!e})()}function ar(e){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ar(e)}function sr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cr(e,t)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cr(e,t)}var lr=function(e){function t(e){var n;return er(this,t),(n=or(this,t,[e])).handleNewProps=n.handleNewProps.bind(n),n.updateUrl=n.updateUrl.bind(n),n.getData=n.getData.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleSearch=n.handleSearch.bind(n),n.handleProductsToggle=n.handleProductsToggle.bind(n),n.handleTypeFilter=n.handleTypeFilter.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.handleExit=n.handleExit.bind(n),n.defaultEndpoint="all",n.query=null,n.products=null,n.page=0,n.type=n.defaultEndpoint,n.find=null,n.state={loadStatus:c.LoadStatus.PreLoad,total:0,results:null,aggregations:null,filter:null,suggest:null},n}return sr(t,e),nr(t,[{key:"componentDidMount",value:function(){this.handleNewProps(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.handleNewProps(e)}},{key:"handleNewProps",value:function(e){e.location&&e.location.search&&(this.parsedQS=yn.parse(e.location.search),this.parsedQS.q&&(this.query=this.parsedQS.q,this.type=null!=this.parsedQS.type?this.parsedQS.type:this.defaultEndpoint,this.find=null!=this.parsedQS.f?this.parsedQS.f:null,this.refs.input.value=this.query,this.products=null!=this.parsedQS.products?this.parsedQS.products.split(","):null,this.page=null!=this.parsedQS.page?this.parsedQS.page:0)),null!=this.query&&""!=this.query&&this.setState({loadStatus:c.LoadStatus.Loading},(function(){this.getData(e)}))}},{key:"updateUrl",value:function(){var e=[];if(this.query&&e.push("q="+encodeURIComponent(this.query)),this.products&&this.products.length>0&&e.push("products="+this.products.join()),this.type&&this.type!=this.defaultEndpoint&&e.push("type="+this.type),this.find&&e.push("field="+this.find),null!=this.state.filter)for(var t in this.state.filter)this.state.filter.hasOwnProperty(t)&&null!=this.state.filter[t]&&this.state.filter[t].value&&""!=this.state.filter[t].value&&e.push("".concat(t,"=").concat(this.state.filter[t].value));this.page>0&&e.push("page="+this.page);var n=this.props.location.pathname;e.length>0&&(n+="?"+e.join("&")),this.props.history.push(n)}},{key:"getData",value:function(e){var t=this;$.ajax({type:"GET",url:"/api/search/".concat(this.type).concat(e.location.search).concat(null==this.state.aggregations?"&refreshAggs=true":""),contentType:"application/json; charset=utf-8",context:this}).done((function(e,n,r){var o=null!=e.aggregations&&e.aggregations.length>0?e.aggregations:t.state.aggregations,i=null!=e.filter?e.filter:t.state.filter;t.setState({loadStatus:c.LoadStatus.Loaded,total:e.total,results:e.results,aggregations:o,filter:i,suggest:e.suggest},(function(){vn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({loadStatus:c.LoadStatus.Error,results:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&this.handleSearch(e)}},{key:"handleSearch",value:function(e){e.preventDefault();var t=this.refs.input.value;this.query=t,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleProductsToggle",value:function(e){this.products=e,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleTypeFilter",value:function(e){this.type=e,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleFilterChange",value:function(e){this.page=0,this.setState({filter:e},(function(){this.updateUrl()}))}},{key:"handleNewPage",value:function(e){this.page=e,this.updateUrl()}},{key:"handleExit",value:function(e,t){var n={q:this.query,products:this.products,url:e};return $.ajax({async:!1,type:"POST",url:"/api/search/exit",contentType:"application/json; charset=utf-8",data:JSON.stringify(n),dataType:"json"}).then((function(){return!0})),!1}},{key:"render",value:function(){return u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"search-control"},u().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,type:"text",placeholder:"Ask me anything...",className:"form-control"}),u().createElement(ie,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),u().createElement(he,{onSearch:this.handleSearch})))),this.state.loadStatus==c.LoadStatus.Loading&&u().createElement(kn,null),(""==this.query||null==this.query)&&u().createElement(pr,{suggest:"Please enter a search term in the search box above"}),!(""==this.query||null==this.query)&&this.state.loadStatus==c.LoadStatus.Loaded&&u().createElement("div",{className:"search-x"},u().createElement("div",{className:"search-filters"},u().createElement(ur,{doctypes:this.state.aggregations,defaultEndpoint:this.defaultEndpoint,selected:this.type,onTypeChange:this.handleTypeFilter}),u().createElement(Xn,{filter:this.state.filter,onChange:this.handleFilterChange})),this.state.total>0&&u().createElement(fr,{results:this.state.results,onPageChange:this.handleNewPage,onTypeChange:this.handleTypeFilter,onExit:this.handleExit}),0==this.state.total&&u().createElement(pr,{suggest:this.state.suggest})))}}])}(u().Component),ur=function(e){function t(){return er(this,t),or(this,t,arguments)}return sr(t,e),nr(t,[{key:"render",value:function(){if(null==this.props.doctypes||0==this.props.doctypes.length)return null;var e=this,t=this.props.doctypes.map((function(t,n){var r;return r=1==t.disabled||t.text.toLowerCase()==e.props.selected.toLowerCase()?u().createElement("span",{className:t.text.toLowerCase()==e.props.selected.toLowerCase()?"selected":""},t.display," (",t.value,")"):u().createElement("a",{onClick:e.props.onTypeChange.bind(null,t.text)},t.display," (",t.value,")"),u().createElement("li",{key:n},r)}));return this.props.selected==this.props.defaultEndpoint?t.unshift(u().createElement("li",{key:this.props.doctypes.length},u().createElement("span",{className:"selected"},"All"))):t.unshift(u().createElement("li",{key:this.props.doctypes.length},u().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.defaultEndpoint)},"All"))),u().createElement("ul",{className:"doctype-filter"},t)}}])}(u().Component),pr=function(e){function t(){return er(this,t),or(this,t,arguments)}return sr(t,e),nr(t,[{key:"render",value:function(){return u().createElement("div",{className:"no-search-results"},u().createElement("div",{className:"noempty-results-container",dangerouslySetInnerHTML:vn.createMarkup(this.props.suggest)}))}}])}(u().Component),fr=function(e){function t(){return er(this,t),or(this,t,arguments)}return sr(t,e),nr(t,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=[];for(var t in this.props.results)this.props.results.hasOwnProperty(t)&&e.push(u().createElement(hr,{key:t,documentType:t,results:this.props.results[t],onPageChange:this.props.onPageChange,onTypeChange:this.props.onTypeChange,onExit:this.props.onExit}));return u().createElement("div",{className:"search-results"},e)}}])}(u().Component),hr=it(function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=this,t=this.props.results.documents.data.map((function(t,n){switch(e.props.documentType){case"course":return u().createElement(dr,{key:n,result:t,onClick:e.props.onExit});case"asset":case"training":case"portfolio":case"catalogue":return u().createElement(yr,{key:n,result:t,onClick:e.props.onExit});case"profile":return u().createElement(mr,{key:n,result:t,onClick:e.props.onExit});case"discussionTopic":return u().createElement(br,{key:n,result:t,onClick:e.props.onExit});default:return u().createElement(vr,{key:n,result:t,onClick:e.props.onExit})}})),n="search-results-list";switch(e.props.documentType){case"course":case"asset":case"training":case"portfolio":case"catalogue":n="search-results-card";break;case"profile":n="search-results-profile"}var r=yn.parse(this.props.location.search);return u().createElement("div",{className:"search-results-container"},u().createElement("div",{className:"clearfix"},u().createElement("h5",null,this.props.results.displayName),!r.type&&u().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.documentType)},"See All")),this.props.results.documents.totalPages>1&&u().createElement(Ln,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}),u().createElement("ul",{className:n},t),this.props.results.documents.totalPages>1&&u().createElement(Ln,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}))}}])}(u().Component)),dr=function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(u().createElement("li",{key:"p:".concat(n),className:"product"},e))})),u().createElement("li",{className:"course"},u().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},u().createElement("img",{src:e.thumbUrl})),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),null!=t&&t.length>0&&u().createElement("ul",null,t)))}}])}(u().Component),yr=function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(u().createElement("li",{key:"p:".concat(n),className:"product"},e))})),u().createElement("li",null,u().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},u().createElement("img",{src:e.thumbUrl})),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),null!=t&&t.length>0&&u().createElement("ul",null,t)))}}])}(u().Component),mr=function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){var e=this.props.result;return u().createElement("li",null,u().createElement("a",{href:e.url,className:"profile-image",style:{backgroundImage:"url("+e.thumbUrl+")"},onClick:this.props.onClick.bind(null,e.url)}),u().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title)))}}])}(u().Component),br=function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=u().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=[];return n.push(u().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){n.push(u().createElement("li",{key:"p:".concat(t),className:"product"},e))})),u().createElement("li",null,t,u().createElement("div",{className:"title"},u().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),e.path&&u().createElement("span",{className:"path"},e.path)),null!=n&&n.length>0&&u().createElement("ul",null,n)))}}])}(u().Component),vr=function(e){function t(e){return er(this,t),or(this,t,[e])}return sr(t,e),nr(t,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=u().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=null;e.highlight&&e.highlight.length>0&&(n=e.highlight.map((function(e,t){return u().createElement("p",{key:"h:".concat(t),dangerouslySetInnerHTML:vn.createMarkup(e)})})));var r=[];r.push(u().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(u().createElement("li",{key:"p:".concat(t),className:"product"},e))}));var o=null!=e.rating&&e.rating>0?u().createElement("span",null,"+",e.rating):null;return u().createElement("li",null,t,u().createElement("div",{className:"title"},u().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},u().createElement("h4",null,e.title),e.path&&u().createElement("span",{className:"path"},e.path)),null!=r&&r.length>0&&u().createElement("ul",null,r)),null!=n&&u().createElement("div",{className:"highlights"},n),u().createElement("div",{className:"support"},e.date," ",o))}}])}(u().Component);const gr=it(lr);function wr(e){return wr="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},wr(e)}function Er(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sr(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(r.key),r)}}function Or(e,t,n){return t&&Sr(e.prototype,t),n&&Sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _r(e){var t=function(e,t){if("object"!=wr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=wr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wr(t)?t:t+""}function Pr(e,t,n){return t=jr(t),function(e,t){if(t&&("object"===wr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kr()?Reflect.construct(t,n||[],jr(e).constructor):t.apply(e,n))}function kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kr=function(){return!!e})()}function jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jr(e)}function Cr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tr(e,t)}function Tr(e,t){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tr(e,t)}var xr=function(e){function t(e){return Er(this,t),Pr(this,t,[e])}return Cr(t,e),Or(t,[{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Search",titleTemplate:"%s | Foundry Community"}),u().createElement(at,null,u().createElement(Dr,null)))}}])}(u().Component),Dr=it(function(e){function t(e){return Er(this,t),Pr(this,t,[e])}return Cr(t,e),Or(t,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(ot,null,u().createElement(rt,{path:"/:culture/search"},u().createElement(gr,null)),u().createElement(rt,{path:"/search"},u().createElement(gr,null)))}}])}(u().Component));const Nr=xr,Rr=function(e){var t="f-container";return e.marginTop&&(t+=" f-mTop"),e.marginBottom&&(t+=" f-mBottom"),u().createElement("div",{className:t},u().createElement("div",{className:"f-max"},e.children))};var Mr=o(5812),Ir=o.n(Mr);function Ar(e){return Ar="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},Ar(e)}function Lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Br(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,Wr(r.key),r)}}function Fr(e,t,n){return t&&Br(e.prototype,t),n&&Br(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ur(e,t,n){return t=Kr(t),function(e,t){if(t&&("object"===Ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qr()?Reflect.construct(t,n||[],Kr(e).constructor):t.apply(e,n))}function qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qr=function(){return!!e})()}function Kr(e){return Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kr(e)}function Vr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zr(e,t)}function zr(e,t){return zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zr(e,t)}function Wr(e){var t=function(e,t){if("object"!=Ar(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ar(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ar(t)?t:t+""}var Hr=function(e){function t(e){var n;return Lr(this,t),function(e,t,n){(t=Wr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(n=Ur(this,t,[e]),"getNavLinkClass",(function(e){return n.props.location.pathname===e?"active":""})),n.viewportIsMobile=n.viewportIsMobile.bind(n),n.handleResize=n.handleResize.bind(n),n.handleGroupClick=n.handleGroupClick.bind(n),n.handleClickOutside=n.handleClickOutside.bind(n),n.mobileBreakpoint=768,n.state={index:null,isMobile:n.viewportIsMobile()},n}return Vr(t,e),Fr(t,[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"viewportIsMobile",value:function(){return vn.viewport().width<=this.mobileBreakpoint}},{key:"handleResize",value:function(e){this.setState({isMobile:this.viewportIsMobile()})}},{key:"handleGroupClick",value:function(e,t){t.preventDefault();var n=null===this.state.index?e:null;this.setState({index:n})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),e.stopPropagation(),this.setState({index:null})}},{key:"render",value:function(){var e=this,t=null,n=this.props.data.map((function(n,r){switch(n.type){case"ClientRoute":return u().createElement("li",{key:r,className:e.getNavLinkClass(n.url)},u().createElement(gt,{to:n.url,activeClassName:"active"},n.text));case"Anchor":return u().createElement("li",{className:e.getNavLinkClass(n.url)},u().createElement("a",{key:r,href:n.url},n.text));case"Group":e.state.index==r&&(t=u().createElement($r,{items:n.children,onClickOutside:e.handleClickOutside,onOptionClick:e.handleClickOutside}));for(var o=!1,i=0;i<n.children.length-1;i++)e.props.location.pathname===n.children[i].url&&(o=!0);return u().createElement("li",{key:r,className:o?"active":""},u().createElement("a",{href:"#",onClick:e.handleGroupClick.bind(null,r)},n.text," ",u().createElement("span",{className:"caret"})),e.state.index==r&&null!=t&&!e.state.isMobile&&t)}})),r="category-tabs".concat(this.props.className?" "+this.props.className:"");return u().createElement("nav",{className:r},u().createElement("div",{className:"mobile-options-wrapper"},u().createElement("ul",{className:"options"},n)),null!=t&&this.state.isMobile&&t)}}])}(u().Component);Hr.propTypes={data:d().array,activeIndex:d().number,className:d().string};var $r=function(){var e=function(e){function t(e){var n;return Lr(this,t),(n=Ur(this,t,[e])).handleClickOutside=n.handleClickOutside.bind(n),n.handleOptionClick=n.handleOptionClick.bind(n),n}return Vr(t,e),Fr(t,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick(e)}},{key:"render",value:function(){var e=this,t=this.props.items.map((function(t,n){switch(t.type){case"ClientRoute":return u().createElement("li",{key:n,onClick:e.handleOptionClick},u().createElement(gt,{to:t.url},t.text));case"Anchor":return u().createElement("li",{key:n},u().createElement("a",{href:t.url},t.text))}}));return u().createElement("ul",{className:"subnav"},t)}}])}(u().Component);return e.propTypes={items:d().array.isRequired,onClickOutside:d().func.isRequired,onOptionClick:d().func},Ir()(e)}();const Gr=it(Hr);function Jr(e){return Jr="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},Jr(e)}function Qr(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,Yr(r.key),r)}}function Yr(e){var t=function(e,t){if("object"!=Jr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Jr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jr(t)?t:t+""}function Xr(e,t,n){return t=eo(t),function(e,t){if(t&&("object"===Jr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Zr()?Reflect.construct(t,n||[],eo(e).constructor):t.apply(e,n))}function Zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Zr=function(){return!!e})()}function eo(e){return eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eo(e)}function to(e,t){return to=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},to(e,t)}var no=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Xr(this,t,[e])).getAttribute=n.getAttribute.bind(n),n.metricAttributes=[{metric:"views",title:"Views",icon:"glyphicon glyphicon-eye-open"},{metric:"downloads",title:"Downloads",icon:"glyphicon glyphicon-download"},{metric:"likes",title:"Likes",icon:"glyphicon glyphicon-heart"},{metric:"rating",title:"Rating",icon:"glyphicon glyphicon-star"},{metric:"watchers",title:"Watchers",icon:"glyphicon glyphicon-download"},{metric:"collections",title:"Collections",icon:"glyphicon glyphicon-pushpin"},{metric:"comments",title:"Comments",icon:"glyphicon glyphicon-comment"},{metric:"profileView",title:"Profile Views",icon:"glyphicon glyphicon-eye-open"},{metric:"profileFollow",title:"Profile Followers",icon:"glyphicon glyphicon-user"},{metric:"projectView",title:"Project Views",icon:"glyphicon glyphicon-eye-open"},{metric:"projectLike",title:"Project Likes",icon:"glyphicon glyphicon-thumbs-up"}],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&to(e,t)}(t,e),n=t,(r=[{key:"getAttribute",value:function(e){for(var t=0;t<this.metricAttributes.length;t++)if(this.metricAttributes[t].metric==e)return this.metricAttributes[t];return null}},{key:"render",value:function(){var e=[];for(var t in this.props.metrics)if(this.props.metrics.hasOwnProperty(t)){var n=this.getAttribute(t);null!=n&&e.push(u().createElement("span",{key:n.metric,className:n.metric,title:n.title},this.props.metrics[t]))}var r="metrics ".concat(this.props.displayClass?this.props.displayClass:"");return u().createElement("div",{className:r},e)}}])&&Qr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);no.propTypes={metrics:d().object};const ro=no;function oo(e){return oo="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},oo(e)}function io(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,ao(r.key),r)}}function ao(e){var t=function(e,t){if("object"!=oo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=oo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}function so(e,t,n){return t=lo(t),function(e,t){if(t&&("object"===oo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,co()?Reflect.construct(t,n||[],lo(e).constructor):t.apply(e,n))}function co(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(co=function(){return!!e})()}function lo(e){return lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lo(e)}function uo(e,t){return uo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uo(e,t)}var po=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),so(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.profile,t={backgroundImage:"url(".concat(e.avatarUrl,")")};return u().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}},u().createElement("div",{className:"hero-content main clearfix",style:{margin:"0 auto"}},u().createElement("div",{className:"user-info"},u().createElement("a",{href:e.url,className:"profile"},u().createElement("span",{className:"profile-image",style:t}),u().createElement("span",{className:"profile-name"},"Hello ",u().createElement("b",null,e.name)))),u().createElement("div",{className:"user-edit"},u().createElement("div",{className:"user-ctas button-group"},!0===e.show.newProject&&u().createElement("a",{href:"/project/new",className:"button icon icon-after icon-add"},"Upload new project"),u().createElement("a",{href:e.url,className:"button icon icon-after icon-arrow"},"View profile")),u().createElement("div",{className:"profile-stats-wrapper"},u().createElement("p",null,"Your Profile"),u().createElement("div",{className:"profile-stats clearfix"},u().createElement(ro,{metrics:e.metrics,displayClass:"light"}))))))}}])&&io(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);po.propTypes={profile:d().object.isRequired};const fo=po;function ho(e){return ho="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},ho(e)}function yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mo(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,vo(r.key),r)}}function bo(e,t,n){return t&&mo(e.prototype,t),n&&mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vo(e){var t=function(e,t){if("object"!=ho(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ho(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ho(t)?t:t+""}function go(e,t,n){return t=Eo(t),function(e,t){if(t&&("object"===ho(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wo()?Reflect.construct(t,n||[],Eo(e).constructor):t.apply(e,n))}function wo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wo=function(){return!!e})()}function Eo(e){return Eo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Eo(e)}function So(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oo(e,t)}function Oo(e,t){return Oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oo(e,t)}var _o=function(e){function t(e){var n;return yo(this,t),(n=go(this,t,[e])).handleToggle=n.handleToggle.bind(n),n.handleClickOutside=n.handleClickOutside.bind(n),n.handleOptionClick=n.handleOptionClick.bind(n),n.state={isOpen:!1},n}return So(t,e),bo(t,[{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({isOpen:!this.state.isOpen})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),this.state.isOpen&&e.target!=this.refs.action&&this.setState({isOpen:!1})}},{key:"handleOptionClick",value:function(){this.setState({isOpen:!1})}},{key:"render",value:function(){var e;"anchor"==this.props.actionTag||"link"==this.props.actionTag?e=u().createElement("a",{href:"#",ref:"action",onClick:this.handleToggle},this.props.actionLabel," ",u().createElement("span",{className:"caret"})):"button"==this.props.actionTag?e=u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",u().createElement("span",{className:"caret"})):"buttonLink"==this.props.actionTag&&(e=u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",u().createElement("span",{className:"caret"})));var t=null;switch(this.state.isOpen&&(t=u().createElement(Po,{options:this.props.options,onClickOutside:this.handleClickOutside,onOptionClick:this.handleOptionClick,className:this.props.dropdownClassName})),this.props.wrapperTag){case"li":return u().createElement("li",{className:"tfdropdown"},e,t);case"span":return u().createElement("span",{className:"tfdropdown"},e,t);default:return u().createElement("div",{className:"tfdropdown"},e,t)}}}])}(u().Component);_o.propTypes={wrapperTag:d().string,actionTag:d().string,actionLabel:d().oneOfType([d().string,d().object]),options:d().array,dropdownClassName:d().string};var Po=function(){var e=function(e){function t(e){var n;return yo(this,t),(n=go(this,t,[e])).handleClickOutside=n.handleClickOutside.bind(n),n.handleOptionClick=n.handleOptionClick.bind(n),n}return So(t,e),bo(t,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick()}},{key:"render",value:function(){var e=this,t=null;return this.props.className&&(t={className:this.props.className}),u().createElement("ul",t,this.props.options.map((function(t,n){return u().createElement("li",{key:n,onClick:e.handleOptionClick},t)})))}}])}(u().Component);return e.propTypes={options:d().array.isRequired,onClickOutside:d().func.isRequired,onOptionClick:d().func},Ir()(e)}();const ko=_o;var jo=o(1499),Co=o.n(jo);function To(e){return To="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},To(e)}function xo(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,Do(r.key),r)}}function Do(e){var t=function(e,t){if("object"!=To(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=To(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==To(t)?t:t+""}function No(e,t,n){return t=Mo(t),function(e,t){if(t&&("object"===To(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ro()?Reflect.construct(t,n||[],Mo(e).constructor):t.apply(e,n))}function Ro(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ro=function(){return!!e})()}function Mo(e){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mo(e)}function Io(e,t){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Io(e,t)}var Ao=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=No(this,t,[e])).handleDelete=n.handleDelete.bind(n),n.state={filter:n.props.filter},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Io(e,t)}(t,e),n=t,r=[{key:"handleDelete",value:function(e,t){t.preventDefault();var n=this.state.filter;n.options.splice(e,1);var r=n.options.map((function(e,t){return e.value}));n.value=r.join(","),this.props.onChange&&this.props.onChange(this.props.name,n)}},{key:"render",value:function(){var e=this,t=this.state.filter.options.map((function(t,n){return u().createElement("a",{key:n,href:"#",className:"tag"},t.text,u().createElement("span",{className:"remove",onClick:e.handleDelete.bind(null,n)},"Remove"))}));return null!=t&&t.length>0?u().createElement("div",{className:"filter-tags"},t):null}}],r&&xo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Ao.propTypes={name:d().string,filter:d().object};const Lo=Ao;function Bo(e){return Bo="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},Bo(e)}function Fo(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,Uo(r.key),r)}}function Uo(e){var t=function(e,t){if("object"!=Bo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Bo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bo(t)?t:t+""}function qo(e,t,n){return t=Vo(t),function(e,t){if(t&&("object"===Bo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ko()?Reflect.construct(t,n||[],Vo(e).constructor):t.apply(e,n))}function Ko(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ko=function(){return!!e})()}function Vo(e){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vo(e)}function zo(e,t){return zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zo(e,t)}const Wo=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qo(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return u().createElement("div",{className:"multi-radio-container"},this.props.filter.options.map((function(t,n){return u().createElement("label",{key:t.value,className:"clearfix multi-select"},u().createElement("input",{name:e.props.name,value:t.value,checked:t.value===e.props.filter.value,onChange:e.props.onChange,type:"radio"}),u().createElement("span",{className:"radio-multi-label"},t.text))})))}}])&&Fo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Ho(e){return Ho="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},Ho(e)}function $o(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,Go(r.key),r)}}function Go(e){var t=function(e,t){if("object"!=Ho(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ho(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ho(t)?t:t+""}function Jo(e,t,n){return t=Yo(t),function(e,t){if(t&&("object"===Ho(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qo()?Reflect.construct(t,n||[],Yo(e).constructor):t.apply(e,n))}function Qo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qo=function(){return!!e})()}function Yo(e){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yo(e)}function Xo(e,t){return Xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xo(e,t)}const Zo=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jo(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("select",{name:this.props.name,value:this.props.filter.value,onChange:this.props.onChange},this.props.filter.options.map((function(e,t){return u().createElement("option",{key:t,value:e.value},e.text)})))}}])&&$o(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function ei(e){return ei="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},ei(e)}function ti(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ni(r.key),r)}}function ni(e){var t=function(e,t){if("object"!=ei(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ei(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ei(t)?t:t+""}function ri(e,t,n){return t=ii(t),function(e,t){if(t&&("object"===ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oi()?Reflect.construct(t,n||[],ii(e).constructor):t.apply(e,n))}function oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oi=function(){return!!e})()}function ii(e){return ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ii(e)}function ai(e,t){return ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ai(e,t)}var si=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ri(this,t,[e])).state={filter:n.props.filter},n.handleChange=n.handleChange.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handleClear=n.handleClear.bind(n),n.minChars=2,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ai(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.filter.value!==this.state.filter.value&&this.setState({filter:e.filter})}},{key:"handleChange",value:function(e){var t=e.target.value;if(t!=this.state.filter.value){var n=Co()(this.state.filter);n.value=t,this.setState({filter:n})}}},{key:"handleKeyDown",value:function(e){"Enter"===e.key&&this.state.filter.value.length>=this.minChars&&this.handleSubmit(e)}},{key:"handleSubmit",value:function(e){e.preventDefault(),this.props.onChange&&this.props.onChange(this.props.name,this.state.filter)}},{key:"handleClear",value:function(e){e.preventDefault();var t=Co()(this.state.filter);t.value="";var n=this;this.setState({filter:t},(function(){n.props.onChange&&n.props.onChange(n.props.name,n.state.filter)}))}},{key:"render",value:function(){var e=!(""===this.state.filter.value),t=this.state.filter.value.length>=this.minChars;return u().createElement("div",{className:"query-filter"},u().createElement("input",{name:this.props.name,type:"text",value:this.state.filter.value,placeholder:this.props.placeholder,onChange:this.handleChange,onKeyDown:this.handleKeyDown}),u().createElement("div",null,e&&u().createElement("button",{className:"query-clear",onClick:this.handleClear},u().createElement("i",{className:"fa fa-times","aria-hidden":"true"})),u().createElement("button",{className:"query",disabled:!t,onClick:this.handleSubmit},u().createElement("i",{className:"fa fa-search","aria-hidden":"true"}))))}}])&&ti(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);si.propTypes={filter:d().object.isRequired,name:d().string,property:d().string,placeholder:d().string,onChange:d().func};const ci=si;function li(e){return li="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},li(e)}function ui(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,pi(r.key),r)}}function pi(e){var t=function(e,t){if("object"!=li(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=li(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==li(t)?t:t+""}function fi(e,t,n){return t=di(t),function(e,t){if(t&&("object"===li(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hi()?Reflect.construct(t,n||[],di(e).constructor):t.apply(e,n))}function hi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hi=function(){return!!e})()}function di(e){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},di(e)}function yi(e,t){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yi(e,t)}var mi=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=fi(this,t,[e])).handleChange=n.handleChange.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.resetFilter=n.resetFilter.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yi(e,t)}(t,e),n=t,(r=[{key:"handleChange",value:function(e){var t=Co()(this.props.filter),n=e.target.name,r=t[n];for(var o in r.value=e.target.value,t)if(t.hasOwnProperty(o)&&null!=t[o]&&t[o]!=r){var i=t[o];null!=i.dependentOf&&i.dependentOf.includes(n)&&(i.value="")}this.props.onChange&&this.props.onChange(t)}},{key:"handleFilterChange",value:function(e,t){var n=Co()(this.props.filter);n[e]=t,this.props.onChange&&this.props.onChange(n)}},{key:"handleSubmit",value:function(e){e.preventDefault()}},{key:"resetFilter",value:function(){var e=Co()(this.props.filter);for(var t in e)e.hasOwnProperty(t)&&null!=e[t]&&(e[t].value="");this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){var e=[],t=[],n=!1;for(var r in this.props.filter)if(this.props.filter.hasOwnProperty(r)){var o=this.props.filter[r];if(null!=o)switch(""!=o.value&&(n=!0),o.type){case"Sort":t.push(u().createElement(Zo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"Filter":e.push(u().createElement(Zo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"FilterRadio":e.push(u().createElement(Wo,{key:r,name:r,filter:o,onChange:this.handleChange}));break;case"Query":e.push(u().createElement(ci,{key:r,name:r,filter:o,placeholder:"Search...",onChange:this.handleFilterChange}))}}return u().createElement("div",{className:"filters"},u().createElement("div",{className:"filter-select"},u().createElement("form",{onSubmit:this.handleSubmit},u().createElement("div",null,this.props.embeddedNav&&u().createElement("fieldset",{className:"nav"},this.props.embeddedNav),e.length>0&&u().createElement("fieldset",{className:"filter"},e)),u().createElement("div",null,t.length>0&&u().createElement("fieldset",{className:"sort"},t),n&&u().createElement("fieldset",{className:"reset"},u().createElement("button",{onClick:this.resetFilter},"Reset Filter"))))),this.props.filter&&this.props.filter.hasOwnProperty("tags")&&u().createElement(Lo,{name:"tags",filter:this.props.filter.tags,onChange:this.handleFilterChange}))}}])&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);mi.propTypes={filter:d().object,onChange:d().func};const bi=mi;function vi(e){return vi="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},vi(e)}function gi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wi(r.key),r)}}function wi(e){var t=function(e,t){if("object"!=vi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=vi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vi(t)?t:t+""}function Ei(e,t,n){return t=Oi(t),function(e,t){if(t&&("object"===vi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Si()?Reflect.construct(t,n||[],Oi(e).constructor):t.apply(e,n))}function Si(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Si=function(){return!!e})()}function Oi(e){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oi(e)}function _i(e,t){return _i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_i(e,t)}var Pi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ei(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_i(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r=this.props.showArrow?" icon icon-after icon-arrow":"",o=this.props.colorClassName?" ".concat(this.props.colorClassName):"",i="profile".concat(t).concat(n).concat(r).concat(o),a=!0===this.props.showAvatar&&u().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}),s=u().createElement("span",{className:"profile-name"},this.props.profile.name),c=e.join(", ");return!0===this.props.showLink?u().createElement("a",{href:this.props.profile.url,className:i,title:c},a,s):u().createElement("div",{className:i},a,s)}}])&&gi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Pi.propTypes={profile:d().object.isRequired,size:d().string,showAvatar:d().bool,showArrow:d().bool,colorClassName:d().string,showLink:d().bool},Pi.defaultProps={showAvatar:!0,showArrow:!1,showLink:!0};const ki=Pi;function ji(e){return ji="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},ji(e)}function Ci(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,Ti(r.key),r)}}function Ti(e){var t=function(e,t){if("object"!=ji(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ji(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ji(t)?t:t+""}function xi(e,t,n){return t=Ni(t),function(e,t){if(t&&("object"===ji(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Di()?Reflect.construct(t,n||[],Ni(e).constructor):t.apply(e,n))}function Di(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Di=function(){return!!e})()}function Ni(e){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ni(e)}function Ri(e,t){return Ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ri(e,t)}var Mi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xi(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ri(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=null;"Asset"==this.props.project.type&&this.props.project.contents&&(e=this.props.project.contents.map((function(e,t){var n="c"+t;return u().createElement("span",{key:n,className:"content-type"},e)})));var t=null;this.props.project.products&&(t=this.props.project.products.map((function(e,t){return u().createElement("span",{key:t,className:"product"},e)})));var n=null;this.props.showProfile&&(n=u().createElement("div",{className:"info"},u().createElement(ki,{profile:this.props.project.profile,showArrow:!0})));var r="card".concat("Asset"==this.props.project.type?" asset-card":""),o="text-container".concat(this.props.showProfile?"":" noprofile"),i=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:r},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("a",{href:this.props.project.url,className:o},u().createElement("h4",{className:"Training"===this.props.project.type?"video":null,dangerouslySetInnerHTML:vn.createMarkup(i)}),u().createElement("div",{className:"products"},e,t)),n,this.props.children)}}])&&Ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Mi.propTypes={project:d().object.isRequired,showProfile:d().bool},Mi.defaultProps={showProfile:!0};const Ii=Mi;function Ai(e){return Ai="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},Ai(e)}function Li(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,Bi(r.key),r)}}function Bi(e){var t=function(e,t){if("object"!=Ai(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ai(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ai(t)?t:t+""}function Fi(e,t,n){return t=qi(t),function(e,t){if(t&&("object"===Ai(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ui()?Reflect.construct(t,n||[],qi(e).constructor):t.apply(e,n))}function Ui(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ui=function(){return!!e})()}function qi(e){return qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qi(e)}function Ki(e,t){return Ki=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ki(e,t)}var Vi=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Fi(this,t,[e])).onBackButtonEvent=n.onBackButtonEvent.bind(n),n.buildQueryString=n.buildQueryString.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.populate=n.populate.bind(n),n.getData=n.getData.bind(n),n.handleClickDelete=n.handleClickDelete.bind(n),n.handleDelete=n.handleDelete.bind(n),n.parsedQS=yn.parse(e.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.totalPages=null,n.filterHistory=[],n.state={loaded:!1,projects:null,filter:null,showDeleteModal:!1,targetIndex:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ki(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){this.populate()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=yn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.getData(null,!1)}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():null;this.getData(t,!1)}},{key:"buildQueryString",value:function(e){var t=[];if(null!=e)for(var n in e)e.hasOwnProperty(n)&&e[n].value&&t.push("".concat(n,"=").concat(e[n].value));this.page&&t.push("p=".concat(this.page));var r="";return t.length>0&&(r="?"+t.join("&")),r}},{key:"handleFilterChange",value:function(e){this.page=0,this.getData(e,!0)}},{key:"handleNewPage",value:function(e){this.page=e,this.getData(this.state.filter,!0)}},{key:"populate",value:function(){var e=this;$.getJSON("/api/dashboard/projects",(function(t){e.totalPages=null!=t?t.gallery.totalPages:e.totalPages,e.setState({loaded:!0,projects:t.gallery.data,filter:t.filter},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"getData",value:function(e,t){var n=this.buildQueryString(e),r="/api/dashboard/projects/get".concat(n),o=this;$.getJSON(r,(function(t){o.loaded=!0,o.totalPages=null!=t?t.totalPages:o.totalPages,o.setState({projects:t.data,filter:e},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"handleClickDelete",value:function(e){this.setState({showDeleteModal:!0,targetIndex:e})}},{key:"handleDelete",value:function(e){if(!0===e){var t=this.state.projects[this.state.targetIndex],n=this;$.ajax({url:"/api/project/"+t.id+"/delete",type:"DELETE",success:function(e){if(!0===e.isSuccess){var t=n.state.projects;t.splice(n.state.targetIndex,1),n.setState({projects:t,showDeleteModal:!1,targetIndex:null})}}})}else this.setState({showDeleteModal:!1,targetIndex:null})}},{key:"render",value:function(){if(!1===this.state.loaded)return u().createElement(kn,null);var e,t=this;e=null===this.state.projects||0===this.state.projects.length?u().createElement("div",{className:"no-content",style:{width:"100%"}},"No Projects Found"):this.state.projects.map((function(e,n){var r=null,o=[];return o.push(u().createElement("a",{href:"/project/"+e.id+"/edit"},"Edit")),o.push(u().createElement("a",{onClick:t.handleClickDelete.bind(null,n)},"Delete")),e.viewer.canEdit&&(r=u().createElement("div",{className:"edit"},u().createElement(ko,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:o}))),u().createElement(Ii,{key:e.id,project:e,showProfile:!1},r)}));var n=null;if(null!=this.state.targetIndex){var r=this.state.projects[this.state.targetIndex];this.state.showDeleteModal&&(n=u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleDelete.bind(null,!1),contentStyle:{width:"80%"}},u().createElement("div",{className:"overlay-select project-delete-modal report"},u().createElement("h4",null,"Delete project"),u().createElement("p",null,"Are you sure you want to delete the ",u().createElement("strong",null,r.title)," project?  All images, text and stats associated with this project will be permanently deleted."),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete.bind(null,!1)},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleDelete.bind(null,!0)},"Delete")))))}return u().createElement(u().Fragment,null,u().createElement(bi,{filter:this.state.filter,onChange:this.handleFilterChange}),u().createElement("div",{className:"cards-container content-subsection"},this.totalPages&&this.totalPages>1&&u().createElement(Ln,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage}),u().createElement("div",null,e),this.totalPages&&this.totalPages>1&&u().createElement(Ln,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage})),n)}}],r&&Li(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);const zi=it(Vi);function Wi(e){return Wi="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},Wi(e)}function Hi(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,$i(r.key),r)}}function $i(e){var t=function(e,t){if("object"!=Wi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wi(t)?t:t+""}function Gi(e,t,n){return t=Qi(t),function(e,t){if(t&&("object"===Wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ji()?Reflect.construct(t,n||[],Qi(e).constructor):t.apply(e,n))}function Ji(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ji=function(){return!!e})()}function Qi(e){return Qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qi(e)}function Yi(e,t){return Yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yi(e,t)}const Xi=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Gi(this,t,[e])).handleChange=n.handleChange.bind(n),n.getValue=n.getValue.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yi(e,t)}(t,e),n=t,(r=[{key:"handleChange",value:function(){this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"render",value:function(){return u().createElement("div",{className:"form-group"},u().createElement("label",{className:"static"},"Time Zone"),u().createElement("select",{ref:"select",name:"TimeZone",defaultValue:this.props.value,onChange:this.handleChange},u().createElement("option",{value:"-12"},"[GMT - 12:00] Baker Island Time"),u().createElement("option",{value:"-11"},"[GMT - 11:00] Niue Time, Samoa Standard Time"),u().createElement("option",{value:"-10"},"[GMT - 10:00] Hawaii-Aleutian Standard Time, Cook Island Time"),u().createElement("option",{value:"-9.5"},"[GMT - 9:30] Marquesas Islands Time"),u().createElement("option",{value:"-9"},"[GMT - 9:00] Alaska Standard Time, Gambier Island Time"),u().createElement("option",{value:"-8"},"[GMT - 8:00] Pacific Standard Time"),u().createElement("option",{value:"-7"},"[GMT - 7:00] Mountain Standard Time"),u().createElement("option",{value:"-6"},"[GMT - 6:00] Central Standard Time"),u().createElement("option",{value:"-5"},"[GMT - 5:00] Eastern Standard Time"),u().createElement("option",{value:"-4.5"},"[GMT - 4:30] Venezuelan Standard Time"),u().createElement("option",{value:"-4"},"[GMT - 4:00] Atlantic Standard Time"),u().createElement("option",{value:"-3.5"},"[GMT - 3:30] Newfoundland Standard Time"),u().createElement("option",{value:"-3"},"[GMT - 3:00] Amazon Standard Time, Central Greenland Time"),u().createElement("option",{value:"-2"},"[GMT - 2:00] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time"),u().createElement("option",{value:"-1"},"[GMT - 1:00] Azores Standard Time, Cape Verde Time, Eastern Greenland Time"),u().createElement("option",{value:"0"},"[GMT] Western European Time, Greenwich Mean Time"),u().createElement("option",{value:"1"},"[GMT + 1:00] Central European Time, West African Time"),u().createElement("option",{value:"2"},"[GMT + 2:00] Eastern European Time, Central African Time"),u().createElement("option",{value:"3"},"[GMT + 3:00] Moscow Standard Time, Eastern African Time"),u().createElement("option",{value:"3.5"},"[GMT + 3:30] Iran Standard Time"),u().createElement("option",{value:"4"},"[GMT + 4:00] Gulf Standard Time, Samara Standard Time"),u().createElement("option",{value:"4.5"},"[GMT + 4:30] Afghanistan Time"),u().createElement("option",{value:"5"},"[GMT + 5:00] Pakistan Standard Time, Yekaterinburg Standard Time"),u().createElement("option",{value:"5.5"},"[GMT + 5:30] Indian Standard Time, Sri Lanka Time"),u().createElement("option",{value:"5.75"},"[GMT + 5:45] Nepal Time"),u().createElement("option",{value:"6"},"[GMT + 6:00] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time"),u().createElement("option",{value:"6.5"},"[GMT + 6:30] Cocos Islands Time, Myanmar Time"),u().createElement("option",{value:"7"},"[GMT + 7:00] Indochina Time, Krasnoyarsk Standard Time"),u().createElement("option",{value:"8"},"[GMT + 8:00] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time"),u().createElement("option",{value:"8.75"},"[GMT + 8:45] Southeastern Western Australia Standard Time"),u().createElement("option",{value:"9"},"[GMT + 9:00] Japan Standard Time, Korea Standard Time, Chita Standard Time"),u().createElement("option",{value:"9.5"},"[GMT + 9:30] Australian Central Standard Time"),u().createElement("option",{value:"10"},"[GMT + 10:00] Australian Eastern Standard Time, Vladivostok Standard Time"),u().createElement("option",{value:"10.5"},"[GMT + 10:30] Lord Howe Standard Time"),u().createElement("option",{value:"11"},"[GMT + 11:00] Solomon Island Time, Magadan Standard Time"),u().createElement("option",{value:"11.5"},"[GMT + 11:30] Norfolk Island Time"),u().createElement("option",{value:"12"},"[GMT + 12:00] New Zealand Time, Fiji Time, Kamchatka Standard Time"),u().createElement("option",{value:"12.75"},"[GMT + 12:45] Chatham Islands Time"),u().createElement("option",{value:"13"},"[GMT + 13:00] Tonga Time, Phoenix Islands Time"),u().createElement("option",{value:"14"},"[GMT + 14:00] Line Island Time")))}}])&&Hi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Zi(e){return Zi="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},Zi(e)}function ea(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,ta(r.key),r)}}function ta(e){var t=function(e,t){if("object"!=Zi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Zi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zi(t)?t:t+""}function na(e,t,n){return t=oa(t),function(e,t){if(t&&("object"===Zi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ra()?Reflect.construct(t,n||[],oa(e).constructor):t.apply(e,n))}function ra(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ra=function(){return!!e})()}function oa(e){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oa(e)}function ia(e,t){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ia(e,t)}var aa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),na(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ia(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("span",{className:"help-block"},this.props.message)}}])&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);aa.propTypes={message:d().string.isRequired};const sa=aa;function ca(e){return ca="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},ca(e)}function la(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ua(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,fa(r.key),r)}}function pa(e,t,n){return t&&ua(e.prototype,t),n&&ua(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fa(e){var t=function(e,t){if("object"!=ca(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ca(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ca(t)?t:t+""}function ha(e,t,n){return t=ya(t),function(e,t){if(t&&("object"===ca(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,da()?Reflect.construct(t,n||[],ya(e).constructor):t.apply(e,n))}function da(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(da=function(){return!!e})()}function ya(e){return ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ya(e)}function ma(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ba(e,t)}function ba(e,t){return ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ba(e,t)}var va=function(e){function t(e){var n;return la(this,t),(n=ha(this,t,[e])).validate=n.validate.bind(n),n.getSelectedOptions=n.getSelectedOptions.bind(n),n.handleChange=n.handleChange.bind(n),n.getOption=n.getOption.bind(n),n.getSelectedOptionIndex=n.getSelectedOptionIndex.bind(n),n.onDelete=n.onDelete.bind(n),n.onUpdateOrder=n.onUpdateOrder.bind(n),n.handleGroupFocus=n.handleGroupFocus.bind(n),n.handleGroupBlur=n.handleGroupBlur.bind(n),n.placeholderValue=null!=n.props.placeholderOption?n.props.placeholderOption.value:null,n.state={selectedOptions:n.props.selectedOptions?n.props.selectedOptions:[],validate:!1,isValid:!0===n.props.required&&null!=n.props.selectedOptions&&n.props.selectedOptions.length>0,showValidation:!1,hasFocus:!1},n}return ma(t,e),pa(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){null!=e.selectedOptions&&e.selectedOptions!==this.state.selectedOptions&&this.setState({selectedOptions:e.selectedOptions?e.selectedOptions:[]})}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.selectedOptions&&this.state.selectedOptions.length>0}},{key:"getSelectedOptions",value:function(){return this.state.selectedOptions}},{key:"handleChange",value:function(){var e=this,t=this.refs.select.value,n=this.getOption(t);if(t!=this.placeholderValue&&null==this.getSelectedOptionIndex(t)){var r=Co()(this.state.selectedOptions);r.push(n),this.setState({selectedOptions:r,isValid:this.valid()},(function(){e.props.onChange&&e.props.onChange(r)})),this.placeholderValue&&(this.refs.select.value,this.placeholderValue)}}},{key:"getOption",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t];return null}},{key:"getSelectedOptionIndex",value:function(e){for(var t=0;t<this.state.selectedOptions.length;t++)if(this.state.selectedOptions[t].value==e)return t;return null}},{key:"onDelete",value:function(e){var t=this,n=Co()(this.state.selectedOptions);n.splice(e,1),this.setState({selectedOptions:n,isValid:this.valid()},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"onUpdateOrder",value:function(e,t){var n=this.state.selectedOptions;n.splice(t,0,n.splice(e,1)[0]),this.setState({selectedOptions:n})}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=null;this.props.options&&this.props.options.length>0&&(t=this.props.options.map((function(t,n){var r=!1;return null!==e.getSelectedOptionIndex(t.value)&&(r=!0),u().createElement("option",{key:t.value,value:t.value,disabled:r},t.text)})));var n="multiselect-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(n+=" has-focus"):n+=" has-error";var r="static";!0===this.props.required&&(r+=" required");var o=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(o=u().createElement(sa,{message:this.props.helpMessage})):o=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:n,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:r},this.props.label),u().createElement("div",null,u().createElement("select",{ref:"select",value:this.placeholderValue,onChange:this.handleChange,disabled:null==t},null!=this.props.placeholderOption&&u().createElement("option",{key:this.props.placeholderOption.value,value:this.props.placeholderOption.value,disabled:!1},this.props.placeholderOption.text),t),u().createElement(ga,{data:this.state.selectedOptions,onUpdateOrder:this.onUpdateOrder,onDelete:this.onDelete})),o)}}])}(u().Component);va.propTypes={label:d().string,helpMessage:d().string,options:d().array.isRequired,placeholderOption:d().object,selectedOptions:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},va.defaultProps={required:!1,requiredErrorMessage:"At least one item is required"};var ga=function(e){function t(e){var n;return la(this,t),(n=ha(this,t,[e])).dragStart=n.dragStart.bind(n),n.dragOver=n.dragOver.bind(n),n.dragEnter=n.dragEnter.bind(n),n.dragEnd=n.dragEnd.bind(n),n.placeholder=document.createElement("li"),n.placeholder.className="placeholder",n.dragged=null,n}return ma(t,e),pa(t,[{key:"dragStart",value:function(e){this.dragged=e.currentTarget,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("Text",e.currentTarget.id)}},{key:"dragOver",value:function(e){if(e.preventDefault(),this.dragged.style.display="none","placeholder"!=e.target.className&&"LI"==e.target.nodeName){this.over=e.target;var t=e.pageY-$(this.over).offset().top,n=this.over.offsetHeight/2,r=e.target.parentNode;"OL"==r.nodeName&&(t>n?(this.nodePlacement="after",r.insertBefore(this.placeholder,e.target.nextElementSibling)):(this.nodePlacement="before",r.insertBefore(this.placeholder,e.target)))}}},{key:"dragEnter",value:function(e){e.preventDefault()}},{key:"dragEnd",value:function(e){this.dragged.style.display="block",this.dragged.parentNode.removeChild(this.placeholder);var t=Number(this.dragged.dataset.id),n=Number(this.over.dataset.id);t<n&&n--,"after"==this.nodePlacement&&n++,this.props.onUpdateOrder(t,n)}},{key:"render",value:function(){if(null===this.props.data&&0===this.props.data.length)return null;var e=this;return u().createElement("ol",{onDragOver:this.dragOver,onDragEnter:this.dragEnter},this.props.data.map((function(t,n){return u().createElement("li",{"data-id":n,key:n,draggable:!0,onDragEnd:e.dragEnd,onDragStart:e.dragStart},u().createElement("span",{className:"drag-handle glyphicon glyphicon-option-vertical"}),null!=t.display?t.display:t.text," ",u().createElement("button",{type:"button",className:"close",onClick:e.props.onDelete.bind(null,n)},u().createElement("span",null,"×")))})))}}])}(u().Component);const wa=va,Ea=function(e){var t=!0===e.show?"caret":"right-caret";return u().createElement("div",{className:"expand",onClick:e.onClick},u().createElement("span",{className:t}))};function Sa(e){return Sa="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},Sa(e)}function Oa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _a(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,ka(r.key),r)}}function Pa(e,t,n){return t&&_a(e.prototype,t),n&&_a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ka(e){var t=function(e,t){if("object"!=Sa(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Sa(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Sa(t)?t:t+""}function ja(e,t,n){return t=Ta(t),function(e,t){if(t&&("object"===Sa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ca()?Reflect.construct(t,n||[],Ta(e).constructor):t.apply(e,n))}function Ca(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ca=function(){return!!e})()}function Ta(e){return Ta=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ta(e)}function xa(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Da(e,t)}function Da(e,t){return Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Da(e,t)}var Na=function(e){function t(e){var n;Oa(this,t),(n=ja(this,t,[e])).setSelected=n.setSelected.bind(n),n.updateHasSelectedChildren=n.updateHasSelectedChildren.bind(n),n.clearSelectedForums=n.clearSelectedForums.bind(n),n.getSelectedForums=n.getSelectedForums.bind(n),n.getSelected=n.getSelected.bind(n),n.handleSelect=n.handleSelect.bind(n),n.updateSelected=n.updateSelected.bind(n),n.findForum=n.findForum.bind(n),n.handleShow=n.handleShow.bind(n);var r=n.props.forums;null!=n.props.selectedForums&&n.setSelected(r,n.props.selectedForums);var o=[];return n.updateHasSelectedChildren(r,o),n.state={forums:r,show:[],hasSelectedChildren:o},n}return xa(t,e),Pa(t,[{key:"setSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++){var r=t.indexOf(e[n].id);e[n].isSelected=-1!=r,null!=e[n].children&&e[n].children.length>0&&this.setSelected(e[n].children,t)}}},{key:"updateHasSelectedChildren",value:function(e,t){for(var n=!1,r=0;r<=e.length-1;r++)!0===e[r].isSelected&&(n=!0),null!=e[r].children&&e[r].children.length>0&&!0===this.updateHasSelectedChildren(e[r].children,t)&&("Root"===e[r].type&&t.push(e[r].id),n=!0);return n}},{key:"clearSelectedForums",value:function(){this.setSelected(this.state.forums,[]),this.setState({show:[],hasSelectedChildren:[]})}},{key:"getSelectedForums",value:function(){var e=[];return this.getSelected(this.state.forums,e),e}},{key:"getSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++)!0===e[n].isSelected&&t.push(e[n].id),null!=e[n].children&&e[n].children.length>0&&this.getSelected(e[n].children,t)}},{key:"handleSelect",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.forums)),r=this.findForum(n,e);this.updateSelected(r,t);var o=[];this.updateHasSelectedChildren(n,o),this.setState({forums:n,hasSelectedChildren:o})}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"findForum",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].id==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findForum(e[n].children,t);if(null!=r)return r}}return null}},{key:"handleShow",value:function(e){var t=JSON.parse(JSON.stringify(this.state.show)),n=t.indexOf(e);-1===n?t.push(e):t.splice(n,1),this.setState({show:t})}},{key:"render",value:function(){var e=this,t=this.state.forums.map((function(t){var n=-1!=e.state.hasSelectedChildren.indexOf(t.id);switch(t.type){case"Root":var r=-1!=e.state.show.indexOf(t.id);return u().createElement(Ra,{key:t.id,root:t,onSelect:e.handleSelect,onShow:e.handleShow,show:r,hasSelectedChildren:n});case"Group":return u().createElement(Ma,{key:t.id,group:t,onSelect:e.handleSelect})}}));return u().createElement("div",{className:"forumSelectTree"},t)}}])}(u().Component);Na.propTypes={forums:d().array,selectedForums:d().array};var Ra=function(e){function t(){return Oa(this,t),ja(this,t,arguments)}return xa(t,e),Pa(t,[{key:"render",value:function(){var e=this,t=this.props.root.children.map((function(t){return u().createElement(Ma,{key:t.id,group:t,onSelect:e.props.onSelect})}));return u().createElement("div",null,u().createElement(Ea,{show:this.props.show,onClick:this.props.onShow.bind(null,this.props.root.id)}),u().createElement(Aa,{forum:this.props.root,onSelect:this.props.onSelect,hasSelectedChildren:this.props.hasSelectedChildren}),!0===this.props.show&&u().createElement("ul",{className:"root"},t))}}])}(u().Component),Ma=function(e){function t(){return Oa(this,t),ja(this,t,arguments)}return xa(t,e),Pa(t,[{key:"render",value:function(){var e=this,n=this.props.group.children.map((function(n){switch(n.type){case"Group":return u().createElement(t,{key:n.id,group:n,onSelect:e.props.onSelect});case"Discussion":case"Gallery":return u().createElement(Ia,{key:n.id,forum:n,onSelect:e.props.onSelect});default:return null}}));return u().createElement("li",null,u().createElement(Aa,{forum:this.props.group,onSelect:this.props.onSelect}),u().createElement("ul",{className:"group"},n))}}])}(u().Component),Ia=function(e){function t(){return Oa(this,t),ja(this,t,arguments)}return xa(t,e),Pa(t,[{key:"render",value:function(){return u().createElement("li",null,u().createElement(Aa,{forum:this.props.forum,onSelect:this.props.onSelect}))}}])}(u().Component),Aa=function(e){function t(e){var n;return Oa(this,t),(n=ja(this,t,[e])).handleClick=n.handleClick.bind(n),n}return xa(t,e),Pa(t,[{key:"handleClick",value:function(e){this.props.onSelect&&this.props.onSelect(this.props.forum.id,this.refs.checkbox.checked)}},{key:"render",value:function(){var e="noselect".concat(this.props.hasSelectedChildren&&!0===this.props.hasSelectedChildren?" has-selected-children":"");return u().createElement("label",{className:e},u().createElement("input",{type:"checkbox",ref:"checkbox",checked:this.props.forum.isSelected,onChange:this.handleClick})," ",this.props.forum.name)}}])}(u().Component);const La=Na;function Ba(e){return Ba="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},Ba(e)}function Fa(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,Ua(r.key),r)}}function Ua(e){var t=function(e,t){if("object"!=Ba(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ba(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ba(t)?t:t+""}function qa(e,t,n){return t=Va(t),function(e,t){if(t&&("object"===Ba(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ka()?Reflect.construct(t,n||[],Va(e).constructor):t.apply(e,n))}function Ka(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ka=function(){return!!e})()}function Va(e){return Va=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Va(e)}function za(e,t){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},za(e,t)}const Wa=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=qa(this,t,[e])).setup=n.setup.bind(n),n.handleAutoSubscribeChange=n.handleAutoSubscribeChange.bind(n),n.handleAddSignatureToPostChange=n.handleAddSignatureToPostChange.bind(n),n.handleHideRootProductLinksChange=n.handleHideRootProductLinksChange.bind(n),n.handleTimeZoneChange=n.handleTimeZoneChange.bind(n),n.handleSignatureChange=n.handleSignatureChange.bind(n),n.handleLimitUnreadPostsChange=n.handleLimitUnreadPostsChange.bind(n),n.onShowUnread=n.onShowUnread.bind(n),n.onAcceptUnread=n.onAcceptUnread.bind(n),n.onCancelUnread=n.onCancelUnread.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.state={form:null,showUnreadPostsForumsModal:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&za(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/dashboard/preferences").done((function(t,n,r){e.setState({form:t})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleAutoSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribe=!t.autoSubscribe,this.setState({form:t})}},{key:"handleAddSignatureToPostChange",value:function(e){var t=this.state.form;t.addSignatureToPost=!t.addSignatureToPost,this.setState({form:t})}},{key:"handleHideRootProductLinksChange",value:function(e){var t=this.state.form;t.hideRootProductLinks=!t.hideRootProductLinks,this.setState({form:t})}},{key:"handleTimeZoneChange",value:function(e){var t=this.state.form;t.utcOffset=e,this.setState({form:t})}},{key:"handleSignatureChange",value:function(e){}},{key:"handleLimitUnreadPostsChange",value:function(e){var t=this.state.form;t.limitUnreadPosts=!t.limitUnreadPosts,this.setState({form:t})}},{key:"onShowUnread",value:function(){this.setState({showUnreadPostsForumsModal:!0})}},{key:"onAcceptUnread",value:function(){var e=this.state.form;e.unreadPostsForumData=this.refs.unreadForums.getSelectedForums(),this.setState({form:e,showUnreadPostsForumsModal:!1})}},{key:"onCancelUnread",value:function(){this.setState({showUnreadPostsForumsModal:!1})}},{key:"handleCancel",value:function(){this.setup()}},{key:"handleSubmit",value:function(){var e=this.state.form;e.rootForumDisplayData=this.refs.rootForumDisplay.getSelectedOptions(),e.signature=this.refs.signature.value,$.ajax({type:"POST",url:"/api/dashboard/preferences",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success("Preferences Saved")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return null===this.state.form?null:u().createElement("div",{className:"preferences"},u().createElement("div",{className:"container clearfix"},u().createElement("fieldset",null,u().createElement("legend",null,"Community Site Preferences"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement(Xi,{value:this.state.form.utcOffset,onChange:this.handleTimeZoneChange})))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Preferences"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"autoSubscribe",name:"autoSubscribe",checked:this.state.form.autoSubscribe,onChange:this.handleAutoSubscribeChange}),u().createElement("label",{htmlFor:"autoSubscribe"},"Automatically Set Subscription Checkbox During New Topic / Reply To Topic"))))),u().createElement("fieldset",null,u().createElement("legend",null,"Signature"),u().createElement("div",{className:"row clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"addSignatureToPost",name:"addSignatureToPost",checked:this.state.form.addSignatureToPost,onChange:this.handleAddSignatureToPostChange}),u().createElement("label",{htmlFor:"addSignatureToPost"},"Add Signature To Forum Posts")),u().createElement("div",{className:"form-group"},u().createElement("textarea",{name:"signature",ref:"signature",rows:"3",defaultValue:this.state.form.signature,onChange:this.handleSignatureChange,disabled:!this.state.form.addSignatureToPost}))))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Product Links"),u().createElement("div",{className:"row unread clearfix"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},'A group of links to product specific forums has been placed on the front page for the forum to help guide new users.  Advanced users can hide this group and continue using the products drop-down under the "Discuss" section navigation bar.'),u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"hideRootProductLinks",name:"hideRootProductLinks",checked:this.state.form.hideRootProductLinks,onChange:this.handleHideRootProductLinksChange}),u().createElement("label",{htmlFor:"hideRootProductLinks"},"Hide Product links group from front page of forum."))))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Front Page"),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},"Select the Foundry product specific forums you want to display on the front page of the forum under the 'General' section.  On desktop browsers you can also arrange the products in any order through drag and drop."),u().createElement(wa,{ref:"rootForumDisplay",required:!1,options:this.state.form.rootForumDisplayOptions,placeholderOption:{text:"Select front page forums",value:"-1"},selectedOptions:this.state.form.rootForumDisplayData})))),u().createElement("fieldset",null,u().createElement("legend",null,"Forum Unread Posts Limit"),u().createElement("div",{className:"row unread"},u().createElement("div",{className:"col-lg-12"},u().createElement("p",{className:"description"},"The Unread Posts feature defaults to displaying results from all forums.  You can limit the results to specific forums by enabling this preference."),u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"limitUnreadPosts",name:"limitUnreadPosts",checked:this.state.form.limitUnreadPosts,onChange:this.handleLimitUnreadPostsChange}),u().createElement("label",{htmlFor:"limitUnreadPosts"},"Limit Unread Posts to Selected Forums")),u().createElement("div",{className:"unread-select"},u().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowUnread,disabled:!this.state.form.limitUnreadPosts},"Select Forums For Unread Posts"),u().createElement("span",null,this.state.form.unreadPostsForumData?this.state.form.unreadPostsForumData.length:0," forums selected")),this.state.showUnreadPostsForumsModal&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.onCancelUnread,contentStyle:{width:"70%"}},u().createElement("div",{className:"overlay-select"},u().createElement("div",{className:"content"},u().createElement(La,{ref:"unreadForums",forums:this.state.form.unreadPostsForumOptions,selectedForums:this.state.form.unreadPostsForumData})),u().createElement("div",{className:"controls"},u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{className:"btn-default",onClick:this.onCancelUnread},"Cancel")),u().createElement("li",null,u().createElement("button",{className:"btn-primary",onClick:this.onAcceptUnread},"Accept Selection")))))))))),u().createElement("ul",{className:"list-inline center-contents"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"reset",onClick:this.handleCancel},"Reset")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Preferences"))))}}])&&Fa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Ha(e){return Ha="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},Ha(e)}function $a(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,Ga(r.key),r)}}function Ga(e){var t=function(e,t){if("object"!=Ha(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ha(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ha(t)?t:t+""}function Ja(e,t,n){return t=Ya(t),function(e,t){if(t&&("object"===Ha(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qa()?Reflect.construct(t,n||[],Ya(e).constructor):t.apply(e,n))}function Qa(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qa=function(){return!!e})()}function Ya(e){return Ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ya(e)}function Xa(e,t){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xa(e,t)}var Za=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Ja(this,t,[e])).displayValues=[{label:"Forum in",lengthOffset:2},{label:"Topic in",lengthOffset:1},{label:"in",lengthOffset:1}],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.path)return null;var e=this.displayValues[0];switch(this.props.displayMode.toLowerCase()){case"topic":e=this.displayValues[1];break;case"search":e=this.displayValues[2];break;default:e=this.displayValues[0]}for(var t=[],n=0;n<=this.props.path.length-e.lengthOffset;n++)t.push(u().createElement(ft,{key:n,to:this.props.path[n].url},this.props.path[n].name));return u().createElement("span",{className:"forum-path"},e.label," ",t)}}])&&$a(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Za.propTypes={displayMode:d().string},Za.defaultProps={displayMode:"forum"};const es=Za;function ts(e){return ts="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},ts(e)}function ns(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,rs(r.key),r)}}function rs(e){var t=function(e,t){if("object"!=ts(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ts(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ts(t)?t:t+""}function os(e,t,n){return t=as(t),function(e,t){if(t&&("object"===ts(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,is()?Reflect.construct(t,n||[],as(e).constructor):t.apply(e,n))}function is(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(is=function(){return!!e})()}function as(e){return as=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},as(e)}function ss(e,t){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ss(e,t)}const cs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),os(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ss(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.data)return null;var e="contribution-info".concat(this.props.addClass);return u().createElement("div",{className:e},u().createElement("time",null,this.props.data.displayDT),this.props.data.profile&&u().createElement(ki,{profile:this.props.data.profile}))}}])&&ns(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function ls(e){return ls="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},ls(e)}function us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ps(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,hs(r.key),r)}}function fs(e,t,n){return t&&ps(e.prototype,t),n&&ps(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hs(e){var t=function(e,t){if("object"!=ls(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ls(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ls(t)?t:t+""}function ds(e,t,n){return t=ms(t),function(e,t){if(t&&("object"===ls(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ys()?Reflect.construct(t,n||[],ms(e).constructor):t.apply(e,n))}function ys(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ys=function(){return!!e})()}function ms(e){return ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ms(e)}function bs(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vs(e,t)}function vs(e,t){return vs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vs(e,t)}var gs=function(e){function t(){return us(this,t),ds(this,t,arguments)}return bs(t,e),fs(t,[{key:"render",value:function(){var e=[];this.props.topics.data.forEach((function(t,n){e.push(u().createElement(ws,{key:"t:"+t.topicID,topic:t}))}));var t="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return u().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&u().createElement(Ln,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,t)," ",this.props.children)),u().createElement("div",{className:"sort"},u().createElement("span",null,"Started")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},e),this.props.topics.totalPages>1&&u().createElement(Ln,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}])}(u().Component);gs.propTypes={topics:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired,topicCountLabel:d().string};var ws=function(e){function t(){return us(this,t),ds(this,t,arguments)}return bs(t,e),fs(t,[{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=u().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=!0===e.viewer.isSubscribed?" subscribed":"",o="".concat("thread"," clearfix").concat(n).concat(r),i=null;if(e.stickyFL)i=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=u().createElement("span",{className:"moved"},"Link :")}return u().createElement("article",{className:o},u().createElement("div",{className:"topic clearfix"},t,u().createElement("div",{className:"info"},u().createElement("h4",null,null!=i&&i," ",u().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),u().createElement(es,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"contributions"},u().createElement(cs,{data:e.addedBy,addClass:" started"})),u().createElement("div",{className:"contributions mobile-hidden"},u().createElement(cs,{data:e.lastPostBy,addClass:" latest"}))))}}])}(u().Component);ws.propTypes={topic:d().object.isRequired};const Es=gs;function Ss(e){return Ss="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},Ss(e)}function Os(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,_s(r.key),r)}}function _s(e){var t=function(e,t){if("object"!=Ss(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ss(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ss(t)?t:t+""}function Ps(e,t,n){return t=js(t),function(e,t){if(t&&("object"===Ss(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ks()?Reflect.construct(t,n||[],js(e).constructor):t.apply(e,n))}function ks(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ks=function(){return!!e})()}function js(e){return js=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},js(e)}function Cs(e,t){return Cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cs(e,t)}const Ts=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Ps(this,t,[e])).buildUrl=n.buildUrl.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleMarkTopics=n.handleMarkTopics.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.parsedQS=yn.parse(e.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.state={hasLoaded:!1,topics:null,viewer:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cs(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=yn.parse(e.location.search),e.location&&e.location.search&&this.parsedQS&&this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()}},{key:"buildUrl",value:function(){var e="/api/dashboard/unread";return this.addQuerystring(e,this.page)}},{key:"addQuerystring",value:function(e,t){var n=[];return t>0&&n.push("page="+t),n.length>0&&(e+="?"+n.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({hasLoaded:!0,topics:t.topics,viewer:t.viewer},(function(){vn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):alerts.error(t.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleMarkTopics",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/dashboard/mark-unread",contentType:"application/json; charset=utf-8",data:JSON.stringify({page:this.page}),dataType:"json",context:this}).done((function(e,n,r){t.page=e.newPage,t.props.history.push(e.redirectUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname,this.page);this.props.history.push(t)}},{key:"render",value:function(){return!1===this.state.hasLoaded?u().createElement(kn,null):!0===this.state.hasLoaded&&0==this.state.topics.data.length?u().createElement("div",{className:"subsection no-content"},"No Unread Posts"):u().createElement(Es,{topics:this.state.topics,viewer:this.state.viewer,topicCountLabel:"Unread ",onPageChanged:this.handleNewPage},u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleMarkTopics},"Mark topics as read"))}}])&&Os(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function xs(e){return xs="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},xs(e)}function Ds(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,Ns(r.key),r)}}function Ns(e){var t=function(e,t){if("object"!=xs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=xs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xs(t)?t:t+""}function Rs(e,t,n){return t=Is(t),function(e,t){if(t&&("object"===xs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ms()?Reflect.construct(t,n||[],Is(e).constructor):t.apply(e,n))}function Ms(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ms=function(){return!!e})()}function Is(e){return Is=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Is(e)}function As(e,t){return As=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},As(e,t)}var Ls=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Rs(this,t,[e])).handleSubscribeClick=n.handleSubscribeClick.bind(n),n.updateSubscription=n.updateSubscription.bind(n),n.getOptionsName=n.getOptionsName.bind(n),n.state={period:n.props.period},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&As(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({period:e.period})}},{key:"handleSubscribeClick",value:function(e){e>0?this.updateSubscription(!0,e):this.updateSubscription(!1,0)}},{key:"updateSubscription",value:function(e,t){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e,period:t}),dataType:"json",context:this}).done((function(e,n,r){this.setState({period:t},(function(){this.props.afterAction&&this.props.afterAction(t)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"getOptionsName",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t].name;return""}},{key:"render",value:function(){var e=this,t=[];if(this.props.options.forEach((function(n){t.push(u().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,n.value),disabled:n.value==e.state.period},n.name))})),0==this.state.period){var n=this.props.addLabel&&""!=this.props.addLabel?this.props.addLabel:"Watch +";return u().createElement(ko,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}n="".concat(this.props.activeLabelPrefix).concat(this.getOptionsName(this.state.period));var r=this.props.removeLabel&&""!=this.props.removeLabel?this.props.removeLabel:"Stop watching -";return t.push(u().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,-1)},r)),u().createElement(ko,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}}])&&Ds(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Ls.propTypes={consumer:d().string,id:d().number,period:d().number,addLabel:d().string,removeLabel:d().string};const Bs=Ls;function Fs(e){return Fs="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},Fs(e)}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qs(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,Vs(r.key),r)}}function Ks(e,t,n){return t&&qs(e.prototype,t),n&&qs(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vs(e){var t=function(e,t){if("object"!=Fs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Fs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fs(t)?t:t+""}function zs(e,t,n){return t=Hs(t),function(e,t){if(t&&("object"===Fs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ws()?Reflect.construct(t,n||[],Hs(e).constructor):t.apply(e,n))}function Ws(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ws=function(){return!!e})()}function Hs(e){return Hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hs(e)}function $s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gs(e,t)}function Gs(e,t){return Gs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gs(e,t)}var Js=function(e){function t(){return Us(this,t),zs(this,t,arguments)}return $s(t,e),Ks(t,[{key:"render",value:function(){var e=this,t=[];this.props.forums.data.forEach((function(n,r){t.push(u().createElement(Qs,{key:"f:"+n.itemID,forum:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.forums.totalRecords," ").concat(this.props.forumCountLabel?this.props.forumCountLabel:"").concat(1==this.props.forums.totalRecords?"forum":"forums");return u().createElement("div",{className:"thread-container subsection"},this.props.forums.totalPages>1&&u().createElement(Ln,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,n)," ",this.props.children)),u().createElement("div",{className:"control"},u().createElement("span",null,"Subscription Type")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},t),this.props.forums.totalPages>1&&u().createElement(Ln,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}])}(u().Component);Js.propTypes={forums:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired};var Qs=function(e){function t(e){var n;return Us(this,t),(n=zs(this,t,[e])).onSubscriptionChange=n.onSubscriptionChange.bind(n),n}return $s(t,e),Ks(t,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.forum.itemID,e)}},{key:"render",value:function(){var e=this.props.forum,t=!0===e.hasNewContent?" new-content":"",n=0===e.subscription?" deleted":"",r="thread clearfix".concat(t).concat(n);return u().createElement("article",{className:r},u().createElement("div",{className:"topic clearfix"},u().createElement("div",{className:"info"},u().createElement("h4",null,u().createElement("a",{href:e.forum.url},e.forum.name)),u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.topicCount," topics"),u().createElement("span",null,e.postCount," posts"),u().createElement(es,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"control"},u().createElement(Bs,{consumer:"Forum",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching forum -",afterAction:this.onSubscriptionChange})),u().createElement("div",{className:"contributions"},u().createElement(cs,{data:e.lastPostBy,addClass:" latest"}))))}}])}(u().Component);Qs.propTypes={forum:d().object.isRequired};const Ys=Js;function Xs(e){return Xs="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},Xs(e)}function Zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ec(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,nc(r.key),r)}}function tc(e,t,n){return t&&ec(e.prototype,t),n&&ec(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nc(e){var t=function(e,t){if("object"!=Xs(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Xs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xs(t)?t:t+""}function rc(e,t,n){return t=ic(t),function(e,t){if(t&&("object"===Xs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oc()?Reflect.construct(t,n||[],ic(e).constructor):t.apply(e,n))}function oc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oc=function(){return!!e})()}function ic(e){return ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ic(e)}function ac(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sc(e,t)}function sc(e,t){return sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sc(e,t)}var cc=function(e){function t(){return Zs(this,t),rc(this,t,arguments)}return ac(t,e),tc(t,[{key:"render",value:function(){var e=this,t=[];this.props.topics.data.forEach((function(n,r){t.push(u().createElement(lc,{key:"t:"+n.itemID,topic:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return u().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&u().createElement(Ln,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,n)," ",this.props.children)),u().createElement("div",{className:"control"},u().createElement("span",null,"Subscription Type")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},t),this.props.topics.totalPages>1&&u().createElement(Ln,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}])}(u().Component);cc.propTypes={topics:d().object.isRequired,viewer:d().object.isRequired,onPageChanged:d().func.isRequired,topicCountLabel:d().string};var lc=function(e){function t(e){var n;return Zs(this,t),(n=rc(this,t,[e])).onSubscriptionChange=n.onSubscriptionChange.bind(n),n}return ac(t,e),tc(t,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.topic.itemID,e)}},{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=u().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=0===e.subscription?" deleted":"",o="thread clearfix".concat(n).concat(r),i=null;if(e.stickyFL)i=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=u().createElement("span",{className:"moved"},"Link :")}return u().createElement("article",{className:o},u().createElement("div",{className:"topic clearfix"},t,u().createElement("div",{className:"info"},u().createElement("h4",null,null!=i&&i," ",u().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),u().createElement(es,{displayMode:"Search",path:e.forumPath}))),u().createElement("div",{className:"control"},u().createElement(Bs,{consumer:"Topic",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching topic -",afterAction:this.onSubscriptionChange})),u().createElement("div",{className:"contributions"},u().createElement(cs,{data:e.lastPostBy,addClass:" latest"}))))}}])}(u().Component);lc.propTypes={topic:d().object.isRequired};const uc=cc;function pc(e){return pc="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},pc(e)}function fc(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,hc(r.key),r)}}function hc(e){var t=function(e,t){if("object"!=pc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pc(t)?t:t+""}function dc(e,t,n){return t=mc(t),function(e,t){if(t&&("object"===pc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yc()?Reflect.construct(t,n||[],mc(e).constructor):t.apply(e,n))}function yc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yc=function(){return!!e})()}function mc(e){return mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mc(e)}function bc(e,t){return bc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bc(e,t)}const vc=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=dc(this,t,[e])).addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.handleSubscriptionChange=n.handleSubscriptionChange.bind(n),n.hasLoaded=!1,n.mode=n.props.mode,n.parsedQS=yn.parse(e.location.search),n.state={pagedData:null,viewer:null,filter:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=yn.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this.parsedQS.page?this.parsedQS.page:0,n=this,r="/api/dashboard/subscriptions/".concat(this.mode.toLowerCase()).concat(e.location.search),o=!this.hasLoaded;$.getJSON(r).done((function(e,r,i){if(n.hasLoaded=!0,t>0&&null===e.pagedData.totalRecords){var a=n.addQuerystring(n.props.location.pathname,n.state.filter,t-1);this.props.history.push(a)}else n.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){o||window.scrollTo(0,0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"handleSubscriptionChange",value:function(e,t){for(var n=this.state.pagedData,r=0;r<n.data.length;r++)n.data[r].itemID===e&&(n.data[r].subscription=t);this.setState({pagedData:n})}},{key:"render",value:function(){if(!1===this.hasLoaded)return u().createElement(kn,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return u().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Forums":e=u().createElement(Ys,{forums:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange});break;case"Topics":e=u().createElement(uc,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange})}return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-filter"},u().createElement("h3",null,"Watched ",this.mode),u().createElement(bi,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&fc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));var gc=o(808),wc=o.n(gc);function Ec(e){return Ec="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},Ec(e)}function Sc(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,Oc(r.key),r)}}function Oc(e){var t=function(e,t){if("object"!=Ec(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ec(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ec(t)?t:t+""}function _c(e,t,n){return t=kc(t),function(e,t){if(t&&("object"===Ec(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pc()?Reflect.construct(t,n||[],kc(e).constructor):t.apply(e,n))}function Pc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Pc=function(){return!!e})()}function kc(e){return kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kc(e)}function jc(e,t){return jc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jc(e,t)}const Cc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"cards-container content-section"},this.props.children)}}])&&Sc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Tc(e){return Tc="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},Tc(e)}function xc(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,Dc(r.key),r)}}function Dc(e){var t=function(e,t){if("object"!=Tc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Tc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tc(t)?t:t+""}function Nc(e,t,n){return t=Mc(t),function(e,t){if(t&&("object"===Tc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Rc()?Reflect.construct(t,n||[],Mc(e).constructor):t.apply(e,n))}function Rc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Rc=function(){return!!e})()}function Mc(e){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mc(e)}function Ic(e,t){return Ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ic(e,t)}var Ac=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Nc(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ic(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=null;this.props.showProfile&&(e=u().createElement("div",{className:"info"},u().createElement(ki,{profile:this.props.project.profile,showArrow:!0})));var t="text-container".concat(this.props.showProfile?"":" noprofile");return u().createElement("article",{className:"card"},u().createElement("a",{href:this.props.collection.url,className:"card-image"},u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("a",{href:this.props.collection.url,className:t},u().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.title)}),u().createElement("div",{className:"details clearfix"},u().createElement("span",{className:"count"},this.props.collection.itemCount," Videos"))),e)}}])&&xc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Ac.propTypes={collection:d().object.isRequired,showProfile:d().bool},Ac.defaultProps={showProfile:!1};const Lc=Ac;function Bc(e){return Bc="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},Bc(e)}function Fc(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,Uc(r.key),r)}}function Uc(e){var t=function(e,t){if("object"!=Bc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Bc(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bc(t)?t:t+""}function qc(e,t,n){return t=Vc(t),function(e,t){if(t&&("object"===Bc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kc()?Reflect.construct(t,n||[],Vc(e).constructor):t.apply(e,n))}function Kc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kc=function(){return!!e})()}function Vc(e){return Vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vc(e)}function zc(e,t){return zc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zc(e,t)}var Wc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qc(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t=u().createElement("div",{className:"loader"},"Loading ..."),n="Gallery"==this.props.mode,r=this;return e=null==this.props.galleryData||0==this.props.galleryData.length?u().createElement("div",null,"No Projects Found"):this.props.galleryData.map((function(e,t){switch(r.props.galleryOf){case"Project":return u().createElement(Ii,{key:e.id,project:e,showProfile:n});case"Collection":return u().createElement(Lc,{key:e.id,collection:e})}})),e=!0===this.props.loadMoreClicked?u().createElement(wc(),{pageStart:0,loadMore:this.props.loadMore,hasMore:this.props.hasMore,threshold:this.props.scrollThreshold,loader:t},e):u().createElement("div",null,e),u().createElement("div",{className:"subsection filter-results"},u().createElement(Cc,null,e),this.props.children)}}])&&Fc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Wc.propTypes={mode:d().string,galleryData:d().array.isRequired,galleryOf:d().string,infiniteScroll:d().bool,scrollThreshold:d().number,hasMore:d().bool,loadMore:d().func,loadMoreClicked:d().bool},Wc.defaultProps={mode:"Gallery",scrollThreshold:30,hasMore:!1,loadMoreClicked:!1};const Hc=Wc;function $c(e){return $c="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},$c(e)}function Gc(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,Jc(r.key),r)}}function Jc(e){var t=function(e,t){if("object"!=$c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=$c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$c(t)?t:t+""}function Qc(e,t,n){return t=Xc(t),function(e,t){if(t&&("object"===$c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Yc()?Reflect.construct(t,n||[],Xc(e).constructor):t.apply(e,n))}function Yc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yc=function(){return!!e})()}function Xc(e){return Xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xc(e)}function Zc(e,t){return Zc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zc(e,t)}var el=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Qc(this,t,[e])).onBackButtonEvent=n.onBackButtonEvent.bind(n),n.buildQueryString=n.buildQueryString.bind(n),n.loadMore=n.loadMore.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleLoadMoreClick=n.handleLoadMoreClick.bind(n),n.getData=n.getData.bind(n),n.hasMore=n.props.galleryView.gallery.hasMore,n.filterHistory=[],n.state={galleryData:n.props.galleryView.gallery.data,galleryOf:n.props.galleryView.galleryOf,filter:n.props.galleryView.filter,loadMoreClicked:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){window.onpopstate=this.onBackButtonEvent}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():this.props.galleryView.filter;this.getData(t,null,!1)}},{key:"buildQueryString",value:function(e,t){var n=this.props.qs?this.props.qs.slice():[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&e[r].value&&n.push("".concat(r,"=").concat(e[r].value));t&&n.push("p=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"loadMore",value:function(e){this.getData(this.state.filter,e,!1)}},{key:"handleFilterChange",value:function(e){this.getData(e,null,!0)}},{key:"handleLoadMoreClick",value:function(){this.setState({loadMoreClicked:!0})}},{key:"getData",value:function(e,t,n){var r=this.buildQueryString(e,t),o="/api/".concat(this.props.section,"/get").concat(r),i="/".concat(this.props.section).concat(r),a=this;$.getJSON(o,(function(r){var o;a.hasMore=!(null==r||!r.hasMore)&&r.hasMore;var s=a.state.loadMoreClicked;null===t?(o=r.data,s=!1):o=null!=r&&r.data.length>0?a.state.data.concat(r.data):a.state.data,!0===a.props.updateHistory&&!0===n&&(a.state.filter!=a.props.galleryView.filter&&a.filterHistory.push(JSON.parse(JSON.stringify(a.state.filter))),history.pushState(null,null,i)),a.setState({galleryData:o,filter:e,loadMoreClicked:s})}))}},{key:"render",value:function(){return u().createElement("div",null,u().createElement(bi,{filter:this.state.filter,onChange:this.handleFilterChange}),u().createElement(Hc,{galleryData:this.state.galleryData,galleryOf:this.state.galleryOf,mode:this.props.mode,hasMore:this.hasMore,loadMore:this.loadMore,scrollTheshold:this.props.scrollThreshold,loadMoreClicked:this.state.loadMoreClicked},this.hasMore&&!1===this.state.loadMoreClicked&&u().createElement("button",{className:"load-more",onClick:this.handleLoadMoreClick},"Load more")))}}])&&Gc(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);el.propTypes={mode:d().string,galleryView:d().object.isRequired,section:d().string.isRequired,qs:d().array,updateHistory:d().bool,infiniteScroll:d().bool,scrollThreshold:d().number},el.defaultProps={mode:"Gallery",updateHistory:!0,scrollThreshold:250};const tl=el;function nl(e){return nl="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},nl(e)}function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ol(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,al(r.key),r)}}function il(e,t,n){return t&&ol(e.prototype,t),n&&ol(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function al(e){var t=function(e,t){if("object"!=nl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=nl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nl(t)?t:t+""}function sl(e,t,n){return t=ll(t),function(e,t){if(t&&("object"===nl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cl()?Reflect.construct(t,n||[],ll(e).constructor):t.apply(e,n))}function cl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cl=function(){return!!e})()}function ll(e){return ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ll(e)}function ul(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pl(e,t)}function pl(e,t){return pl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pl(e,t)}u().Component;var fl=function(e){function t(e){var n;return rl(this,t),(n=sl(this,t,[e])).subsData=[{type:"ClientRoute",children:null,text:"Forums",url:"/dashboard/watched/forums"},{type:"ClientRoute",children:null,text:"Topics",url:"/dashboard/watched/topics"}],n.navData=[{type:"ClientRoute",children:null,text:"Projects",url:"/dashboard"},{type:"ClientRoute",children:null,text:"Unread Posts",url:"/dashboard/unread"},{type:"Group",children:n.subsData,text:"Watched",url:""},{type:"ClientRoute",children:null,text:"Preferences",url:"/dashboard/preferences"}],n}return ul(t,e),il(t,[{key:"render",value:function(){return u().createElement("div",null,u().createElement(fo,{profile:this.props.profile}),u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Dashboard | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(at,null,u().createElement(Gr,{data:this.navData}),u().createElement(hl,null))))}}])}(u().Component),hl=it(function(e){function t(e){return rl(this,t),sl(this,t,[e])}return ul(t,e),il(t,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(ot,null,u().createElement(rt,{exact:!0,path:"/dashboard"},u().createElement(Rr,{marginTop:!0,marginBottom:!0},u().createElement(zi,null))),u().createElement(rt,{path:"/dashboard/unread"},u().createElement(Ts,null)),u().createElement(rt,{path:"/dashboard/watched/forums"},u().createElement(vc,{mode:"Forums"})),u().createElement(rt,{path:"/dashboard/watched/topics"},u().createElement(vc,{mode:"Topics"})),u().createElement(rt,{path:"/dashboard/preferences"},u().createElement(Wa,null)))}}])}(u().Component));const dl=fl;function yl(e){return yl="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},yl(e)}function ml(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,bl(r.key),r)}}function bl(e){var t=function(e,t){if("object"!=yl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yl(t)?t:t+""}function vl(e,t,n){return t=wl(t),function(e,t){if(t&&("object"===yl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gl()?Reflect.construct(t,n||[],wl(e).constructor):t.apply(e,n))}function gl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gl=function(){return!!e})()}function wl(e){return wl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wl(e)}function El(e,t){return El=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},El(e,t)}const Sl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),vl(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&El(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"page-error"},u().createElement("div",{dangerouslySetInnerHTML:{__html:this.props.xhr.responseJSON.errorMessage}}),401==this.props.xhr.status&&u().createElement("div",null,"You will be automatically redirected to ",u().createElement("a",{href:this.props.xhr.responseJSON.redirectUrl},"Sign-In")),this.props.returnUrl&&u().createElement("div",null,u().createElement("a",{href:this.props.returnUrl.url},this.props.returnUrl.text)))}}])&&ml(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Ol(e){return Ol="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},Ol(e)}function _l(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,Pl(r.key),r)}}function Pl(e){var t=function(e,t){if("object"!=Ol(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ol(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ol(t)?t:t+""}function kl(e,t,n){return t=Cl(t),function(e,t){if(t&&("object"===Ol(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jl()?Reflect.construct(t,n||[],Cl(e).constructor):t.apply(e,n))}function jl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jl=function(){return!!e})()}function Cl(e){return Cl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cl(e)}function Tl(e,t){return Tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tl(e,t)}const xl=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=kl(this,t,[e])).markRoot=n.markRoot.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tl(e,t)}(t,e),n=t,(r=[{key:"markRoot",value:function(){$.ajax({type:"POST",url:"/api/forum/markroot",contentType:"application/json; charset=utf-8",data:JSON.stringify({rootID:this.props.rootID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("button",{type:"button",className:"btn-link",onClick:this.markRoot},"Mark forums as read")}}])&&_l(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Dl(e){return Dl="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},Dl(e)}function Nl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rl(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,Il(r.key),r)}}function Ml(e,t,n){return t&&Rl(e.prototype,t),n&&Rl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Il(e){var t=function(e,t){if("object"!=Dl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Dl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dl(t)?t:t+""}function Al(e,t,n){return t=Bl(t),function(e,t){if(t&&("object"===Dl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ll()?Reflect.construct(t,n||[],Bl(e).constructor):t.apply(e,n))}function Ll(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ll=function(){return!!e})()}function Bl(e){return Bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bl(e)}function Fl(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ul(e,t)}function Ul(e,t){return Ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ul(e,t)}var ql=function(e){function t(e){var n;return Nl(this,t),(n=Al(this,t,[e])).setLocal=n.setLocal.bind(n),n.buildUrl=n.buildUrl.bind(n),n.reload=n.reload.bind(n),n.getData=n.getData.bind(n),n.createGroup=n.createGroup.bind(n),n.isGroup=n.isGroup.bind(n),n.notGroup=n.notGroup.bind(n),n.Modes={Root:"Root",Group:"Group"},n.mode=n.Modes.Root,n.id=null,n.root=null,n.ajaxError=null,n.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,rootID:null,rootUrl:null,forumList:null,viewer:null},n}return Fl(t,e),Ml(t,[{key:"componentDidMount",value:function(){this.setLocal(this.props),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setLocal(e),this.getData()}},{key:"setLocal",value:function(e){e.match.params.id&&e.match.path.startsWith("/discuss/group")?(this.id=e.match.params.id,this.mode=this.Modes.Group):(this.root=e.match.params.root?e.match.params.root:"",this.mode=this.Modes.Root)}},{key:"buildUrl",value:function(){var e="/api/discuss/";switch(this.mode){case this.Modes.Group:e+="group/"+this.id;break;case this.Modes.Root:e+=this.root}return e}},{key:"reload",value:function(){this.getData()}},{key:"getData",value:function(e){var t=this;e=this.buildUrl(),$.getJSON(e).done((function(e,n,r){t.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,rootID:e.rootID,rootUrl:e.rootUrl,forumList:e.forumList,viewer:e.viewer})})).fail((function(e,n,r){t.ajaxError=e,t.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"createGroup",value:function(e,t){var n=this,r=[],o=[];!0===t&&this.state.viewer.isSignedIn&&o.push(u().createElement(xl,{key:0,rootID:this.state.rootID,afterAction:this.reload})),r.push(u().createElement(Kl,{key:e.forumID,group:e,childrenData:e.children.filter(this.notGroup),titleLink:this.mode==this.Modes.Root},o));var i=e.children.filter(this.isGroup);if(i.length>0){var a=i.map((function(e,t){return n.createGroup(e,!1)}));r=r.concat(a)}return r}},{key:"isGroup",value:function(e){return"Group"==e.type}},{key:"notGroup",value:function(e){return"Group"!=e.type}},{key:"render",value:function(){var e=this;if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Error)return u().createElement(Sl,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}});if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading)return u().createElement(kn,null);var t=this.state.forumList.map((function(t,n){return e.createGroup(t,0==n)})),n=null!=this.state.forumList[0].metaDescription?this.state.forumList[0].metaDescription:this.state.forumList[0].description;return u().createElement("div",null,u().createElement(dn,null,u().createElement("title",null,this.state.forumList[0].name),null!=n&&""!=n&&u().createElement("meta",{name:"description",content:n}),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.rootUrl)})),u().createElement("div",{className:"subsection"},!1,t))}}])}(u().Component),Kl=function(e){function t(){return Nl(this,t),Al(this,t,arguments)}return Fl(t,e),Ml(t,[{key:"render",value:function(){var e=[];return this.props.childrenData.forEach((function(t,n){switch(t.type){case"Discussion":e.push(u().createElement(zl,{key:t.forumID,forum:t}));break;case"Gallery":e.push(u().createElement(Wl,{key:t.forumID,forum:t}));break;case"Link":e.push(u().createElement(Vl,{key:t.forumID,forum:t}))}})),u().createElement("div",{className:"discussion"},u().createElement("div",{className:"group"},u().createElement("div",{className:"group-name clearfix"},this.props.children,u().createElement("h3",null,this.props.titleLink?u().createElement(ft,{to:this.props.group.url},this.props.group.name):this.props.group.name)),u().createElement("div",{className:"forums"},e)))}}])}(u().Component),Vl=function(e){function t(){return Nl(this,t),Al(this,t,arguments)}return Fl(t,e),Ml(t,[{key:"render",value:function(){return u().createElement("article",{className:"discuss clearfix"},u().createElement("a",{href:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)))}}])}(u().Component),zl=function(e){function t(){return Nl(this,t),Al(this,t,arguments)}return Fl(t,e),Ml(t,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n="discuss clearfix".concat(e).concat(t);return u().createElement("article",{className:n},u().createElement(ft,{to:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)))}}])}(u().Component),Wl=function(e){function t(){return Nl(this,t),Al(this,t,arguments)}return Fl(t,e),Ml(t,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n=null!=this.props.forum.imageStrip?" discuss-gallery ":"",r="discuss clearfix".concat(n).concat(e).concat(t);return u().createElement("article",{className:r},u().createElement(ft,{to:this.props.forum.url},u().createElement("h4",null,this.props.forum.name),u().createElement("p",{className:"caption"},this.props.forum.description)),u().createElement(Hl,{imageStrip:this.props.forum.imageStrip}))}}])}(u().Component),Hl=function(e){function t(){return Nl(this,t),Al(this,t,arguments)}return Fl(t,e),Ml(t,[{key:"render",value:function(){if(!this.props.imageStrip)return null;var e=[];return this.props.imageStrip.forEach((function(t,n){e.push(u().createElement("li",{key:t.topicID},u().createElement("a",{href:t.url,style:{backgroundImage:"url("+t.thumbUrl+")"}})))})),u().createElement("ul",{className:"discuss-carousel"},e)}}])}(u().Component);const $l=ql;function Gl(e){return Gl="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},Gl(e)}function Jl(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,Ql(r.key),r)}}function Ql(e){var t=function(e,t){if("object"!=Gl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Gl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gl(t)?t:t+""}function Yl(e,t,n){return t=Zl(t),function(e,t){if(t&&("object"===Gl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xl()?Reflect.construct(t,n||[],Zl(e).constructor):t.apply(e,n))}function Xl(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xl=function(){return!!e})()}function Zl(e){return Zl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zl(e)}function eu(e,t){return eu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eu(e,t)}const tu=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Yl(this,t,[e])).handleMarkForum=n.handleMarkForum.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}(t,e),n=t,(r=[{key:"handleMarkForum",value:function(e){$.ajax({type:"POST",url:"/api/forum/mark",contentType:"application/json; charset=utf-8",data:JSON.stringify({forumID:this.props.forumID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("span",null,u().createElement("button",{type:"button",className:"btn-link mark-forum",onClick:this.handleMarkForum},"Mark topics as read"))}}])&&Jl(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function nu(e){return nu="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},nu(e)}function ru(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,ou(r.key),r)}}function ou(e){var t=function(e,t){if("object"!=nu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=nu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nu(t)?t:t+""}function iu(e,t,n){return t=su(t),function(e,t){if(t&&("object"===nu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,au()?Reflect.construct(t,n||[],su(e).constructor):t.apply(e,n))}function au(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(au=function(){return!!e})()}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},su(e)}function cu(e,t){return cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cu(e,t)}const lu=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=iu(this,t,[e])).handleClick=n.handleClick.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cu(e,t)}(t,e),n=t,(r=[{key:"handleClick",value:function(){this.props.history.push("/discuss/topic/new?id=".concat(this.props.forumID))}},{key:"render",value:function(){return u().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleClick},"Start new discussion")}}])&&ru(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function uu(e){return uu="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},uu(e)}function pu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fu(r.key),r)}}function fu(e){var t=function(e,t){if("object"!=uu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uu(t)?t:t+""}function hu(e,t,n){return t=yu(t),function(e,t){if(t&&("object"===uu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,du()?Reflect.construct(t,n||[],yu(e).constructor):t.apply(e,n))}function du(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(du=function(){return!!e})()}function yu(e){return yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yu(e)}function mu(e,t){return mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mu(e,t)}var bu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hu(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.forum;return u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},u().createElement("div",{className:"with-button"},e.show.newTopic&&!this.props.viewer.isMobile&&u().createElement(lu,{forumID:e.forumID}),u().createElement("h2",{className:"brandDot"},e.name)),u().createElement("div",{className:"forum-meta"},e.show.subscription&&u().createElement(Bs,{consumer:"Forum",id:e.forumID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],addLabel:"Watch forum +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching forum -"}),e.show.markAsRead&&u().createElement(tu,{forumID:e.forumID,afterAction:this.props.afterAction}),u().createElement(es,{displayMode:"Forum",path:e.path})))))}}])&&pu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);bu.propTypes={forum:d().object.isRequired};const vu=bu;function gu(e){return gu="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},gu(e)}function wu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Eu(r.key),r)}}function Eu(e){var t=function(e,t){if("object"!=gu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gu(t)?t:t+""}function Su(e,t,n){return t=_u(t),function(e,t){if(t&&("object"===gu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ou()?Reflect.construct(t,n||[],_u(e).constructor):t.apply(e,n))}function Ou(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ou=function(){return!!e})()}function _u(e){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_u(e)}function Pu(e,t){return Pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pu(e,t)}var ku=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Su(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.topic,t="thread",n=null;"gallery"==e.type.toLowerCase()&&(t="thread gallery",null!=e.thumbUrl&&(n=u().createElement(ft,{to:e.url,className:"thumb"},u().createElement("img",{src:e.thumbUrl}))));var r=!0===e.viewer.hasNewContent?" new-content":"",o=!0===e.viewer.isSubscribed?" subscribed":"",i="".concat(t," clearfix").concat(r).concat(o),a=null;if(e.stickyFL)a=u().createElement("span",{className:"sticky"},u().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":a=u().createElement("span",{className:"moved"},"Moved :");break;case"Linked":a=null!=e.productIcon?u().createElement("img",{src:e.productIcon,alt:"Promoted :"}):u().createElement("span",{className:"moved"},"Promoted :")}return u().createElement("article",{className:i},n,u().createElement("div",{className:"topic"},u().createElement("div",{className:"info"},u().createElement("h4",null,null!=a&&a," ",u().createElement(ft,{to:e.url},e.text)),"None"==e.redirectType&&u().createElement("div",{className:"topic-metrics"},u().createElement("span",null,e.postCount," posts"),u().createElement("span",null,e.viewCount," views"),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&u().createElement(ft,{to:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&u().createElement(ft,{to:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"))),u().createElement("div",{className:"contributions"},u().createElement(cs,{data:e.addedBy,addClass:" started"})),u().createElement("div",{className:"contributions mobile-hidden"},u().createElement(cs,{data:e.lastPostBy,addClass:" latest"}))))}}])&&wu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);ku.propTypes={topic:d().object.isRequired};const ju=ku;function Cu(e){return Cu="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},Cu(e)}function Tu(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,xu(r.key),r)}}function xu(e){var t=function(e,t){if("object"!=Cu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Cu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cu(t)?t:t+""}function Du(e,t,n){return t=Ru(t),function(e,t){if(t&&("object"===Cu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nu()?Reflect.construct(t,n||[],Ru(e).constructor):t.apply(e,n))}function Nu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nu=function(){return!!e})()}function Ru(e){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ru(e)}function Mu(e,t){return Mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mu(e,t)}const Iu=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Du(this,t,[e])).buildUrl=n.buildUrl.bind(n),n.buildBaseUrl=n.buildBaseUrl.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.parsedQS=yn.parse(e.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.days=n.parsedQS.days?n.parsedQS.days:null,n.ajaxError=null,n.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topics:null,viewer:null,nav:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mu(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData(this.page)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=yn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.days=this.parsedQS.days?this.parsedQS.days:null,this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/forum/"+this.props.match.params.id;return this.addQuerystring(e,this.page,this.days)}},{key:"buildBaseUrl",value:function(){var e=this.props.location.pathname;return this.addQuerystring(e,null,this.days)}},{key:"addQuerystring",value:function(e,t,n){var r=[];return t&&t>0&&r.push("page="+t),null!==n&&r.push("days="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topics:t.topics,viewer:t.viewer,nav:t.nav},(function(){vn.updateScrollPosition(!0)}))})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,e,this.days),this.props.history.push(t)}},{key:"render",value:function(){var e=this.buildBaseUrl();if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics)return u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(kn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(Sl,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}}));var t="thread-container".concat("gallery"==this.state.forum.type.toLowerCase()?" gallery":""),n=null;if(this.state.topics.data.length>0){var r=[];this.state.topics.data.forEach((function(e,t){r.push(u().createElement(ju,{key:e.topicID,topic:e}))})),n=u().createElement("div",{className:t},this.state.topics.totalPages>1&&u().createElement(Ln,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage,enableKeyEvents:!0,baseUrl:e}),u().createElement("div",{className:"thread-filters"},u().createElement("div",{className:"info"},u().createElement("p",{className:"thread-count"},u().createElement("span",null,this.state.topics.totalRecords," ",1==this.state.topics.totalRecords?"Topic":"Topics"))),u().createElement("div",{className:"sort"},u().createElement("span",null,"Started")),u().createElement("div",{className:"sort"},u().createElement("span",null,"Last post"))),u().createElement("div",{className:"thread-wrapper"},r),this.state.topics.totalPages>1&&u().createElement(Ln,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage,baseUrl:e}))}else n=u().createElement("div",{className:"subsection no-content"},"No topics available.  Start the conversation.");var o="".concat(window.location.origin).concat(this.state.forum.url);return this.page>0&&(o+="?page=".concat(this.page)),u().createElement("div",null,u().createElement(dn,null,u().createElement("title",null,this.state.forum.name),u().createElement("link",{rel:"canonical",href:o})),u().createElement(vu,{forum:this.state.forum,viewer:this.state.viewer,afterAction:this.getData}),n,this.state.forum.show.newTopic&&u().createElement("div",{className:"new-content-button"},u().createElement(lu,{forumID:this.state.forum.forumID})))}}])&&Tu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function Au(e){return Au="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},Au(e)}function Lu(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,Bu(r.key),r)}}function Bu(e){var t=function(e,t){if("object"!=Au(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Au(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Au(t)?t:t+""}function Fu(e,t,n){return t=qu(t),function(e,t){if(t&&("object"===Au(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Uu()?Reflect.construct(t,n||[],qu(e).constructor):t.apply(e,n))}function Uu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Uu=function(){return!!e})()}function qu(e){return qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qu(e)}function Ku(e,t){return Ku=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ku(e,t)}const Vu=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Fu(this,t,[e])).setup=n.setup.bind(n),n.validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handleTitleChange=n.handleTitleChange.bind(n),n.state={isValid:!0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ku(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/discuss/topic/edit?id="+this.props.topic.topicID).done((function(t,n,r){e.refs.title.focus()})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){if(this.validate()){var e=this.getValue(),t={topicID:this.props.topic.topicID,title:e};$.ajax({type:"POST",url:"/api/discuss/topic/edit?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.props.onSubmit(e.title)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"handleTitleChange",value:function(){this.setState({isValid:this.valid()})}},{key:"render",value:function(){var e="form-group".concat(this.state.isValid?"":" has-error"),t=null;return this.state.isValid||(t=u().createElement(sa,{message:"title required and must be 3 or more characters in length"})),u().createElement("div",{className:e},u().createElement("div",{className:"input-group"},u().createElement("input",{name:"title",ref:"title",defaultValue:this.props.topic.text,className:"form-control",style:{width:"100%"},onChange:this.handleTitleChange}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",disabled:!this.state.isValid,onClick:this.handleSubmit},"Submit"))),t)}}])&&Lu(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function zu(e){return zu="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},zu(e)}function Wu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hu(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,Gu(r.key),r)}}function $u(e,t,n){return t&&Hu(e.prototype,t),n&&Hu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gu(e){var t=function(e,t){if("object"!=zu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=zu(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zu(t)?t:t+""}function Ju(e,t,n){return t=Yu(t),function(e,t){if(t&&("object"===zu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qu()?Reflect.construct(t,n||[],Yu(e).constructor):t.apply(e,n))}function Qu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qu=function(){return!!e})()}function Yu(e){return Yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yu(e)}function Xu(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zu(e,t)}function Zu(e,t){return Zu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zu(e,t)}var ep=function(e){function t(e){var n;return Wu(this,t),(n=Ju(this,t,[e])).handleClose=n.handleClose.bind(n),n.handleToggle=n.handleToggle.bind(n),n.state={showLinks:!1},n}return Xu(t,e),$u(t,[{key:"handleClose",value:function(e){e.preventDefault(),this.state.showLinks&&e.target!=this.refs.action&&this.setState({showLinks:!1})}},{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({showLinks:!this.state.showLinks})}},{key:"render",value:function(){return u().createElement("span",{id:"share"},u().createElement("button",{ref:"action",type:"button",className:"btn-link share",onClick:this.handleToggle},"Share"),!0===this.state.showLinks&&u().createElement(tp,{onClose:this.handleClose}))}}])}(u().Component),tp=function(){var e=function(e){function t(e){var n;return Wu(this,t),(n=Ju(this,t,[e])).handleClickOutside=n.handleClickOutside.bind(n),n}return Xu(t,e),$u(t,[{key:"UNSAFE_componentWillMount",value:function(){this.url="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname)}},{key:"handleClickOutside",value:function(e){this.props.onClose(e)}},{key:"render",value:function(){var e="https://www.facebook.com/sharer/sharer.php?u=".concat(this.url),t="https://twitter.com/intent/tweet?url=".concat(this.url),n="https://www.linkedin.com/shareArticle?mini=true&url=".concat(this.url);return u().createElement("nav",{className:"social"},u().createElement("a",{href:e,target:"_blank"},u().createElement("span",{className:"facebook"},"Facebook")),u().createElement("a",{href:t,target:"_blank"},u().createElement("span",{className:"x"},"X")),u().createElement("a",{href:n,target:"_blank"},u().createElement("span",{className:"linkedin"},"Linkedin")))}}])}(u().Component);return Ir()(e)}();const np=ep;function rp(e){return rp="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},rp(e)}function op(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,ip(r.key),r)}}function ip(e){var t=function(e,t){if("object"!=rp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rp(t)?t:t+""}function ap(e,t,n){return t=cp(t),function(e,t){if(t&&("object"===rp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,sp()?Reflect.construct(t,n||[],cp(e).constructor):t.apply(e,n))}function sp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(sp=function(){return!!e})()}function cp(e){return cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cp(e)}function lp(e,t){return lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lp(e,t)}var up=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ap(this,t,[e])).handleEdit=n.handleEdit.bind(n),n.handleCancelEdit=n.handleCancelEdit.bind(n),n.handleSubmitEdit=n.handleSubmitEdit.bind(n),n.viewMode={TopicView:"TopicView",PostView:"PostView"},n.state={topic:n.props.topic,showEdit:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lp(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({topic:e.topic})}},{key:"handleEdit",value:function(){this.setState({showEdit:!0})}},{key:"handleCancelEdit",value:function(){this.setState({showEdit:!1})}},{key:"handleSubmitEdit",value:function(e){var t=this.state.topic;t.text=e,this.setState({showEdit:!1,topic:t})}},{key:"render",value:function(){var e=this.state.topic;return u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},this.state.showEdit?u().createElement(Vu,{ref:"title",topic:e,onSubmit:this.handleSubmitEdit,onCancel:this.handleCancelEdit}):u().createElement("h2",null,this.props.viewMode===this.viewMode.TopicView&&e.text,this.props.viewMode===this.viewMode.PostView&&u().createElement("span",null,"Post from: ",u().createElement(ft,{to:"".concat(e.url,"?mode=Post&postID=").concat(this.props.post.postID,"#").concat(this.props.post.postID)},e.text)),this.props.viewMode===this.viewMode.TopicView&&e.viewer.canEdit&&u().createElement("button",{type:"button",className:"btn-link light icon icon-after icon-color-white icon-edit",onClick:this.handleEdit},"Edit Title")),null!=e.addedBy&&null!=e.addedBy.profile&&u().createElement(ki,{profile:e.addedBy.profile}),u().createElement("div",{className:"forum-meta"},e.show.subscription&&u().createElement(Bs,{consumer:"Topic",id:e.topicID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],addLabel:"Watch topic +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching topic -"}),u().createElement(np,null),u().createElement("time",null,e.addedBy.displayDT),u().createElement(es,{displayMode:"Topic",path:this.props.forumPath})),this.props.children)))}}])&&op(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);up.propTypes={topic:d().object,forumPath:d().array},up.defaultProps={viewMode:"TopicView"};const pp=up;function fp(e){return fp="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},fp(e)}function hp(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,dp(r.key),r)}}function dp(e){var t=function(e,t){if("object"!=fp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fp(t)?t:t+""}function yp(e,t,n){return t=bp(t),function(e,t){if(t&&("object"===fp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mp()?Reflect.construct(t,n||[],bp(e).constructor):t.apply(e,n))}function mp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mp=function(){return!!e})()}function bp(e){return bp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bp(e)}function vp(e,t){return vp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vp(e,t)}var gp=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=yp(this,t,[e])).handleChange=n.handleChange.bind(n),n.getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vp(e,t)}(t,e),n=t,(r=[{key:"handleChange",value:function(){this.props.onChange&&this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"setValue",value:function(e){this.refs.select.value=e}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),u().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group no-help".concat(this.props.isInline?" form-inline":"");return u().createElement("div",{className:t},this.props.label&&u().createElement("label",{className:"static"},this.props.label),u().createElement("select",{ref:"select",defaultValue:this.props.value,onChange:this.handleChange},e),this.props.children)}}])&&hp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);gp.propTypes={label:d().string,isInline:d().bool,options:d().array.isRequired,onChange:d().func,value:d().oneOfType([d().string,d().number])},gp.defaultProps={isInline:!1};const wp=gp;function Ep(e){return Ep="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},Ep(e)}function Sp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Op(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,Pp(r.key),r)}}function _p(e,t,n){return t&&Op(e.prototype,t),n&&Op(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pp(e){var t=function(e,t){if("object"!=Ep(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ep(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ep(t)?t:t+""}function kp(e,t,n){return t=Cp(t),function(e,t){if(t&&("object"===Ep(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jp()?Reflect.construct(t,n||[],Cp(e).constructor):t.apply(e,n))}function jp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(jp=function(){return!!e})()}function Cp(e){return Cp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cp(e)}function Tp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xp(e,t)}function xp(e,t){return xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xp(e,t)}var Dp=function(e){function t(e){var n;return Sp(this,t),(n=kp(this,t,[e])).setup=n.setup.bind(n),n.handleEditClick=n.handleEditClick.bind(n),n.handleEditCancel=n.handleEditCancel.bind(n),n.handleEditComplete=n.handleEditComplete.bind(n),n.handleSpamClick=n.handleSpamClick.bind(n),n.handleSpamCancel=n.handleSpamCancel.bind(n),n.handleSpamComplete=n.handleSpamComplete.bind(n),n.state={showPanel:!1,showEdit:!1,showSpam:!1},n}return Tp(t,e),_p(t,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0,showSpam:!1})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"handleSpamClick",value:function(){this.setState({showEdit:!1,showSpam:!0})}},{key:"handleSpamCancel",value:function(){this.setState({showSpam:!1})}},{key:"handleSpamComplete",value:function(){this.setState({showSpam:!1})}},{key:"render",value:function(){return this.state.showPanel?u().createElement("div",{className:"topic-editor clearfix"},u().createElement("ul",{className:"list-inline"},u().createElement("li",null,u().createElement("button",{type:"button",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Topic")),u().createElement("li",null,u().createElement("button",{type:"button",onClick:this.handleSpamClick,disabled:this.state.showSpam},"Mark As Spam - Close Topic and Lock Creator's Account")),this.props.topic.viewer.eMessage&&u().createElement("li",{className:"emessage"},this.props.topic.viewer.eMessage)),this.state.showEdit&&u().createElement(Rp,{topic:this.props.topic,onCancel:this.handleEditCancel,onComplete:this.handleEditComplete}),this.state.showSpam&&u().createElement(Np,{topic:this.props.topic,onCancel:this.handleSpamCancel,onComplete:this.handleSpamComplete})):null}}])}(u().Component),Np=it(function(e){function t(e){var n;return Sp(this,t),(n=kp(this,t,[e])).handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n}return Tp(t,e),_p(t,[{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/spam-topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("div",{className:"report clearfix"},u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement("h4",null,"Warning! Only Use For SPAM!"),u().createElement("p",null,"Are You sure this is SPAM?  Click 'Submit' to CLOSE the topic and LOCK the submitters account."))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}])}(u().Component)),Rp=it(function(e){function t(e){var n;return Sp(this,t),(n=kp(this,t,[e])).setup=n.setup.bind(n),n.handleRootForumChange=n.handleRootForumChange.bind(n),n.handleStickyChange=n.handleStickyChange.bind(n),n.handleForumChange=n.handleForumChange.bind(n),n.handlePlaceholderChange=n.handlePlaceholderChange.bind(n),n.handleStatusChange=n.handleStatusChange.bind(n),n.handleClosePostsChange=n.handleClosePostsChange.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.state={form:null,currentForumID:null},n}return Tp(t,e),_p(t,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic?id="+this.props.topic.topicID).done((function(t,n,r){e.setState({form:t,currentForumID:t.forumID})}))}},{key:"handleRootForumChange",value:function(e){var t=this;$.getJSON("/api/forum/e/forum-list?id="+e).done((function(n,r,o){var i=t.state.form;i.rootID=e,i.forumOptions=n,t.setState({form:i},(function(){var e=t.refs.forum.getValue(),n=t.state.form;e!=n.forumID&&(n.forumID=e,t.setState({form:n}))}))}))}},{key:"handleStickyChange",value:function(e){var t=this.state.form;t.stickyFL=!t.stickyFL,this.setState({form:t})}},{key:"handleForumChange",value:function(e){var t=this.state.form;e!=t.forumID&&(t.forumID=e,this.setState({form:t}))}},{key:"handlePlaceholderChange",value:function(e){if(this.state.form.forumID!=this.state.currentForumID){var t=this.state.form;t.leaveMovedPlaceholderFL=!t.leaveMovedPlaceholderFL,this.setState({form:t})}}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleClosePostsChange",value:function(e){if("200"==this.state.form.status){var t=this.state.form;t.closePostsFL=!t.closePostsFL,this.setState({form:t})}}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.state.form}),dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return null===this.state.form?null:u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"stickyFL",name:"stickyFL",checked:this.state.form.stickyFL,onChange:this.handleStickyChange}),u().createElement("label",{htmlFor:"stickyFL"},"Sticky Topic")))),u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-lg-12"},u().createElement(wp,{label:"Topic Status",options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"closePostsFL",name:"closePostsFL",checked:this.state.form.closePostsFL,disabled:"200"!=this.state.form.status,onChange:this.handleClosePostsChange}),u().createElement("label",{htmlFor:"closePostsFL"},"Close all posts in topic"))))),u().createElement("div",{className:"row panel"},u().createElement("div",{className:"col-md-6"},u().createElement("h3",null,"Move Topic"),u().createElement(wp,{label:"Root",options:this.state.form.rootForumOptions,value:this.state.form.rootID,onChange:this.handleRootForumChange})),u().createElement("div",{className:"col-md-6"},u().createElement("h3",null," "),u().createElement(wp,{ref:"forum",label:"Forum",options:this.state.form.forumOptions,value:this.state.form.forumID,onChange:this.handleForumChange},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"leaveMovedPlaceholderFL",name:"leaveMovedPlaceholderFL",checked:this.state.form.leaveMovedPlaceholderFL,disabled:this.state.form.forumID==this.state.currentForumID,onChange:this.handlePlaceholderChange}),u().createElement("label",{htmlFor:"leaveMovedPlaceholderFL"},"Leave moved topic placeholder"))))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}])}(u().Component));const Mp=Dp;function Ip(e){return Ip="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},Ip(e)}function Ap(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,Lp(r.key),r)}}function Lp(e){var t=function(e,t){if("object"!=Ip(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ip(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ip(t)?t:t+""}function Bp(e,t,n){return t=Up(t),function(e,t){if(t&&("object"===Ip(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fp()?Reflect.construct(t,n||[],Up(e).constructor):t.apply(e,n))}function Fp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fp=function(){return!!e})()}function Up(e){return Up=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Up(e)}function qp(e,t){return qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qp(e,t)}var Kp=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bp(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qp(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r="profile".concat(t).concat(n),o=e.join(", ");return u().createElement("a",{href:this.props.profile.url,className:r,title:o},u().createElement("span",{className:"profile-name"},this.props.profile.name),u().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}))}}])&&Ap(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Kp.propTypes={profile:d().object.isRequired};const Vp=Kp;function zp(e){return zp="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},zp(e)}function Wp(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,Hp(r.key),r)}}function Hp(e){var t=function(e,t){if("object"!=zp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=zp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zp(t)?t:t+""}function $p(e,t,n){return t=Jp(t),function(e,t){if(t&&("object"===zp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gp()?Reflect.construct(t,n||[],Jp(e).constructor):t.apply(e,n))}function Gp(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gp=function(){return!!e})()}function Jp(e){return Jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jp(e)}function Qp(e,t){return Qp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qp(e,t)}var Yp=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=$p(this,t,[e])).onClick=n.onClick.bind(n),n.state={post:n.props.post,viewer:n.props.viewer},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qp(e,t)}(t,e),n=t,(r=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/signal",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:"Post",id:this.props.id,value:this.state.viewer?null:1}),dataType:"json",context:this}).then((function(e){this.setState({viewer:e.value,post:e.result})}))}},{key:"render",value:function(){var e="btn-link user-action like".concat(null!==this.state.viewer?" active":""),t=(this.state.post>0?"+":"")+this.state.post;return this.props.allowRating?u().createElement("div",{className:"rating"},u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"),u().createElement("span",null,t)):u().createElement("div",{className:"rating metrics dark"},u().createElement("span",{className:"like"},t))}}])&&Wp(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Yp.propTypes={id:d().number.isRequired,post:d().number,viewer:d().number,allowRating:d().bool},Yp.defaultProps={post:0,viewer:null,allowRating:!1};const Xp=Yp;function Zp(e){return Zp="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},Zp(e)}function ef(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,tf(r.key),r)}}function tf(e){var t=function(e,t){if("object"!=Zp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Zp(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zp(t)?t:t+""}function nf(e,t,n){return t=of(t),function(e,t){if(t&&("object"===Zp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rf()?Reflect.construct(t,n||[],of(e).constructor):t.apply(e,n))}function rf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rf=function(){return!!e})()}function of(e){return of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},of(e)}function af(e,t){return af=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},af(e,t)}const sf=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),nf(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&af(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",null,u().createElement("p",{dangerouslySetInnerHTML:vn.createMarkup(this.props.report.comment)}),u().createElement("div",null,u().createElement("span",null,this.props.report.reportType),u().createElement("span",null,this.props.report.product),u().createElement("span",null,this.props.report.addedBy),u().createElement("span",null,this.props.report.addedDT)))}}])&&ef(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function cf(e){return cf="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},cf(e)}function lf(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,uf(r.key),r)}}function uf(e){var t=function(e,t){if("object"!=cf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cf(t)?t:t+""}function pf(e,t,n){return t=hf(t),function(e,t){if(t&&("object"===cf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ff()?Reflect.construct(t,n||[],hf(e).constructor):t.apply(e,n))}function ff(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ff=function(){return!!e})()}function hf(e){return hf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hf(e)}function df(e,t){return df=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},df(e,t)}const yf=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),pf(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&df(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return null==this.props.reports?null:u().createElement("div",{className:"post-reports"},this.props.reports.map((function(e,t){return u().createElement(sf,{key:t,report:e})})))}}])&&lf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function mf(e){return mf="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},mf(e)}function bf(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,vf(r.key),r)}}function vf(e){var t=function(e,t){if("object"!=mf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mf(t)?t:t+""}function gf(e,t,n){return t=Ef(t),function(e,t){if(t&&("object"===mf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wf()?Reflect.construct(t,n||[],Ef(e).constructor):t.apply(e,n))}function wf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wf=function(){return!!e})()}function Ef(e){return Ef=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ef(e)}function Sf(e,t){return Sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sf(e,t)}const Of=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=gf(this,t,[e])).handleSubmit=n.handleSubmit.bind(n),n.handleChange=n.handleChange.bind(n),n.state={type:null,submitDisabled:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sf(e,t)}(t,e),n=t,(r=[{key:"handleSubmit",value:function(){var e={postID:this.props.postID,type:this.refs.type.value,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message),e.forceRefresh&&this.props.history.push(e.refreshUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handleChange",value:function(){this.setState({type:this.refs.type.value,submitDisabled:"2"==this.refs.type.value&&this.refs.report.value.length<3})}},{key:"render",value:function(){var e=null;return"2"==this.state.type&&(e=u().createElement(sa,{message:'Reason required for "other" reports'})),u().createElement("div",{className:"post-report report clearfix"},u().createElement("h4",null,"THIS FORM IS FOR REPORTING BAD POSTS, COMMENTS AND SPAM TO THE MODERATORS!"),u().createElement("p",null,'Please use the "REPLY" button to add a new post to a topic.'),u().createElement("p",null,"Examples for using this reporting feature would be if the post contains foul or offensive language, spam, or abusive language towards another forum member."),u().createElement("p",null,"We try to monitor all of the topics & posts in our forum, but sometimes something can slip through that may offend someone."),u().createElement("p",null,"Thank you for your help."),u().createElement("div",{className:"form-group"},u().createElement("label",{className:"static"},"Report Type"),u().createElement("select",{name:"type",ref:"type",onChange:this.handleChange,className:"form-control"},u().createElement("option",{value:"Spam"},"Spam"),u().createElement("option",{value:"Other"},"Other"))),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Reason For Reporting"),u().createElement("textarea",{name:"report",ref:"report",onChange:this.handleChange,className:"form-control"}),e),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit")))}}])&&bf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function _f(e){return _f="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},_f(e)}function Pf(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,kf(r.key),r)}}function kf(e){var t=function(e,t){if("object"!=_f(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=_f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_f(t)?t:t+""}function jf(e,t,n){return t=Tf(t),function(e,t){if(t&&("object"===_f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Cf()?Reflect.construct(t,n||[],Tf(e).constructor):t.apply(e,n))}function Cf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Cf=function(){return!!e})()}function Tf(e){return Tf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tf(e)}function xf(e,t){return xf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xf(e,t)}const Df=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=jf(this,t,[e])).handleReport=n.handleReport.bind(n),n.handleReportClose=n.handleReportClose.bind(n),n.state={showReport:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xf(e,t)}(t,e),n=t,(r=[{key:"handleReport",value:function(e){this.setState({showReport:!0})}},{key:"handleReportClose",value:function(e){this.setState({showReport:!1})}},{key:"render",value:function(){return u().createElement("span",null,u().createElement("button",{type:"button",className:"btn-link",onClick:this.handleReport},"Report"),this.state.showReport&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},u().createElement(Of,{postID:this.props.postID,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&Pf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Nf(e){return Nf="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},Nf(e)}function Rf(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,Mf(r.key),r)}}function Mf(e){var t=function(e,t){if("object"!=Nf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Nf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nf(t)?t:t+""}function If(e,t,n){return t=Lf(t),function(e,t){if(t&&("object"===Nf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Af()?Reflect.construct(t,n||[],Lf(e).constructor):t.apply(e,n))}function Af(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Af=function(){return!!e})()}function Lf(e){return Lf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Lf(e)}function Bf(e,t){return Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bf(e,t)}const Ff=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=If(this,t,[e])).setup=n.setup.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handlePostChange=n.handlePostChange.bind(n),n.handleReportChange=n.handleReportChange.bind(n),n.state={post:null,isValid:!0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bf(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/post/edit/?id=".concat(this.props.post.postID)).done((function(t,n,r){e.setState({post:t.data.form.post})})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"handleSubmit",value:function(){var e={postID:this.props.post.postID,type:this.props.link.type,product:"Developer"==this.props.link.type?this.props.link.value:null,post:this.state.post,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/internal-report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handlePostChange",value:function(e){this.setState({post:e.target.value})}},{key:"handleReportChange",value:function(){}},{key:"render",value:function(){if(null==this.state.post)return null;var e=null;this.state.isValid||(e=u().createElement(sa,{message:"post required"}));var t="".concat(this.props.link.value," Report");return"Support"==this.props.link.type&&(t="Support Escalation"),u().createElement("div",{className:"post-report report clearfix"},u().createElement("h4",null,t),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Post text to be included in report email"),u().createElement("textarea",{name:"post",ref:"post",value:this.state.post,onChange:this.handlePostChange,className:"form-control",rows:"8"}),e),u().createElement("div",{className:"form-group multiline-text"},u().createElement("label",{className:"static"},"Reason For Reporting (Optional)"),u().createElement("textarea",{name:"report",ref:"report",onChange:this.handleReportChange,className:"form-control"})),u().createElement("div",{className:"buttons pull-right"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit")))}}])&&Rf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Uf(e){return Uf="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},Uf(e)}function qf(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,Kf(r.key),r)}}function Kf(e){var t=function(e,t){if("object"!=Uf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Uf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Uf(t)?t:t+""}function Vf(e,t,n){return t=Wf(t),function(e,t){if(t&&("object"===Uf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zf()?Reflect.construct(t,n||[],Wf(e).constructor):t.apply(e,n))}function zf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zf=function(){return!!e})()}function Wf(e){return Wf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wf(e)}function Hf(e,t){return Hf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hf(e,t)}const $f=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Vf(this,t,[e])).handleReportClick=n.handleReportClick.bind(n),n.handleReportClose=n.handleReportClose.bind(n),n.link=null,n.state={showReport:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hf(e,t)}(t,e),n=t,(r=[{key:"handleReportClick",value:function(e){this.link=e,this.setState({showReport:!0})}},{key:"handleReportClose",value:function(){this.setState({showReport:!1})}},{key:"render",value:function(){var e=this,t=[];return this.props.links.forEach((function(n,r){var o="Add To ".concat(n.value," Report");"Support"===n.type&&(o="Create ".concat(n.value," Ticket")),t.push(u().createElement("button",{type:"button",onClick:e.handleReportClick.bind(null,n)},o))})),u().createElement("span",null,u().createElement(ko,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:"Internal Report",options:t}),this.state.showReport&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},u().createElement(Ff,{post:this.props.post,link:this.link,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&qf(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Gf(e){return Gf="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},Gf(e)}function Jf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qf(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,Xf(r.key),r)}}function Yf(e,t,n){return t&&Qf(e.prototype,t),n&&Qf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xf(e){var t=function(e,t){if("object"!=Gf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Gf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gf(t)?t:t+""}function Zf(e,t,n){return t=th(t),function(e,t){if(t&&("object"===Gf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,eh()?Reflect.construct(t,n||[],th(e).constructor):t.apply(e,n))}function eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(eh=function(){return!!e})()}function th(e){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},th(e)}function nh(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rh(e,t)}function rh(e,t){return rh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rh(e,t)}var oh=function(e){function t(e){var n;return Jf(this,t),(n=Zf(this,t,[e])).filterContent=n.filterContent.bind(n),n}return nh(t,e),Yf(t,[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n){t.push(u().createElement("li",{key:n.id,className:"view"},u().createElement(ih,{content:n,postID:e.props.postID})))})),o.forEach((function(t){n.push(u().createElement("li",{key:t.id,className:"dl"},u().createElement(ah,{content:t,postID:e.props.postID})))})),u().createElement("ul",{className:"content-list clearfix"},t,n)}}])}(u().Component);oh.propTypes={content:d().array,postID:d().number};var ih=it(function(e){function t(){return Jf(this,t),Zf(this,t,arguments)}return nh(t,e),Yf(t,[{key:"render",value:function(){var e={pathname:"/discuss/post/".concat(this.props.postID,"/content/").concat(this.props.content.id),state:{modal:!0,background:this.props.location}},t="".concat(this.props.content.type," ").concat(null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""," : ").concat(this.props.content.title);return u().createElement("div",{className:"content-view"},u().createElement(ft,{to:e,title:t,className:"link"},u().createElement("img",{src:this.props.content.thumbUrl})),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title)))}}])}(u().Component)),ah=function(e){function t(){return Jf(this,t),Zf(this,t,arguments)}return nh(t,e),Yf(t,[{key:"render",value:function(){var e="/forum/post/".concat(this.props.postID,"/content/").concat(this.props.content.id,"/download"),t="".concat(this.props.content.type," : ").concat(this.props.content.title),n="Generic"!=this.props.content.type?u().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return u().createElement("div",{className:"content-dl"},u().createElement("a",{href:e,title:t,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title),n))}}])}(u().Component);const sh=oh;function ch(e){return ch="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},ch(e)}function lh(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,uh(r.key),r)}}function uh(e){var t=function(e,t){if("object"!=ch(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ch(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ch(t)?t:t+""}function ph(e,t,n){return t=hh(t),function(e,t){if(t&&("object"===ch(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fh()?Reflect.construct(t,n||[],hh(e).constructor):t.apply(e,n))}function fh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fh=function(){return!!e})()}function hh(e){return hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hh(e)}function dh(e,t){return dh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dh(e,t)}var yh=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ph(this,t,[e])).handleReply=n.handleReply.bind(n),n.handleQuote=n.handleQuote.bind(n),n.handleEdit=n.handleEdit.bind(n),n.DisplayModes={Topic:"topic",Single:"single"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dh(e,t)}(t,e),n=t,(r=[{key:"handleReply",value:function(){this.props.onReply&&this.props.onReply(this.props.post.postID)}},{key:"handleQuote",value:function(){this.props.onQuote&&this.props.onQuote(this.props.post.postID)}},{key:"handleEdit",value:function(){this.props.onEdit&&this.props.onEdit(this.props.post.postID)}},{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply"+this.props.depth:"",n=!0===e.show.opHighlight?" op-highlight":"",r="comment".concat(t).concat(n," clearfix"),o=this.props.viewer.internalReportLinks&&u().createElement($f,{links:this.props.viewer.internalReportLinks,post:e});return u().createElement("article",{className:r},u().createElement("a",{className:"post-anchor",name:e.postID}),!0===e.show.newPostAnchor&&u().createElement("a",{name:"NewPost"}),u().createElement("div",{className:"comment-header clearfix"},u().createElement("div",null,e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&u().createElement(ki,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&u().createElement("div",{className:"profile"},e.addedBy.guestName)),u().createElement("div",null,u().createElement("div",{className:"report-links"},o,this.props.viewer.isSignedIn&&u().createElement(Df,{postID:e.postID}),this.props.displayMode==this.DisplayModes.Topic&&u().createElement("span",null,u().createElement(ft,{to:e.url},"Permalink"))),u().createElement(Xp,{id:e.postID,post:e.rating,viewer:e.viewer.postRating,allowRating:e.viewer.showRating}))),u().createElement("div",{className:"comment-body clearfix"},u().createElement("div",{className:"comment-profile"},e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&u().createElement(Vp,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&u().createElement("div",{className:"profile"},e.addedBy.guestName),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.location&&u().createElement("div",null,e.addedBy.profile.location),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.joinedDT&&u().createElement("div",null,u().createElement("span",null,"Joined")," ",e.addedBy.profile.joinedDT),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.postCount&&u().createElement("div",null,e.addedBy.profile.postCount," ",u().createElement("span",null,e.addedBy.profile.postCount>1?"Posts":"Post"))),u().createElement("div",{className:"comment-body-container clearfix"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),null!=e.content&&e.content.length>0&&u().createElement(sh,{content:e.content,postID:e.postID}),u().createElement("div",{className:"comment-body-footer"},e.addedBy&&e.addedBy.profile&&!0===e.addedBy.profile.showSignatureFL&&""!=e.addedBy.profile.signature&&u().createElement("span",{className:"signature",dangerouslySetInnerHTML:{__html:e.addedBy.profile.signature}}),!0===e.editedFL&&e.modifiedBy&&e.modifiedBy.profile&&u().createElement("span",{className:"edited"},"edited by: ",e.modifiedBy.profile.name)),u().createElement(yf,{reports:e.reports}))),u().createElement("div",{className:"comment-footer clearfix"},u().createElement("div",{className:"comment-info"},u().createElement("time",null,e.addedBy.displayDT)),u().createElement("div",{className:"comment-actions-container"},this.props.displayMode==this.DisplayModes.Topic&&this.props.showEditControls&&u().createElement("div",{className:"comment-actions"},u().createElement("button",{type:"button",className:"icon icon-after icon-reply",onClick:this.handleReply},"Reply"),this.props.displayMode==this.DisplayModes.Topic&&u().createElement("button",{type:"button",className:"icon icon-after icon-quote",onClick:this.handleQuote},"Quote"),e.viewer.canEdit&&u().createElement("button",{type:"button",className:"icon icon-after icon-refresh",onClick:this.handleEdit},"Edit")))))}}])&&lh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);yh.propTypes={displayMode:d().string,post:d().object,depth:d().number,viewer:d().object,onReply:d().func,onQuote:d().func,onEdit:d().func,showEditControls:d().bool},yh.defaultProps={displayMode:"topic",depth:null,showEditControls:!1};const mh=yh;function bh(e){return bh="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},bh(e)}function vh(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,gh(r.key),r)}}function gh(e){var t=function(e,t){if("object"!=bh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=bh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bh(t)?t:t+""}function wh(e,t,n){return t=Sh(t),function(e,t){if(t&&("object"===bh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Eh()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function Eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Eh=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sh(e)}function Oh(e,t){return Oh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oh(e,t)}var _h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wh(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oh(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply".concat(this.props.depth):"",n="comment anonymized ".concat(t," clearfix");return u().createElement("article",{className:n},u().createElement("a",{name:e.postID}),!0===e.show.newPostAnchor&&u().createElement("a",{name:"NewPost"}),u().createElement("div",{className:"comment-header clearfix"},u().createElement("div",null)),u().createElement("div",{className:"comment-body clearfix"},u().createElement("div",{className:"comment-profile"}),u().createElement("div",{className:"comment-body-container clearfix"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}))))}}])&&vh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);_h.propTypes={post:d().object,depth:d().number},_h.defaultProps={depth:null};const Ph=_h;function kh(e){return kh="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},kh(e)}function jh(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,Ch(r.key),r)}}function Ch(e){var t=function(e,t){if("object"!=kh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=kh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kh(t)?t:t+""}function Th(e,t,n){return t=Dh(t),function(e,t){if(t&&("object"===kh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xh()?Reflect.construct(t,n||[],Dh(e).constructor):t.apply(e,n))}function xh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xh=function(){return!!e})()}function Dh(e){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dh(e)}function Nh(e,t){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nh(e,t)}var Rh=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Th(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nh(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(null==this.props.percentComplete||0==this.props.percentComplete)return null;var e={width:this.props.percentComplete+"%"};return u().createElement("div",{className:"progress progress-small"},u().createElement("div",{className:"progress-bar",style:e}))}}])&&jh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Rh.propTypes={percentComplete:d().number.isRequired};const Mh=Rh;function Ih(e){return Ih="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},Ih(e)}function Ah(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,Lh(r.key),r)}}function Lh(e){var t=function(e,t){if("object"!=Ih(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ih(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ih(t)?t:t+""}function Bh(e,t,n){return t=Uh(t),function(e,t){if(t&&("object"===Ih(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fh()?Reflect.construct(t,n||[],Uh(e).constructor):t.apply(e,n))}function Fh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fh=function(){return!!e})()}function Uh(e){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uh(e)}function qh(e,t){return qh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qh(e,t)}const Kh=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bh(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qh(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t=this.props.data;return"Uploading"!=t.status&&(e=t.message),u().createElement("li",null,u().createElement("span",null,t.name+t.extension),e,"Uploading"==t.status?u().createElement(Mh,{percentComplete:t.percentComplete}):null)}}])&&Ah(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Vh(e){return Vh="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},Vh(e)}function zh(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,Wh(r.key),r)}}function Wh(e){var t=function(e,t){if("object"!=Vh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Vh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vh(t)?t:t+""}function Hh(e,t,n){return t=Gh(t),function(e,t){if(t&&("object"===Vh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$h()?Reflect.construct(t,n||[],Gh(e).constructor):t.apply(e,n))}function $h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($h=function(){return!!e})()}function Gh(e){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gh(e)}function Jh(e,t){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jh(e,t)}const Qh=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hh(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jh(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(0==this.props.uploads.length)return null;var e=this,t=[];return this.props.uploads.forEach((function(n){t.push(u().createElement(Kh,{key:n.key,data:n,onUploadDelete:e.props.onUploadDelete}))})),u().createElement("ul",{className:"upload-list"},t)}}])&&zh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Yh(e){return Yh="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},Yh(e)}function Xh(){return Xh=Object.assign?Object.assign.bind():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},Xh.apply(this,arguments)}function Zh(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,ed(r.key),r)}}function ed(e){var t=function(e,t){if("object"!=Yh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Yh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Yh(t)?t:t+""}function td(e,t,n){return t=rd(t),function(e,t){if(t&&("object"===Yh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nd()?Reflect.construct(t,n||[],rd(e).constructor):t.apply(e,n))}function nd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nd=function(){return!!e})()}function rd(e){return rd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rd(e)}function od(e,t){return od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},od(e,t)}var id=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=td(this,t,[e])).onDragEnter=n.onDragEnter.bind(n),n.onDragOver=n.onDragOver.bind(n),n.onDragLeave=n.onDragLeave.bind(n),n.onDrop=n.onDrop.bind(n),n.open=n.open.bind(n),n.supportMultiple="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input"),n.state={isDragActive:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&od(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.enterCounter=0}},{key:"onDragEnter",value:function(e){e.preventDefault(),++this.enterCounter;var t=e.dataTransfer&&e.dataTransfer.items?e.dataTransfer.items:[],n=Array.prototype.slice.call(t);this.setState({isDragActive:n})}},{key:"onDragOver",value:function(e){return e.preventDefault(),e.stopPropagation(),!1}},{key:"onDragLeave",value:function(e){e.preventDefault(),--this.enterCounter>0||this.setState({isDragActive:!1})}},{key:"onDrop",value:function(e){e.preventDefault(),this.enterCounter=0,this.setState({isDragActive:!1});for(var t=e.dataTransfer?e.dataTransfer.files:e.target.files,n=this.props.multiple?t.length:1,r=[],o=0;o<n;o++){var i=t[o];r.push(i)}this.props.onDrop&&this.props.onDrop.call(this,r,e)}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this,t={onClick:this.open,onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},n={type:"file",style:{display:"none"},multiple:this.supportMultiple&&this.props.multiple,ref:function(t){return e.fileInputEl=t},onChange:this.onDrop},r=null!=this.props.children?this.props.children:u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload");return u().createElement("div",Xh({className:"drop-area"+(this.state.isDragActive?" drop-area-active":"")},t,{style:{textAlign:"center"}}),r,u().createElement(Qh,{uploads:this.props.uploads}),u().createElement("input",n))}}])&&Zh(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);id.defaultProps={multiple:!0};const ad=id;function sd(e){return sd="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},sd(e)}function cd(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,ld(r.key),r)}}function ld(e){var t=function(e,t){if("object"!=sd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sd(t)?t:t+""}function ud(e,t,n){return t=fd(t),function(e,t){if(t&&("object"===sd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pd()?Reflect.construct(t,n||[],fd(e).constructor):t.apply(e,n))}function pd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pd=function(){return!!e})()}function fd(e){return fd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fd(e)}function hd(e,t){return hd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hd(e,t)}var dd=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ud(this,t,[e])).onChange=n.onChange.bind(n),n.onSubmit=n.onSubmit.bind(n),n.clearInput=n.clearInput.bind(n),n._validateUrl=n._validateUrl.bind(n),n.state={isValidUrl:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hd(e,t)}(t,e),n=t,(r=[{key:"onChange",value:function(e){e.preventDefault();var t=this.refs.url.value,n=this._validateUrl(t);this.setState({isValidUrl:n})}},{key:"onSubmit",value:function(e){e.preventDefault();var t=this.refs.url.value;$.ajax({type:"POST",url:"/staging/hosted",contentType:"application/json; charset=utf-8",data:JSON.stringify({url:t,groupsAllowed:this.props.groupsAllowed}),dataType:"json",context:this}).then((function(e){this.props.onRegister(e.uploads,e.resources,e.content),this.clearInput}))}},{key:"clearInput",value:function(){this.refs.url.value=""}},{key:"_validateUrl",value:function(e){var t=e.toLowerCase();return t.includes("youtube.com")?/youtube\.com\/watch\?v=([a-zA-Z0-9-_]+)/.test(e):t.includes("youtu.be")?/youtu\.be\/([a-zA-Z0-9-_]+)/.test(e):t.includes("vimeo.com")?/vimeo\.com\/([0-9]+)(?:\/([a-f0-9]+))?(?:\?.+)?/.test(e):!!t.includes("sketchfab.com")&&/sketchfab\.com\/models\/([a-zA-Z0-9]+)(?:\?.+?)?/.test(e)}},{key:"render",value:function(){return u().createElement("div",{className:"form-group staging-hosted-content"},u().createElement("h4",null,"Embedding a YouTube or Vimeo video?"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&cd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);dd.propTypes={onRegister:d().func.isRequired};const yd=dd;function md(e){return md="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},md(e)}function bd(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,vd(r.key),r)}}function vd(e){var t=function(e,t){if("object"!=md(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=md(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==md(t)?t:t+""}function gd(e,t,n){return t=Ed(t),function(e,t){if(t&&("object"===md(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wd()?Reflect.construct(t,n||[],Ed(e).constructor):t.apply(e,n))}function wd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wd=function(){return!!e})()}function Ed(e){return Ed=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ed(e)}function Sd(e,t){return Sd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sd(e,t)}var Od=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=gd(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n.onChange=n.onChange.bind(n),n.state={value:null!=n.props.value?n.props.value.toString():"",isValid:!0,showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sd(e,t)}(t,e),n=t,(r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.refs.select.value&&""!=this.refs.select.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),u().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group".concat(null==this.props.label?" no-label":"").concat(this.props.isInline?" form-inline":"");!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?n=u().createElement(sa,{message:this.props.helpMessage}):t+=" no-help":n=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:t},this.props.label&&u().createElement("label",{className:"static"},this.props.label),u().createElement("select",{ref:"select",disabled:this.props.disabled,value:this.state.value,onChange:this.onChange},e),n)}}])&&bd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Od.propTypes={options:d().array.isRequired,value:d().oneOfType([d().string,d().number]),label:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,isInline:d().bool,disabled:d().bool,onChange:d().func},Od.defaultProps={label:null,required:!1,requiredErrorMessage:"input required.",isInline:!1};const _d=Od;function Pd(e){return Pd="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},Pd(e)}function kd(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,jd(r.key),r)}}function jd(e){var t=function(e,t){if("object"!=Pd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Pd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pd(t)?t:t+""}function Cd(e,t,n){return t=xd(t),function(e,t){if(t&&("object"===Pd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Td()?Reflect.construct(t,n||[],xd(e).constructor):t.apply(e,n))}function Td(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Td=function(){return!!e})()}function xd(e){return xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xd(e)}function Dd(e,t){return Dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dd(e,t)}const Nd=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Cd(this,t,[e])).setup=n.setup.bind(n),n.onSubmit=n.onSubmit.bind(n),n.onChange=n.onChange.bind(n),n.onContentTypeChange=n.onContentTypeChange.bind(n),n.onResourceFormatChange=n.onResourceFormatChange.bind(n),n.form={url:"",contentType:"",resourceFormat:""},n.state={setupForm:null,isValidUrl:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dd(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){null==this.setupForm&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/staging/hostedfile").done((function(t,n,r){e.form.contentType=t.contentType,e.form.resourceFormat=t.resourceFormat,e.setState({setupForm:t})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onSubmit",value:function(){this.form.url=this.refs.url.value,$.ajax({type:"POST",url:"/staging/hostedfile",data:this.form,context:this}).done((function(e,t,n){this.props.onRegister(null,e.resources,e.content),this.refs.url.value=""})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){}))}},{key:"onChange",value:function(e){var t=this.refs.url.value;this.setState({isValidUrl:t.startsWith("http://")||t.startsWith("https://")})}},{key:"onContentTypeChange",value:function(e){this.form.contentType=e}},{key:"onResourceFormatChange",value:function(e){this.form.resourceFormat=e}},{key:"render",value:function(){return null==this.state.setupForm?null:u().createElement("div",{className:"form-group staging-hosted-file clearfix"},u().createElement("h4",null,"Attaching a file that's hosted on another server?"),u().createElement("div",{className:"input-group type-and-formats"},u().createElement(_d,{ref:"contentType",label:"Content Type",value:this.state.setupForm.contentType,options:this.state.setupForm.contentTypeOptions,required:!0,requiredErrorMessage:"Content Type Required",onChange:this.onContentTypeChange}),u().createElement(_d,{ref:"resourceFormat",label:"Format",value:this.state.setupForm.resourceFormat,options:this.state.setupForm.resourceFormatOptions,required:!0,requiredErrorMessage:"Resource Format Required",onChange:this.onResourceFormatChange})),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),u().createElement("span",{className:"input-group-btn"},u().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&kd(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Rd(e){return Rd="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},Rd(e)}function Md(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Id(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,Ld(r.key),r)}}function Ad(e,t,n){return t&&Id(e.prototype,t),n&&Id(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ld(e){var t=function(e,t){if("object"!=Rd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Rd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rd(t)?t:t+""}function Bd(e,t,n){return t=Ud(t),function(e,t){if(t&&("object"===Rd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fd()?Reflect.construct(t,n||[],Ud(e).constructor):t.apply(e,n))}function Fd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fd=function(){return!!e})()}function Ud(e){return Ud=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ud(e)}function qd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kd(e,t)}function Kd(e,t){return Kd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kd(e,t)}var Vd=function(e){function t(e){var n;return Md(this,t),(n=Bd(this,t,[e])).onNotificationClose=n.onNotificationClose.bind(n),n}return qd(t,e),Ad(t,[{key:"onNotificationClose",value:function(e,t){t.preventDefault(),this.props.onNotificationClose(e,t)}},{key:"render",value:function(){var e=[],t=this;return this.props.notifications.forEach((function(n,r){n.show&&e.push(u().createElement(zd,{key:r,data:n,onNotificationClose:t.onNotificationClose.bind(null,r)}))})),e.length>0?u().createElement("div",null,e):null}}])}(u().Component),zd=function(e){function t(){return Md(this,t),Bd(this,t,arguments)}return qd(t,e),Ad(t,[{key:"render",value:function(){var e=this.props.data,t=[];return 1==e.messages.length?t=u().createElement("p",null,e.messages[0]):e.messages.length>1&&(t=u().createElement("ul",null,e.messages.map((function(e,t){return u().createElement("li",{key:t},e)})))),u().createElement("div",{className:"alert alert-danger"},u().createElement("button",{type:"button",className:"close",onClick:this.props.onNotificationClose},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("strong",null,e.title),t)}}])}(u().Component);const Wd=Vd;function Hd(e){return Hd="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},Hd(e)}function $d(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,Gd(r.key),r)}}function Gd(e){var t=function(e,t){if("object"!=Hd(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Hd(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hd(t)?t:t+""}function Jd(e,t,n){return t=Yd(t),function(e,t){if(t&&("object"===Hd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qd()?Reflect.construct(t,n||[],Yd(e).constructor):t.apply(e,n))}function Qd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qd=function(){return!!e})()}function Yd(e){return Yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yd(e)}function Xd(e,t){return Xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xd(e,t)}const Zd=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jd(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xd(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.data,t=e.name;return"Missing"==e.status&&(t="Missing : "+e.path),u().createElement("div",{className:"staging-item staging-item-child"+(e.blocking.length>0?" attention":"")},u().createElement("div",{className:"tfmedia"},e.thumb?u().createElement("img",{src:e.thumb,className:"tfthumb"}):null,u().createElement("div",{className:"tfmedia-body"},u().createElement("h4",null,u().createElement("span",{className:"content-type-badge"},e.type),t))))}}])&&$d(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function ey(e){return ey="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},ey(e)}function ty(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,ny(r.key),r)}}function ny(e){var t=function(e,t){if("object"!=ey(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ey(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ey(t)?t:t+""}function ry(e,t,n){return t=iy(t),function(e,t){if(t&&("object"===ey(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oy()?Reflect.construct(t,n||[],iy(e).constructor):t.apply(e,n))}function oy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oy=function(){return!!e})()}function iy(e){return iy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iy(e)}function ay(e,t){return ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ay(e,t)}const sy=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ry(this,t,[e]))._handleChange=n._handleChange.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ay(e,t)}(t,e),n=t,(r=[{key:"_handleChange",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onChange(e.target.value)}},{key:"render",value:function(){return u().createElement("div",{className:"form-group"+(this.props.isRenameSuccess?" has-success":" has-error")},u().createElement("label",{className:"static"},"Rename Title"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",value:this.props.inputValue,onChange:this._handleChange}),u().createElement("span",{className:"input-group-addon"},this.props.extension)))}}])&&ty(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function cy(e){return cy="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},cy(e)}function ly(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,uy(r.key),r)}}function uy(e){var t=function(e,t){if("object"!=cy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cy(t)?t:t+""}function py(e,t,n){return t=hy(t),function(e,t){if(t&&("object"===cy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fy()?Reflect.construct(t,n||[],hy(e).constructor):t.apply(e,n))}function fy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fy=function(){return!!e})()}function hy(e){return hy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hy(e)}function dy(e,t){return dy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dy(e,t)}var yy=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=py(this,t,[e])).checkStatus=n.checkStatus.bind(n),n.onRenameChange=n.onRenameChange.bind(n),n.handleRename=n.handleRename.bind(n),n.handleTargetUsageChange=n.handleTargetUsageChange.bind(n),n.handleTargetUsageUpdate=n.handleTargetUsageUpdate.bind(n),n.handleDelete=n.handleDelete.bind(n),n.handleRegisterContent=n.handleRegisterContent.bind(n),n.niceOptionText=n.niceOptionText.bind(n),n.EditorStatus={Ready:"ready",ExternalReferences:"externalreferences",TargetUsage:"targetusage",Rename:"rename"},n.state={status:n.checkStatus(n.props.resource),renamedTitle:n.props.resource.nameWithoutExtension,isRenameSuccess:!1,targetUsage:null,isTargetUsageSuccess:!1,showOverlay:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dy(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.resource.blocking[0]==this.props.resource.blocking[0]&&e.resource.group.length==this.props.resource.group.length&&e.resource.status==this.props.resource.status||this.setState({status:this.checkStatus(e.resource)})}},{key:"checkStatus",value:function(e){return"ExternalReferences"==e.blocking[0]?this.EditorStatus.ExternalReferences:e.group.length>1?this.EditorStatus.TargetUsage:"Rename"==e.status?this.EditorStatus.Rename:this.EditorStatus.Ready}},{key:"onRenameChange",value:function(e){$.ajax({type:"GET",url:"/staging/checkrename",data:{itemID:this.props.resource.id,titlePart:encodeURIComponent(e)},context:this}).then((function(t){var n=!t.data;this.setState({renamedTitle:e,isRenameSuccess:n})}))}},{key:"handleRename",value:function(e,t,n){$.ajax({type:"POST",url:"/staging/rename",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,renamedTitle:encodeURIComponent(this.state.renamedTitle)}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleTargetUsageChange",value:function(e){var t=e.target.value,n=""!=e.target.value;this.setState({targetUsage:t,isTargetUsageSuccess:n})}},{key:"handleTargetUsageUpdate",value:function(e){$.ajax({type:"POST",url:"/staging/usage",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,targetUsage:this.state.targetUsage}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleDelete",value:function(e){$.ajax({type:"DELETE",url:"/staging",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleRegisterContent",value:function(e){var t=this;this.setState({showOverlay:!0},(function(){$.ajax({type:"POST",url:"/staging/register",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:t.props.resource.id}),dataType:"json",context:t}).then((function(e){var n=[];n.push(e.content),t.props.onResourceUpdate(e.resources,n)}))}))}},{key:"niceOptionText",value:function(e){var t=this.props.resource.type;switch(e){case"Asset":return"Downloadable File: Share file as download for use in applications outside of the browser";case"Portfolio":return"Display in Browser: Use for easy viewing of screen shots, rendered images, and videos directly in the browser.";case"Training":return"Display in Browser: Use for easy viewing of tutorials directly in the browser.";default:return e+" "+t}}},{key:"render",value:function(){if(!this.props.resource)return null;var e=this.props.resource,t=this.state.status==this.EditorStatus.TargetUsage&&!0===this.state.isTargetUsageSuccess,n=this.state.status==this.EditorStatus.Rename&&!0===this.state.isRenameSuccess,r=this.state.status==this.EditorStatus.Ready,o=this;return u().createElement("div",{className:"staging-item-edit clearfix"},this.state.status==this.EditorStatus.Rename&&u().createElement(sy,{onChange:this.onRenameChange,isRenameSuccess:this.state.isRenameSuccess,inputValue:this.state.renamedTitle,extension:e.extension}),this.state.status==this.EditorStatus.TargetUsage&&u().createElement("div",{className:"form-group"+(this.state.isTargetUsageSuccess?" has-success":" has-error")},this.state.isTargetUsageSuccess&&u().createElement("label",{className:"static"},"Link Content As:"),u().createElement("select",{className:"form-control",onChange:this.handleTargetUsageChange},u().createElement("option",{key:"-1",value:""},"Intended usage"),e.group.map((function(e,t){return u().createElement("option",{key:t,value:e},o.niceOptionText(e))})))),u().createElement("div",{className:"pull-right"},u().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete},"Delete"),this.state.status==this.EditorStatus.TargetUsage&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!t,onClick:this.handleTargetUsageUpdate},"Update"),this.state.status==this.EditorStatus.Rename&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!n,onClick:this.handleRename},"Rename"),this.state.status==this.EditorStatus.Ready&&u().createElement("button",{type:"button",className:"btn-primary",disabled:!r,onClick:this.handleRegisterContent},"Save Content")),!0===this.state.showOverlay&&u().createElement("div",{className:"overlay-waiting"},u().createElement("img",{src:"/common/img/assets/spinner.gif"})))}}])&&ly(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);yy.propTypes={resource:d().object,onResourceUpdate:d().func};const my=yy;function by(e){return by="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},by(e)}function vy(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,gy(r.key),r)}}function gy(e){var t=function(e,t){if("object"!=by(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=by(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==by(t)?t:t+""}function wy(e,t,n){return t=Sy(t),function(e,t){if(t&&("object"===by(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ey()?Reflect.construct(t,n||[],Sy(e).constructor):t.apply(e,n))}function Ey(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ey=function(){return!!e})()}function Sy(e){return Sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sy(e)}function Oy(e,t){return Oy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Oy(e,t)}var _y=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wy(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oy(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.resource,t=[];e.children.forEach((function(e){"Duplicate"!=e.status&&t.push(u().createElement(Zd,{key:e.id,data:e}))}));var n="staging-item";this.props.selected&&(n+=" selected"),("Ready"!=e.status||e.blocking.length>0)&&(n+=" attention");var r=u().createElement("p",null,"Ready");if(e.blocking.length>0)switch(e.blocking[0]){case"ExternalReferences":r=u().createElement("p",null,"Upload missing external references.");break;case"Rename":r=u().createElement("p",null,"An Asset with this name already exists, please rename.");break;case"TargetGroup":r=u().createElement("p",null,"Choose how this content item should be used or upload the parent asset.",u().createElement("br",null),u().createElement("br",null),"For example, if this is a texture image used in a material, please upload the material asset.")}return u().createElement("li",null,u().createElement("div",{className:n,onClick:this.props.onResourceSelect.bind(null,e.id)},u().createElement("div",{className:"tfmedia"},e.thumb?u().createElement("img",{src:e.thumb,className:"tfthumb"}):null,u().createElement("div",{className:"tfmedia-body"},u().createElement("h4",null,u().createElement("span",{className:"content-type-badge"},e.type),e.name),r)),this.props.selected?u().createElement(my,{resource:e,onResourceUpdate:this.props.onResourceUpdate}):null,t))}}])&&vy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);_y.propTypes={resource:d().object,selected:d().bool,onResourceSelect:d().func,onResourceUpdate:d().func};const Py=_y;function ky(e){return ky="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},ky(e)}function jy(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,Cy(r.key),r)}}function Cy(e){var t=function(e,t){if("object"!=ky(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ky(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ky(t)?t:t+""}function Ty(e,t,n){return t=Dy(t),function(e,t){if(t&&("object"===ky(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xy()?Reflect.construct(t,n||[],Dy(e).constructor):t.apply(e,n))}function xy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xy=function(){return!!e})()}function Dy(e){return Dy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dy(e)}function Ny(e,t){return Ny=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ny(e,t)}var Ry=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Ty(this,t,[e])).onResourceSelect=n.onResourceSelect.bind(n),n.existsInResources=n.existsInResources.bind(n),n.state={selectedId:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ny(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(null==this.state.selectedId||!this.existsInResources(this.state.selectedId,e.resources)){var t=null!=e.resources&&e.resources.length>0?e.resources[0].id:null;t!=this.state.selectedId&&this.setState({selectedId:t})}}},{key:"onResourceSelect",value:function(e,t){t.preventDefault(),t.stopPropagation();var n=e;this.existsInResources(e,this.props.resources)||(n=null),this.setState({selectedId:n})}},{key:"existsInResources",value:function(e,t){for(var n=0;n<t.length;n++)if(t[n].id==e)return!0;return!1}},{key:"render",value:function(){var e=this,t=[];return this.props.resources.forEach((function(n){var r=e.state.selectedId==n.id;t.push(u().createElement(Py,{key:n.id,resource:n,selected:r,onResourceSelect:e.onResourceSelect,onResourceUpdate:e.props.onResourceUpdate}))})),t.length<=0?null:u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"staging-list"},t))}}])&&jy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Ry.propTypes={resources:d().array,onResourceUpdate:d().func};const My=Ry;function Iy(e){return Iy="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},Iy(e)}function Ay(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,Ly(r.key),r)}}function Ly(e){var t=function(e,t){if("object"!=Iy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Iy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Iy(t)?t:t+""}function By(e,t,n){return t=Uy(t),function(e,t){if(t&&("object"===Iy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fy()?Reflect.construct(t,n||[],Uy(e).constructor):t.apply(e,n))}function Fy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fy=function(){return!!e})()}function Uy(e){return Uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uy(e)}function qy(e,t){return qy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qy(e,t)}const Ky=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),By(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qy(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e="".concat(this.props.content.type," - ").concat(this.props.content.format," : ").concat(this.props.content.title);return u().createElement("div",{className:"content-view"},u().createElement("div",{title:e,className:"link"},u().createElement("img",{src:this.props.content.thumbUrl})),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&Ay(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Vy(e){return Vy="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},Vy(e)}function zy(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,Wy(r.key),r)}}function Wy(e){var t=function(e,t){if("object"!=Vy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Vy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vy(t)?t:t+""}function Hy(e,t,n){return t=Gy(t),function(e,t){if(t&&("object"===Vy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$y()?Reflect.construct(t,n||[],Gy(e).constructor):t.apply(e,n))}function $y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($y=function(){return!!e})()}function Gy(e){return Gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gy(e)}function Jy(e,t){return Jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jy(e,t)}var Qy=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hy(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jy(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e="".concat(this.props.content.type," : ").concat(this.props.content.title),t="Generic"!=this.props.content.type?u().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return u().createElement("div",{className:"content-dl"},u().createElement("div",{title:e,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),u().createElement("div",{className:"details"},u().createElement("p",{className:"filename"},this.props.content.title),t),this.props.children)}}])&&zy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);const Yy=Qy;function Xy(e){return Xy="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},Xy(e)}function Zy(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,em(r.key),r)}}function em(e){var t=function(e,t){if("object"!=Xy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Xy(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xy(t)?t:t+""}function tm(e,t,n){return t=rm(t),function(e,t){if(t&&("object"===Xy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nm()?Reflect.construct(t,n||[],rm(e).constructor):t.apply(e,n))}function nm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nm=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rm(e)}function om(e,t){return om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},om(e,t)}var im=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=tm(this,t,[e])).filterContent=n.filterContent.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&om(e,t)}(t,e),n=t,(r=[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=[],t=[],n=$.grep(this.props.content,this.filterContent),r=$.grep(this.props.content,this.filterContent,!0);return n.forEach((function(t){e.push(u().createElement("li",{key:t.id,className:"view"},u().createElement(Ky,{content:t})))})),r.forEach((function(e){t.push(u().createElement("li",{key:e.id,className:"dl"},u().createElement(Yy,{content:e})))})),u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"content-list clearfix"},e,t))}}])&&Zy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);im.propTypes={content:d().array};const am=im;function sm(e){return sm="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},sm(e)}function cm(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,lm(r.key),r)}}function lm(e){var t=function(e,t){if("object"!=sm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sm(t)?t:t+""}function um(e,t,n){return t=fm(t),function(e,t){if(t&&("object"===sm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pm()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function pm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(pm=function(){return!!e})()}function fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fm(e)}function hm(e,t){return hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hm(e,t)}var dm=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=um(this,t,[e])).onNotificationClose=n.onNotificationClose.bind(n),n.checkDuplicateResource=n.checkDuplicateResource.bind(n),n.onResourceUpdate=n.onResourceUpdate.bind(n),n.canClose=n.canClose.bind(n),n.onUploadDelete=n.onUploadDelete.bind(n),n.deleteUpload=n.deleteUpload.bind(n),n.createUploadKey=n.createUploadKey.bind(n),n.getUploadIndexByFilename=n.getUploadIndexByFilename.bind(n),n.getUploadIndexByKey=n.getUploadIndexByKey.bind(n),n.updateNotifications=n.updateNotifications.bind(n),n.onHostedRegister=n.onHostedRegister.bind(n),n.onFileDrop=n.onFileDrop.bind(n),n.nextFile=n.nextFile.bind(n),n.processFile=n.processFile.bind(n),n.updateUploadArray=n.updateUploadArray.bind(n),n.updateResourceAndContentArrays=n.updateResourceAndContentArrays.bind(n),n.updateUpload=n.updateUpload.bind(n),n.updateUploadInState=n.updateUploadInState.bind(n),n.fileProgress=n.fileProgress.bind(n),n.fileDone=n.fileDone.bind(n),n.inProcess=!1,n.files=[],n.fileSizeLimit=TFGlobal.stagingFileSizeLimit,n.state={uploads:[],notifications:[],resources:[],content:[]},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hm(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){$.ajax({type:"GET",url:"/staging",dataType:"json",context:this}).then((function(e){!0===e.status.isSuccess?this.setState({resources:e.data}):$("#errorModal").find("p").html(e.status.message).end().foundation("reveal","open")}))}},{key:"onNotificationClose",value:function(e,t){var n=this.state.notifications;n[e].show=!1,this.setState({notifications:n})}},{key:"checkDuplicateResource",value:function(e,t){if(void 0!==e)for(var n=0,r=e.length;n<r;n++){if(e[n].name==t&&"Missing"!=e[n].status&&"Duplicate"!=e[n].status)return!0;var o=this.checkDuplicateResource(e[n].children,t);if(null!=o)return o}return null}},{key:"onResourceUpdate",value:function(e,t){this.updateResourceAndContentArrays(e,t)}},{key:"canClose",value:function(){return!(!this.props.closeAfterAutoAcceptContent||0!=this.state.resources.length||0!=this.files.length)}},{key:"onUploadDelete",value:function(e,t){this.deleteUpload(e,null)}},{key:"deleteUpload",value:function(e,t){var n=this.getUploadIndexByKey(e);if(-1!=n){var r=this.state.uploads;r.splice(n,1);var o=this.state.notifications;t&&o.push(t),this.setState({uploads:r,notifications:o})}}},{key:"createUploadKey",value:function(e){return e.split(".").join("-")}},{key:"getUploadIndexByFilename",value:function(e){return this.getUploadIndexByKey(this.createUploadKey(e))}},{key:"getUploadIndexByKey",value:function(e){for(var t=0,n=!1;t<this.state.uploads.length;t++)if(this.state.uploads[t].key==e){n=!0;break}return n?t:-1}},{key:"updateNotifications",value:function(e){var t=this.state.notifications.push(e);this.setState({notifications:t})}},{key:"onHostedRegister",value:function(e,t,n){e&&this.updateUploadArray(e),this.updateResourceAndContentArrays(t,n)}},{key:"onFileDrop",value:function(e){var t=[],n=[],r=[],o=this;e.forEach((function(e){if($.grep(o.files,(function(t){return t.name==e.name})).length>0||-1!=o.getUploadIndexByFilename(e.name)||!0===o.checkDuplicateResource(o.state.resources,e.name)){var i={title:e.name,level:"Danger",messages:["Duplicate File"],show:!0};r.push(i)}else if(Math.floor(e.size/1024)>o.fileSizeLimit){var a={title:e.name,level:"Danger",messages:["File Too Large"],show:!0};r.push(a)}else{var s={key:o.createUploadKey(e.name),name:vn.getFileNameWithoutExtension(e.name),extension:vn.getFileExtension(e.name),type:e.type,status:"New",message:"Checking...",percentComplete:0};t.push(s),n.push(e)}})),this.setState({uploads:this.state.uploads.concat(t),notifications:r.concat(this.state.notifications)},(function(){for(var e=0,t=0;t<n.length;++t){var r=n[t],i=o.getUploadIndexByFilename(r.name);$.ajax({type:"GET",url:"/staging/validate",data:{mimeType:encodeURIComponent(r.type),filename:encodeURIComponent(r.name),groupsAllowed:this.props.groupsAllowed},contentType:"application/json; charset=utf-8",context:r,dataType:"json",traditional:!0}).done((function(e){if(!0===e.status.isSuccess)o.files.push(this),o.updateUpload(i,"Ready","Waiting to upload...",null);else{var t={title:r.name,level:"Danger",messages:[e.status.message],show:!0};o.deleteUpload(o.state.uploads[i].key,t)}})).fail((function(e,t,n){var a={title:r.name,level:"Danger",messages:["Error On File Recognition"],show:!0};o.deleteUpload(o.state.uploads[i].key,a)})).always((function(){++e==n.length&&(o.inProcess||o.nextFile())}))}}))}},{key:"nextFile",value:function(){this.inProcess=!0,0!=this.files.length?this.processFile(this.files.shift()):this.inProcess=!1}},{key:"processFile",value:function(e){var t=this.getUploadIndexByFilename(e.name),n=new FormData;n.append(e.name,e),n.append("groupsAllowed",this.props.groupsAllowed),this.updateUpload(t,"Uploading","Uploading...",null);var r=this;$.ajax({type:"POST",url:"/staging/upload",contentType:!1,processData:!1,data:n,context:e,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&(e.upload.addEventListener("progress",r.fileProgress.bind(null,t)),e.upload.addEventListener("load",r.fileDone.bind(null,t))),e}}).done((function(e,t,n){r.updateUploadArray(e.uploads),r.updateResourceAndContentArrays(e.resources,e.content),r.nextFile()})).fail((function(e,t,n){alert(this.name+" : "+n)}))}},{key:"updateUploadArray",value:function(e){if(-1!=this.getUploadIndexByFilename(e.filename)){var t=null;if(!0!==e.status.isSuccess){for(var n=e.status.message?[e.status.message]:[],r=0;r<e.children.length;r++)!1===e.children[r].status.isSuccess&&n.push(e.children[r].status.message+" : "+e.children[r].filename);t={title:e.filename,level:"Danger",messages:n,show:!0}}this.deleteUpload(this.createUploadKey(e.filename),t)}}},{key:"updateResourceAndContentArrays",value:function(e,t){var n=null!=e&&e.length>0;if(null==t||0==t.length)this.setState({resources:e});else if(!0===this.props.autoAcceptContent)this.props.onAccept(t,this.canClose()&&!n),this.setState({resources:e});else{var r=t;null!=this.state.content&&0!=this.state.content.length&&(r=t.concat(this.state.content)),this.setState({resources:e,content:r})}}},{key:"updateUpload",value:function(e,t,n,r){var o=this.state.uploads[e];null!=o&&(null!=t&&(o.status=t),null!=n&&(o.message=n),null!=r&&(o.percentComplete=r),this.updateUploadInState(o,e))}},{key:"updateUploadInState",value:function(e,t){var n=this.state.uploads.slice();n[t]=e,this.setState({uploads:n})}},{key:"fileProgress",value:function(e,t){if(t.lengthComputable){var n=Math.round(t.loaded/t.total*100);this.updateUpload(e,null,null,n)}}},{key:"fileDone",value:function(e,t){this.updateUpload(e,"Loaded",null,100)}},{key:"render",value:function(){var e=this.props.autoAcceptContent?null:u().createElement("button",{className:"btn-primary",onClick:this.props.onAccept.bind(null,this.state.content),disabled:0==this.state.content.length},"Accept"),t=this.props.showCancel?u().createElement("button",{className:"btn-default",onClick:this.props.onCancel},this.props.cancelButtonLabel):null,n=!1;return!this.props.showHostedContent||null!=this.props.groupsAllowed&&-1==this.props.groupsAllowed.indexOf("Portfolio")&&-1==this.props.groupsAllowed.indexOf("Training")||(n=!0),u().createElement("div",{className:"content-staging"},u().createElement(Wd,{notifications:this.state.notifications,onNotificationClose:this.onNotificationClose}),u().createElement("div",{style:{padding:"20px 20px 0 20px",border:"1px solid #ccc",marginBottom:"20px"}},!0===this.props.showUpload&&u().createElement(ad,{onDrop:this.onFileDrop,uploads:this.state.uploads,multiple:this.props.allowMultipleFiles},this.props.children),!0===n&&u().createElement(yd,{onRegister:this.onHostedRegister}),!0===this.props.showHostedFile&&u().createElement(Nd,{onRegister:this.onHostedRegister})),u().createElement(My,{resources:this.state.resources,onResourceUpdate:this.onResourceUpdate}),null!=this.state.content&&this.state.content.length>0&&u().createElement(am,{content:this.state.content,test:"no content selected"}),(null!=e||null!=t)&&u().createElement("div",{style:{textAlign:"right"}},t," ",e))}}])&&cm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);dm.propTypes={groupsAllowed:d().array,allowMultipleFiles:d().bool,autoAcceptContent:d().bool,closeAfterAutoAcceptContent:d().bool,showCancel:d().bool,cancelButtonLabel:d().string,onCancel:d().func,showUpload:d().bool,showHostedContent:d().bool,showHostedFile:d().bool},dm.defaultProps={groupsAllowed:null,allowMultipleFiles:!0,closeAfterAutoAcceptContent:!0,autoAcceptContent:!0,showCancel:!1,cancelButtonLabel:"Cancel",showUpload:!0,showHostedContent:!0,showHostedFile:!1};const ym=dm;function mm(e){return mm="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},mm(e)}function bm(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,vm(r.key),r)}}function vm(e){var t=function(e,t){if("object"!=mm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mm(t)?t:t+""}function gm(e,t,n){return t=Em(t),function(e,t){if(t&&("object"===mm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,wm()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function wm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wm=function(){return!!e})()}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Em(e)}function Sm(e,t){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sm(e,t)}var Om=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=gm(this,t,[e])).handleClickDelete=n.handleClickDelete.bind(n),n.filterContent=n.filterContent.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sm(e,t)}(t,e),n=t,(r=[{key:"handleClickDelete",value:function(e){this.props.onDeleteContent(e)}},{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n,r){var o,i=[];i.push(u().createElement("a",{onClick:e.handleClickDelete.bind(null,n.id)},"Delete")),o=u().createElement("div",{className:"edit"},u().createElement(ko,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),t.push(u().createElement("li",{key:n.id,className:"view"},u().createElement(Ky,{content:n},o)))})),o.forEach((function(t,r){var o,i=[];i.push(u().createElement("a",{onClick:e.handleClickDelete.bind(null,t.id)},"Delete")),o=u().createElement("div",{className:"edit"},u().createElement(ko,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),n.push(u().createElement("li",{key:t.id,className:"dl"},u().createElement(Yy,{content:t},o)))})),u().createElement("div",{className:"tfpanel"},u().createElement("ul",{className:"content-list clearfix"},t,n))}}])&&bm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Om.propTypes={content:d().array,onDeleteContent:d().func};const _m=Om;function Pm(e){return Pm="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},Pm(e)}function km(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,jm(r.key),r)}}function jm(e){var t=function(e,t){if("object"!=Pm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Pm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pm(t)?t:t+""}function Cm(e,t,n){return t=xm(t),function(e,t){if(t&&("object"===Pm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Tm()?Reflect.construct(t,n||[],xm(e).constructor):t.apply(e,n))}function Tm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Tm=function(){return!!e})()}function xm(e){return xm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xm(e)}function Dm(e,t){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dm(e,t)}var Nm=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Cm(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.clear=n.clear.bind(n),n.addMarkup=n.addMarkup.bind(n),n.openLink=n.openLink.bind(n),n.addLink=n.addLink.bind(n),n.openEmbed=n.openEmbed.bind(n),n.addEmbed=n.addEmbed.bind(n),n.openImageLink=n.openImageLink.bind(n),n.addImageLink=n.addImageLink.bind(n),n.handleCloseOverlay=n.handleCloseOverlay.bind(n),n.openContent=n.openContent.bind(n),n.addContent=n.addContent.bind(n),n.handleDeleteContent=n.handleDeleteContent.bind(n),n.handlePreview=n.handlePreview.bind(n),n.handleSimpleMarkupChange=n.handleSimpleMarkupChange.bind(n),n.handlePostChange=n.handlePostChange.bind(n),n.handleFocus=n.handleFocus.bind(n),n.focus=n.focus.bind(n),n.Modes={Attract:"attract",Post:"post",Embed:"embed",Link:"link",Image:"image",Content:"content",Preview:"preview"},n.Embeds={},n.Embeds.YOUTUBE={action:"YOUTUBE",label:"Enter YouTube Video ID:",button:"Add YouTube video to post"},n.Embeds.VIMEO={action:"VIMEO",label:"Enter Vimeo Video ID:",button:"Add Vimeo video to post"},n.Embeds.SKETCHFAB={action:"SKETCHFAB",label:"Enter Sketchfab Model View Url or Model ID:",button:"Add Sketchfab model to post"},n.overlayLabel="",n.overlayButton="",n.action="",n.state={mode:n.props.mode,simpleMarkupFL:!0,preview:null,isValid:!1,showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dm(e,t)}(t,e),n=t,r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.refs.post.value=e.value}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().post.length>=3}},{key:"getValue",value:function(){return{post:this.refs.post.value,simpleMarkupFL:this.refs.simpleMarkupFL.checked}}},{key:"clear",value:function(){this.refs.post.value=""}},{key:"addMarkup",value:function(e){var t,n=this.refs.post;if(document.selection){if(n.focus(),sel=document.selection.createRange(),0==sel.text.length)return;(t=sel.text)&&(sel.text="["+e+"]"+t+"[/"+e+"]")}else{if(n.selectionEnd-n.selectionStart==0)return;(t=n.value.substring(n.selectionStart,n.selectionEnd))&&(n.value=n.value.substring(0,n.selectionStart)+"["+e+"]"+t+"[/"+e+"]"+n.value.substring(n.selectionEnd,n.value.length))}this.handlePostChange()}},{key:"openLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),e)return sel.text="[URL]"+e+"[/URL]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),e)return t.value=t.value.substring(0,t.selectionStart)+"[URL]"+e+"[/URL]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Link})}},{key:"addLink",value:function(){var e=this.refs.post,t=this.refs.link.value,n=this.refs.linktext.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text=n?'[URL="'+t+'"]'+n+"[/URL]":"[URL]"+t+"[/URL]")):t&&(e.value=n?e.value.substring(0,e.selectionStart)+'[URL="'+t+'"]'+n+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length):e.value.substring(0,e.selectionStart)+"[URL]"+t+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openEmbed",value:function(e){this.overlayLabel=this.Embeds[e].label,this.overlayButton=this.Embeds[e].button,this.action=e,this.setState({mode:this.Modes.Embed})}},{key:"addEmbed",value:function(){var e=this.refs.post,t=this.refs.embed.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="["+this.action+'="'+t+'"]')):t&&(e.value=e.value.substring(0,e.selectionStart)+"["+this.action+'="'+t+'"]'+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openImageLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),null!=e&&"null"!=e&&""!=e)return sel.text="[IMG]"+e+"[/IMG]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),null!=e&&"null"!=e&&""!=e)return t.value=t.value.substring(0,t.selectionStart)+"[IMG]"+e+"[/IMG]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Image})}},{key:"addImageLink",value:function(){var e=this.refs.post,t=this.refs.image.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="[IMG]"+t+"[/IMG]")):t&&(e.value=e.value.substring(0,e.selectionStart)+"[IMG]"+t+"[/IMG]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"handleCloseOverlay",value:function(){this.setState({mode:this.Modes.Post})}},{key:"openContent",value:function(){this.setState({mode:this.Modes.Content})}},{key:"addContent",value:function(e){if(null!=e||e.length>0){var t=e;null!=this.props.content&&0!=this.props.content.length&&(t=this.props.content.concat(e)),this.props.onContentChange(t)}this.setState({mode:this.Modes.Post})}},{key:"handleDeleteContent",value:function(e){if(null!=this.props.content&&0!=this.props.content.length){for(var t=this.props.content,n=null,r=0;r<t.length;r++)t[r].id==e&&(n=r);null!=n&&(t.splice(n,1),this.props.onContentChange(t))}}},{key:"handlePreview",value:function(){this.state.mode!=this.Modes.Preview?this.validate()&&this.setState({mode:this.Modes.Preview},(function(){var e=this.getValue(),t={post:e.post,simpleMarkupFL:e.simpleMarkupFL};$.ajax({type:"POST",url:"/api/forum/post/preview",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.setState({preview:e.data})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))})):this.handleCloseOverlay()}},{key:"handleSimpleMarkupChange",value:function(e){this.setState({simpleMarkupFL:e.target.checked}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handlePostChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handleFocus",value:function(){this.state.mode===this.Modes.Attract&&this.setState({mode:this.Modes.Post},(function(){this.props.onFocus&&this.props.onFocus()}))}},{key:"focus",value:function(){this.refs.post.focus()}},{key:"render",value:function(){var e="post-editor-input".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=this.state.mode==this.Modes.Attract?"Join the conversation...":"",n=null;return!0!==this.state.showValidation||this.state.isValid||(n=u().createElement(sa,{message:"post required and must be 3 or more characters in length"})),u().createElement("div",null,u().createElement("div",{className:"post-editor-primary"},this.state.mode!=this.Modes.Attract&&u().createElement("ul",{className:"post-edit-controls"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"B")},"B")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"I")},"I")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"QUOTE")},"Quote")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODE")},"Inline Code")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODEBLOCK")},"Code Block")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openLink},"Add Link")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openImageLink},"Add Image Link")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"YOUTUBE")},"YouTube")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"VIMEO")},"Vimeo")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"SKETCHFAB")},"Sketchfab")),"Discussion"==this.props.type&&u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",onClick:this.openContent},"Attach Content"))),u().createElement("div",{className:e},u().createElement("textarea",{name:"post",ref:"post",placeholder:t,defaultValue:this.props.value,className:"form-control",rows:"12",onFocus:this.handleFocus,onChange:this.handlePostChange,disabled:!this.props.enabled,tabIndex:"2"}),n),null!=this.props.content&&this.props.content.length>0&&u().createElement(_m,{content:this.props.content,onDeleteContent:this.handleDeleteContent}),this.state.mode==this.Modes.Content&&u().createElement(L,{onClose:this.handleCloseOverlay,contentStyle:{width:"100%",padding:"20px",backgroundColor:"white"}},u().createElement(ym,{closeAfterAutoAcceptContent:!1,autoAcceptContent:!1,onAccept:this.addContent,showCancel:!0,onCancel:this.handleCloseOverlay},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))),this.state.mode==this.Modes.Embed&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},this.overlayLabel),u().createElement("input",{type:"text",ref:"embed",name:"embed"})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addEmbed},this.overlayButton)),this.state.mode==this.Modes.Link&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Full Url: "),u().createElement("input",{type:"text",ref:"link",name:"link",placeholder:"http://...",className:"form-control"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Text for the Link (Leave blank to display full address):"),u().createElement("input",{type:"text",ref:"linktext",name:"linktext"})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addLink},"Add Link")),this.state.mode==this.Modes.Image&&u().createElement("div",{className:"post-editor-overlay dark clearfix"},u().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("div",{className:"form-group light"},u().createElement("label",{className:"static"},"Enter Image Url: "),u().createElement("input",{type:"text",ref:"image",name:"image",placeholder:"http://..."})),u().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addImageLink},"Add Image Link")),this.state.mode==this.Modes.Preview&&u().createElement("div",{className:"post-editor-overlay clearfix"},u().createElement("button",{type:"button",className:"close",onClick:this.handleCloseOverlay},u().createElement("i",{className:"glyphicon glyphicon-remove"})),u().createElement("article",{className:"comment preview"},u().createElement("div",{className:"comment-body"},u().createElement("div",{className:"comment-body-container"},u().createElement("div",{className:"comment-body-content clearfix",dangerouslySetInnerHTML:{__html:this.state.preview}})))))),this.state.mode!=this.Modes.Attract&&u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},u().createElement("input",{type:"checkbox",id:"simpleMarkupFL",name:"simpleMarkupFL",ref:"simpleMarkupFL",checked:this.state.simpleMarkupFL,onChange:this.handleSimpleMarkupChange}),u().createElement("label",{htmlFor:"simpleMarkupFL"},"Enable Simple Markup")),this.state.simpleMarkupFL&&u().createElement("button",{type:"button",className:"btn-default",name:"preview",onClick:this.handlePreview},"Preview"),u().createElement("div",{className:"pull-right"},this.props.children)))}}],r&&km(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Nm.propTypes={type:d().string},Nm.defaultProps={mode:"post",type:"Post"};const Rm=Nm;function Mm(e){return Mm="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},Mm(e)}function Im(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,Am(r.key),r)}}function Am(e){var t=function(e,t){if("object"!=Mm(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Mm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mm(t)?t:t+""}function Lm(e,t,n){return t=Fm(t),function(e,t){if(t&&("object"===Mm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Bm()?Reflect.construct(t,n||[],Fm(e).constructor):t.apply(e,n))}function Bm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Bm=function(){return!!e})()}function Fm(e){return Fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fm(e)}function Um(e,t){return Um=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Um(e,t)}const qm=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Lm(this,t,[e])).tick=n.tick.bind(n),n.format=n.format.bind(n),n.state={secondsRemaining:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Um(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onCountdownFinished&&this.props.onCountdownFinished())}},{key:"format",value:function(e,t){var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=Math.floor(this.state.secondsRemaining/60),t=this.state.secondsRemaining%60;e<=9&&(e="0"+e),t<=9&&(t="0"+t);var n="".concat(e,":").concat(t);return u().createElement("div",null,this.format(this.props.message,{time:n}))}}])&&Im(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Km(e){return Km="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},Km(e)}function Vm(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,zm(r.key),r)}}function zm(e){var t=function(e,t){if("object"!=Km(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Km(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Km(t)?t:t+""}function Wm(e,t,n){return t=$m(t),function(e,t){if(t&&("object"===Km(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Hm()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function Hm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Hm=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$m(e)}function Gm(e,t){return Gm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gm(e,t)}var Jm=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Wm(this,t,[e])).setup=n.setup.bind(n),n.buildUrl=n.buildUrl.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleDelayEnd=n.handleDelayEnd.bind(n),n.handlePostChange=n.handlePostChange.bind(n),n.handleContentChange=n.handleContentChange.bind(n),n.handleStatusChange=n.handleStatusChange.bind(n),n.handleSubscribeChange=n.handleSubscribeChange.bind(n),n.profile=null,n.editor=null,n.state={form:null,submitDisabled:!1,delay:!1,delayTimeSpan:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gm(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){"attract"!=this.props.mode&&"display"!=this.props.mode&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON(this.buildUrl()).done((function(t,n,r){e.profile=t.data.profile,e.editor=t.data.editor,e.setState({form:t.data.form},(function(){!0===this.props.autoFocus&&e.refs.post.focus()}))})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"buildUrl",value:function(){return"/api/forum/post/".concat(this.props.mode,"?type=").concat(this.props.type,"&id=").concat(this.props.itemID)+"".concat(null!=this.props.postID?"&postID="+this.props.postID:"")}},{key:"handleSubmit",value:function(){if(this.refs.post.validate()){var e=this;this.setState({submitDisabled:!0},(function(){var t=this.state.form;null!=t.content&&t.content.length>0&&(t.contentList=t.content.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:e.buildUrl(),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json"}).done((function(t,n,r){switch(t.data.result){case"Success":e.props.onSubmit(t.data);break;case"Delay":e.setState({submitDisabled:!0,delay:!0,delayTimeSpan:t.data.timeSpan});break;case"Refresh":alerts.warning("Possible unwanted content detected. Please edit your post. A moderator has been notified."),e.setState({submitDisabled:!1});break;case"Locked":alerts.error("Account Locked. A moderator has been notified and will review your account."),e.handleCancel()}})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.setState({submitDisabled:!1})}))}))}}},{key:"handleCancel",value:function(){this.refs.post.clear(),this.props.onCancel()}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.content=e,this.setState({form:t})}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:u().createElement("div",{className:"post-editor",id:"postEditor"},u().createElement(ki,{profile:this.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),u().createElement(Rm,{ref:"post",type:this.props.type,value:this.state.form.post,content:this.state.form.content,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:!0},"new"==this.props.mode&&0==this.editor.subscription&&u().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},u().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),u().createElement("label",{htmlFor:"subscribeFL"}," Watch discussion +")),this.editor&&this.editor.e&&u().createElement(wp,{options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange,isInline:!0}),u().createElement("span",{className:"button-group"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&u().createElement(qm,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))}}])&&Vm(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Jm.propTypes={mode:d().string,itemID:d().number,type:d().string,viewer:d().object,autoFocus:d().bool,onSubmit:d().func.isRequired,onCancel:d().func.isRequired},Jm.defaultProps={autoFocus:!0,mode:"new",type:"Post"};const Qm=Jm;function Ym(e){return Ym="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},Ym(e)}function Xm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zm(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,tb(r.key),r)}}function eb(e,t,n){return t&&Zm(e.prototype,t),n&&Zm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tb(e){var t=function(e,t){if("object"!=Ym(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ym(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ym(t)?t:t+""}function nb(e,t,n){return t=ob(t),function(e,t){if(t&&("object"===Ym(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rb()?Reflect.construct(t,n||[],ob(e).constructor):t.apply(e,n))}function rb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rb=function(){return!!e})()}function ob(e){return ob=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ob(e)}function ib(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ab(e,t)}function ab(e,t){return ab=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ab(e,t)}var sb=function(e){function t(e){var n;return Xm(this,t),(n=nb(this,t,[e])).handleNew=n.handleNew.bind(n),n.handleReply=n.handleReply.bind(n),n.handleQuote=n.handleQuote.bind(n),n.handleEdit=n.handleEdit.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handleCancel=n.handleCancel.bind(n),n.Modes={Display:"display",New:"new",Edit:"edit",Reply:"reply",Quote:"quote"},n.state={mode:n.props.mode,targetID:null},n}return ib(t,e),eb(t,[{key:"componentDidUpdate",value:function(){if(this.state.mode==this.Modes.New){var e=document.getElementById("postEditor");e&&e.scrollIntoView()}}},{key:"handleNew",value:function(){this.setState({mode:this.Modes.New,targetID:null})}},{key:"handleReply",value:function(e){this.setState({mode:this.Modes.Reply,targetID:e})}},{key:"handleQuote",value:function(e){this.setState({mode:this.Modes.Quote,targetID:e})}},{key:"handleEdit",value:function(e){this.setState({mode:this.Modes.Edit,targetID:e})}},{key:"handleSubmit",value:function(e){var t=this;this.setState({mode:this.Modes.Display,targetID:null},(function(){t.props.history.push(e.url)}))}},{key:"handleCancel",value:function(){this.setState({mode:this.Modes.Display,targetID:null})}},{key:"render",value:function(){var e=this,t=[];if(this.props.posts){this.props.posts.data.forEach((function(n,r){e.state.mode==e.Modes.Edit&&n.postID==e.state.targetID?t.push(u().createElement(Qm,{key:0,mode:e.state.mode,type:"Discussion",itemID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel})):"GDPRRemoval"===n.status?t.push(u().createElement(Ph,{key:n.postID,post:n})):t.push(u().createElement(mh,{key:n.postID,post:n,viewer:e.props.viewer,onReply:e.handleReply,onQuote:e.handleQuote,onEdit:e.handleEdit,showEditControls:e.props.topic.show.newPost})),e.state.mode!=e.Modes.Quote&&e.state.mode!=e.Modes.Reply||n.postID!=e.state.targetID||t.push(u().createElement(Qm,{key:0,mode:e.state.mode,type:"Discussion",itemID:e.props.topic.topicID,postID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel}))})),this.state.mode==this.Modes.New&&t.push(u().createElement(Qm,{key:0,mode:this.state.mode,type:"Discussion",itemID:this.props.topic.topicID,viewer:this.props.viewer,onSubmit:e.handleSubmit,onCancel:this.handleCancel}));var n=null;return this.props.topic.show.newPost&&this.state.mode==this.Modes.Display&&(n=u().createElement(cb,{onClick:this.handleNew})),u().createElement("div",null,u().createElement("div",{className:"comment-container forum"},this.props.posts.totalPages>1&&u().createElement(Ln,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),t,this.props.posts.totalPages>1&&u().createElement(Ln,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged})),n)}return u().createElement("div",{className:"subsection comment"},u().createElement("div",{className:"comment-container"},u().createElement("h4",null,"No Content")))}}])}(u().Component);sb.propTypes={mode:d().string,topic:d().object,posts:d().object,viewer:d().object,onPageChanged:d().func};var cb=function(e){function t(){return Xm(this,t),nb(this,t,arguments)}return ib(t,e),eb(t,[{key:"render",value:function(){return u().createElement("div",{className:"new-content-button"},u().createElement("button",{type:"button",className:"btn-primary",onClick:this.props.onClick},"Reply To Topic"))}}])}(u().Component);const lb=it(sb);function ub(e){return ub="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},ub(e)}function pb(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,fb(r.key),r)}}function fb(e){var t=function(e,t){if("object"!=ub(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ub(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ub(t)?t:t+""}function hb(e,t,n){return t=yb(t),function(e,t){if(t&&("object"===ub(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,db()?Reflect.construct(t,n||[],yb(e).constructor):t.apply(e,n))}function db(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(db=function(){return!!e})()}function yb(e){return yb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yb(e)}function mb(e,t){return mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mb(e,t)}var bb=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hb(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mb(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=null;return null!=this.props.limitHeight&&(e={maxHeight:this.props.limitHeight}),u().createElement("div",{className:"image-element"},u().createElement("img",{src:this.props.content.data,style:e}),this.props.children)}}])&&pb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);bb.propTypes={content:d().object.isRequired,limitHeight:d().number};const vb=bb;function gb(e){return gb="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},gb(e)}function wb(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,Eb(r.key),r)}}function Eb(e){var t=function(e,t){if("object"!=gb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gb(t)?t:t+""}function Sb(e,t,n){return t=_b(t),function(e,t){if(t&&("object"===gb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ob()?Reflect.construct(t,n||[],_b(e).constructor):t.apply(e,n))}function Ob(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ob=function(){return!!e})()}function _b(e){return _b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_b(e)}function Pb(e,t){return Pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pb(e,t)}var kb=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Sb(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pb(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"text-element",dangerouslySetInnerHTML:vn.createMarkup(this.props.content.data)})}}])&&wb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);kb.propTypes={content:d().object.isRequired};const jb=kb;function Cb(e){return Cb="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},Cb(e)}function Tb(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,xb(r.key),r)}}function xb(e){var t=function(e,t){if("object"!=Cb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Cb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Cb(t)?t:t+""}function Db(e,t,n){return t=Rb(t),function(e,t){if(t&&("object"===Cb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Nb()?Reflect.construct(t,n||[],Rb(e).constructor):t.apply(e,n))}function Nb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Nb=function(){return!!e})()}function Rb(e){return Rb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rb(e)}function Mb(e,t){return Mb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mb(e,t)}var Ib=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Db(this,t,[e])).setHeight=n.setHeight.bind(n),n.handleResize=n.handleResize.bind(n),n.aspect=n.props.content.attributes.height/n.props.content.attributes.width,n.state={height:n.props.content.attributes.height},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mb(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;switch(this.props.content.format){case"YouTube":case"Vimeo":var t=null;switch(this.props.content.format){case"YouTube":t="https://www.youtube.com/embed/"+this.props.content.data;break;case"Vimeo":var n=this.props.content.data,r="";if(-1!=n.indexOf(":")){var o=n.split(":");n=o[0],r="h=".concat(o[1],"&")}t="https://player.vimeo.com/video/".concat(n,"?").concat(r,"byline=0&portrait=0")}e=u().createElement("iframe",{ref:"video",height:this.state.height,src:t,frameBorder:"0",allowFullScreen:!0});break;case"Wistia":var i="wistia_embed wistia_async_".concat(this.props.content.data),a={height:this.state.height,display:"inline-block"};e=u().createElement("div",{ref:"video",className:i,style:a}," ");break;case"QuickTime":e=u().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"},u().createElement("embed",{src:this.props.content.data,scale:"tofit",autoPlay:!1,loop:!0,controller:"true",airplay:"allow",pluginspage:"http://www.apple.com/quicktime/download/"}));break;default:e=u().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"})}return u().createElement("div",{className:"video-element"},e)}}])&&Tb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Ib.propTypes={content:d().object.isRequired,limitHeight:d().number};const Ab=Ib;function Lb(e){return Lb="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},Lb(e)}function Bb(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,Fb(r.key),r)}}function Fb(e){var t=function(e,t){if("object"!=Lb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Lb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lb(t)?t:t+""}function Ub(e,t,n){return t=Kb(t),function(e,t){if(t&&("object"===Lb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qb()?Reflect.construct(t,n||[],Kb(e).constructor):t.apply(e,n))}function qb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qb=function(){return!!e})()}function Kb(e){return Kb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kb(e)}function Vb(e,t){return Vb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vb(e,t)}var zb=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ub(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vb(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",null,u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",{className:"details"},u().createElement("p",{className:"type"},this.props.content.type),u().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&Bb(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);zb.propTypes={content:d().object.isRequired};const Wb=zb;function Hb(e){return Hb="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},Hb(e)}function $b(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,Gb(r.key),r)}}function Gb(e){var t=function(e,t){if("object"!=Hb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Hb(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hb(t)?t:t+""}function Jb(e,t,n){return t=Yb(t),function(e,t){if(t&&("object"===Hb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qb()?Reflect.construct(t,n||[],Yb(e).constructor):t.apply(e,n))}function Qb(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Qb=function(){return!!e})()}function Yb(e){return Yb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yb(e)}function Xb(e,t){return Xb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xb(e,t)}var Zb=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Jb(this,t,[e])).setHeight=n.setHeight.bind(n),n.handleResize=n.handleResize.bind(n),n.aspect=.625,n.state={height:0},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xb(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;return"Sketchfab"===this.props.content.format&&(e="https://sketchfab.com/models/"+this.props.content.data+"/embed"),u().createElement("div",{className:"embedded3d-element"},u().createElement("iframe",{ref:"video",height:this.state.height,src:e,frameBorder:"0",allowFullScreen:!0}))}}])&&$b(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Zb.propTypes={content:d().object.isRequired};const ev=Zb;function tv(e){return tv="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},tv(e)}function nv(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,rv(r.key),r)}}function rv(e){var t=function(e,t){if("object"!=tv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=tv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tv(t)?t:t+""}function ov(e,t,n){return t=av(t),function(e,t){if(t&&("object"===tv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,iv()?Reflect.construct(t,n||[],av(e).constructor):t.apply(e,n))}function iv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iv=function(){return!!e})()}function av(e){return av=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},av(e)}function sv(e,t){return sv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sv(e,t)}var cv=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ov(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sv(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(null==this.props.content)return null;switch(this.props.content.type){case"Image":return u().createElement(vb,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight},this.props.children);case"Text":return u().createElement(jb,{display:this.props.display,content:this.props.content});case"Video":return u().createElement(Ab,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});case"Embedded3DViewer":return u().createElement(ev,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});default:return u().createElement(Wb,{display:this.props.display,content:this.props.content},this.props.children)}}}])&&nv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);cv.propTypes={display:d().string,limitHeight:d().number},cv.defaultProps={display:"inline",limitHeight:null};const lv=cv;function uv(e){return uv="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},uv(e)}function pv(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,fv(r.key),r)}}function fv(e){var t=function(e,t){if("object"!=uv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uv(t)?t:t+""}function hv(e,t,n){return t=yv(t),function(e,t){if(t&&("object"===uv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dv()?Reflect.construct(t,n||[],yv(e).constructor):t.apply(e,n))}function dv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dv=function(){return!!e})()}function yv(e){return yv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yv(e)}function mv(e,t){return mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mv(e,t)}var bv=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=hv(this,t,[e])).updateValues=n.updateValues.bind(n),n.onThumbClick=n.onThumbClick.bind(n),n.changePrimary=n.changePrimary.bind(n),n.onOverlayOpen=n.onOverlayOpen.bind(n),n.onOverlayClose=n.onOverlayClose.bind(n),n.onChangeThumb=n.onChangeThumb.bind(n),n.onChangePrimary=n.onChangePrimary.bind(n),n.windowHeight=null,n.containerWidth=null,n.visibleThumbCount=null,n.showThumbNav=!1,n.showPrimaryNav=!1,n.state={currentIndex:0,thumbStartIndex:0,primary:n.props.gallery?n.props.gallery.primary:null,height:null,showOverlay:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mv(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.windowHeight=window.innerHeight,null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"componentDidUpdate",value:function(){null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"updateValues",value:function(){this.containerWidth=this.wrapper.offsetWidth,null!=this.props.gallery.content&&this.props.gallery.content.length>1&&(this.showPrimaryNav=!0),this.visibleThumbCount=Math.floor(this.containerWidth/this.props.thumbWidth),null==this.props.gallery.content||this.visibleThumbCount>=this.props.gallery.content.length?this.showThumbNav=!1:(this.showThumbNav=!0,this.visibleThumbCount*this.props.thumbWidth+2*this.props.navWidth>this.containerWidth&&(this.visibleThumbCount=this.visibleThumbCount-1));var e=this.state.showOverlay?this.windowHeight-80-100-5:this.wrapper.offsetWidth*this.props.aspectMultiplier;this.setState({height:e,thumbStartIndex:0})}},{key:"onThumbClick",value:function(e,t){t.preventDefault(),this.changePrimary(e)}},{key:"changePrimary",value:function(e){if(e!=this.state.currentIndex){var t=this.props.gallery.content[e].id,n=this.state.thumbStartIndex;e<this.state.thumbStartIndex?n=e:e>this.state.thumbStartIndex+this.visibleThumbCount-1&&(n+=1);var r=this,o=vn.format(this.props.dataUrl,t);$.getJSON(o).done((function(t,o,i){r.setState({primary:t,currentIndex:e,thumbStartIndex:n})})).fail((function(e,t,n){}))}}},{key:"onOverlayOpen",value:function(){this.setState({showOverlay:!0,height:null})}},{key:"onOverlayClose",value:function(){this.setState({showOverlay:!1,height:null})}},{key:"onChangeThumb",value:function(e,t){t.preventDefault();var n=this.state.thumbStartIndex+e;n<0?n=0:n>this.props.gallery.content.length-this.visibleThumbCount&&(n=this.props.gallery.content.length-this.visibleThumbCount),this.setState({thumbStartIndex:n})}},{key:"onChangePrimary",value:function(e,t){var n=this.state.currentIndex+e;n<0?n=0:n>this.props.gallery.content.length-1&&(n=this.props.gallery.content.length-1),this.changePrimary(n)}},{key:"render",value:function(){if(null==this.props.gallery)return null;var e=this;if(null==this.state.height||null==this.state.primary){e=this;var t=u().createElement("div",{className:"embedded-gallery-test",ref:function(t){e.wrapper=t}}," ");return!0===this.state.showOverlay?u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%",height:e.windowHeight-80}},t):t}var n="embedded-gallery";!0===this.state.showOverlay&&(n+=" overlay");var r=[];if(null!=this.props.gallery.content){var o=this.state.currentIndex>0,i=this.state.currentIndex<this.props.gallery.content.length-1,a=this.state.thumbStartIndex+(this.visibleThumbCount-1);a>this.props.gallery.content.length-1&&(a=this.props.gallery.content.length-1);for(var s=this.state.thumbStartIndex>0,c=a<this.props.gallery.content.length-1,l=this.state.thumbStartIndex;l<=a;l++){var p=this.props.gallery.content[l],f=e.state.currentIndex===l?"active":"";r.push(u().createElement("a",{key:p.id,href:"#",className:f,style:{backgroundImage:"url("+p.thumbUrl+")"},onClick:e.onThumbClick.bind(null,l)}))}}var h=u().createElement("div",{className:n,style:this.props.style},u().createElement("div",{className:"primary-container"},u().createElement("div",{className:"primary",style:{height:this.state.height}},this.props.children&&!this.state.showOverlay&&u().createElement("div",{className:"child-controls"},this.props.children),!this.state.showOverlay&&u().createElement("span",{className:"open-overlay glyphicon glyphicon-fullscreen",onClick:this.onOverlayOpen}),u().createElement(lv,{content:this.state.primary,limitHeight:this.state.height}),this.showPrimaryNav&&u().createElement("button",{className:"nav left",onClick:this.onChangePrimary.bind(null,-1),disabled:!o},u().createElement("span",{className:"glyphicon glyphicon-menu-left"})),this.showPrimaryNav&&u().createElement("button",{className:"nav right",onClick:this.onChangePrimary.bind(null,1),disabled:!i},u().createElement("span",{className:"glyphicon glyphicon-menu-right"})))),null!=this.props.gallery.content&&this.props.gallery.content.length>1&&u().createElement("div",{className:"thumbs"},u().createElement("div",{className:"clearfix"},this.showThumbNav&&u().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,-1),disabled:!s},u().createElement("span",{className:"glyphicon glyphicon-menu-left"})),r,this.showThumbNav&&u().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,1),disabled:!c},u().createElement("span",{className:"glyphicon glyphicon-menu-right"})))));return!0===this.state.showOverlay?u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%"}},h):h}}])&&pv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);bv.propTypes={gallery:d().object,aspectMultiplier:d().number,thumbWidth:d().number,navWidth:d().number},bv.defaultProps={aspectMultiplier:1,thumbWidth:160,navWidth:30};const vv=bv,gv=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return e[n];return null},wv=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null},Ev=function(e,t){if(null!=e&&0!=e.length)for(var n=0;n<e.length;n++)e[n].id==t&&e.splice(n,1)},Sv=function(e){return{id:e.id,tagData:e.tagData,categoryData:e.categoryData,productData:e.productData}},Ov=function(e){return{id:e.id,tagData:e.tagData,categoryData:e.categoryData,productData:e.productData,productReleaseData:e.productReleaseData}};var _v=o(2805),Pv=o.n(_v);function kv(e){return kv="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},kv(e)}function jv(){return jv=Object.assign?Object.assign.bind():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},jv.apply(this,arguments)}function Cv(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,Tv(r.key),r)}}function Tv(e){var t=function(e,t){if("object"!=kv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=kv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kv(t)?t:t+""}function xv(e,t,n){return t=Nv(t),function(e,t){if(t&&("object"===kv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dv()?Reflect.construct(t,n||[],Nv(e).constructor):t.apply(e,n))}function Dv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dv=function(){return!!e})()}function Nv(e){return Nv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nv(e)}function Rv(e,t){return Rv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rv(e,t)}var Mv=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=xv(this,t,[e])).onShowCrop=n.onShowCrop.bind(n),n.onCancel=n.onCancel.bind(n),n.onAccept=n.onAccept.bind(n),n.onCropComplete=n.onCropComplete.bind(n),n._pixelCrop=null,n.state={showCrop:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rv(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this._maxHeight=.95*$(window).height();var e=new Image;e.src=this.props.src;var t=this;e.onload=function(){t._imgWidth=this.width,t._imgHeight=this.height,t.onShowCrop()}}},{key:"onShowCrop",value:function(){this.setState({showCrop:!0})}},{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onAccept",value:function(){this.props.onAccept(this._pixelCrop)}},{key:"onCropComplete",value:function(e,t){this._pixelCrop=t}},{key:"render",value:function(){var e=this,t=null;if(this._imgHeight>this._maxHeight){var n=(this._maxHeight-100)/this._imgHeight;t={style:{width:this._imgWidth*n+"px",margin:"0 auto"}}}var r=this.props.size.width/this.props.size.height,o={crop:{aspect:r},minWidth:this.props.size.width/this._imgWidth*100,minHeight:this.props.size.height/this._imgHeight*100};return r>=1?o.crop.height=100:o.crop.width=100,u().createElement("div",{className:"imagecrop-editor clearfix"},u().createElement("div",t,this.state.showCrop?u().createElement(Pv(),jv({src:this.props.src},o,{onComplete:function(t,n){return e.onCropComplete(t,n)}})):null),u().createElement("div",{className:"pull-right"},u().createElement("button",{className:"btn-default",onClick:this.onCancel},"Cancel"),u().createElement("button",{className:"btn-primary",onClick:this.onAccept},"Accept")))}}])&&Cv(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Mv.propTypes={onCancel:d().func.isRequired,onAccept:d().func.isRequired,src:d().string.isRequired,size:d().object.isRequired};const Iv=Mv;function Av(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lv(e,t){if(e){if("string"==typeof e)return Av(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Av(e,t):void 0}}function Bv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Lv(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fv(e){return Fv="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},Fv(e)}function Uv(e){var t=function(e,t){if("object"!=Fv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Fv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fv(t)?t:t+""}function qv(e,t,n){return(t=Uv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){qv(e,t,n[t])}))}return e}function Vv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zv(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,Uv(r.key),r)}}function Wv(e,t,n){return t&&zv(e.prototype,t),n&&zv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $v(e,t){if(t&&("object"===Fv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hv(e)}function Gv(e){return Gv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gv(e)}function Jv(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Se(e,t)}var Qv=o(2091),Yv=o.n(Qv);var Xv=function(){function e(){Vv(this,e),qv(this,"refs",{})}return Wv(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(Zv)}}]),e}();function Zv(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function eg(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var tg={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},ng=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function rg(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function og(e,t){e.style["".concat(ng,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function ig(e,t){e.style["".concat(ng,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function ag(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function sg(e,t,n){return Math.max(e,Math.min(n,t))}function cg(e){return"px"===e.substr(-2)?parseFloat(e):0}function lg(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function ug(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function pg(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function fg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:fg(e.parentNode,t,r)}}function hg(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);Yv()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=s[1]}return Yv()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function dg(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:dg(e.parentNode):null}var yg={Anchor:"A",Button:"BUTTON",Canvas:"CANVAS",Input:"INPUT",Option:"OPTION",Textarea:"TEXTAREA",Select:"SELECT"};function mg(e){return null!=e.sortableHandle}var bg=function(){function e(t,n){Vv(this,e),this.container=t,this.onScrollCallback=n}return Wv(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,s={x:0,y:0},c={x:1,y:1},l=this.container,u=l.scrollTop,p=l.scrollLeft,f=l.scrollHeight,h=l.scrollWidth,d=0===u,y=f-u-l.clientHeight==0,m=0===p,b=h-p-l.clientWidth==0;n.y>=o.y-a/2&&!y?(s.y=1,c.y=10*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!b?(s.x=1,c.x=10*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!d?(s.y=-1,c.y=10*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!m&&(s.x=-1,c.x=10*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:c.x*s.x,top:c.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),vg={axis:d().oneOf(["x","y","xy"]),contentWindow:d().any,disableAutoscroll:d().bool,distance:d().number,getContainer:d().func,getHelperDimensions:d().func,helperClass:d().string,helperContainer:d().oneOfType([d().func,"undefined"==typeof HTMLElement?d().any:d().instanceOf(HTMLElement)]),hideSortableGhost:d().bool,keyboardSortingTransitionDuration:d().number,lockAxis:d().string,lockOffset:d().oneOfType([d().number,d().string,d().arrayOf(d().oneOfType([d().number,d().string]))]),lockToContainerEdges:d().bool,onSortEnd:d().func,onSortMove:d().func,onSortOver:d().func,onSortStart:d().func,pressDelay:d().number,pressThreshold:d().number,keyCodes:d().shape({lift:d().arrayOf(d().number),drop:d().arrayOf(d().number),cancel:d().arrayOf(d().number),up:d().arrayOf(d().number),down:d().arrayOf(d().number)}),shouldCancelStart:d().func,transitionDuration:d().number,updateBeforeSortStart:d().func,useDragHandle:d().bool,useWindowAsScrollContainer:d().bool},gg={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},wg={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:gg,shouldCancelStart:function(e){return-1!==[yg.Input,yg.Textarea,yg.Select,yg.Option,yg.Button].indexOf(e.target.tagName)||!!ag(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},Eg=Object.keys(vg),Sg=(0,l.createContext)({manager:{}}),Og={index:d().number.isRequired,collection:d().oneOfType([d().number,d().string]),disabled:d().bool},_g=Object.keys(Og);function Pg(e){return Pg="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},Pg(e)}function kg(e,t,n){return(t=Cg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jg(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,Cg(r.key),r)}}function Cg(e){var t=function(e,t){if("object"!=Pg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Pg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pg(t)?t:t+""}function Tg(e,t,n){return t=Dg(t),function(e,t){if(t&&("object"===Pg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xg()?Reflect.construct(t,n||[],Dg(e).constructor):t.apply(e,n))}function xg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xg=function(){return!!e})()}function Dg(e){return Dg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dg(e)}function Ng(e,t){return Ng=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ng(e,t)}var Rg=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Tg(this,t,[e])).setup=n.setup.bind(n),n.validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getContent=n.getContent.bind(n),n.getNodes=n.getNodes.bind(n),n.hasContent=n.hasContent.bind(n),n.addContent=n.addContent.bind(n),n.onEditThumbnail=n.onEditThumbnail.bind(n),n.onAcceptCrop=n.onAcceptCrop.bind(n),n.onCancelCrop=n.onCancelCrop.bind(n),n.onDeleteContent=n.onDeleteContent.bind(n),n.onSortEnd=n.onSortEnd.bind(n),n.onUpdate=n.onUpdate.bind(n),n.imageCropSize=null,n.thumbCropData=null,n.state={content:null!=n.props.content?n.props.content:[],showImageCropModal:!1,imageCropIndex:null,isValid:n.valid(),showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ng(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getContent",value:function(){return{content:this.state.content,thumbCropData:this.thumbCropData}}},{key:"getNodes",value:function(){return this.state.content.map((function(e,t){return{id:vn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null}}))}},{key:"hasContent",value:function(){return null!=this.state&&null!=this.state.content&&this.state.content.length>0}},{key:"addContent",value:function(e){var t=this,n=vn.cloneArray(this.state.content);(null!=e||e.length>0)&&(n=this.state.content.concat(e)),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onEditThumbnail",value:function(e){var t=wv(this.state.content,e);null!=t&&this.setState({showImageCropModal:!0,imageCropIndex:t})}},{key:"onAcceptCrop",value:function(e){var t=this.state.content[this.state.imageCropIndex].id;0==this.state.imageCropIndex?this.thumbCropData={id:t,crop:e}:this.thumbCropData=null;var n=this;$.ajax({type:"POST",url:"/api/content/".concat(t,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,t,r){var o=n.state.content;o[n.state.imageCropIndex].thumbUrl=e,n.setState({content:o,showImageCropModal:!1,imageCropIndex:null})})).fail((function(e,t,r){alerts.error(e.responseJSON.errorMessage),n.setState({showImageCropModal:!1,imageCropIndex:null})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1,imageCropIndex:null})}},{key:"onDeleteContent",value:function(e){var t=this,n=vn.cloneArray(this.state.content);Ev(n,e),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onSortEnd",value:function(e){var t,n,r,o=this,i=this.state.content;this.setState({content:(t=i,n=e.oldIndex,r=e.newIndex,(t=t.slice()).splice(r<0?t.length+r:r,0,t.splice(n,1)[0]),t)},(function(){o.onUpdate()}))}},{key:"onUpdate",value:function(){this.props.onUpdate&&this.props.onUpdate(this.state.content)}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t="";!0===this.props.required&&(t+=" required");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=u().createElement(sa,{message:this.props.helpMessage})):n=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},this.props.label&&u().createElement("label",{className:t},this.props.label),u().createElement("div",{className:"tfpanel"},u().createElement(Mg,{content:this.state.content,staticContent:this.staticContent,onSortEnd:this.onSortEnd,useDragHandle:!0,axis:"xy",onEditThumbnail:this.onEditThumbnail,onDelete:this.onDeleteContent})),n,u().createElement(ym,{groupsAllowed:["Portfolio"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.addContent,showCancel:!1},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||this.state.isValid?null:u().createElement(sa,{message:"At least one content item (image/video) is required"}),this.props.children,this.state.showImageCropModal&&u().createElement(L,null,u().createElement(Iv,{src:this.state.content[this.state.imageCropIndex].coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}],r&&jg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Rg.propTypes=kg(kg({label:d().string,placeholder:d().string,helpMessage:d().string,content:d().array,required:d().bool,requiredErrorMessage:d().string,fileSizeLimit:d().number},"required",d().bool),"requiredErrorMessage",d().string),Rg.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};var Mg=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;Vv(this,n),qv(Hv(Hv(t=$v(this,Gv(n).call(this,e)))),"state",{}),qv(Hv(Hv(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=pg(e);var i=ag(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,s=i.sortableInfo,c=s.index,l=s.collection;if(s.disabled)return;if(a&&!ag(e.target,mg))return;t.manager.active={collection:l,index:c},function(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}(e)||e.target.tagName!==yg.Anchor||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),qv(Hv(Hv(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),qv(Hv(Hv(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=pg(e),a={x:t.position.x-i.x,y:t.position.y-i.y},s=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(s>=o)?r&&s>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),qv(Hv(Hv(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),qv(Hv(Hv(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),qv(Hv(Hv(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n,r,o,l,y,m,b,v=f.sortableInfo.index,g=(n=f,{bottom:cg((r=window.getComputedStyle(n)).marginBottom),left:cg(r.marginLeft),right:cg(r.marginRight),top:cg(r.marginTop)}),w=function(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:cg(t.gridColumnGap),y:cg(t.gridRowGap)}:{x:0,y:0}}(t.container),E=t.scrollContainer.getBoundingClientRect(),S=a({index:v,node:f,collection:h});if(t.node=f,t.margin=g,t.gridGap=w,t.width=S.width,t.height=S.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=f.getBoundingClientRect(),t.containerBoundingRect=E,t.index=v,t.newIndex=v,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=fg(f,t.container),t.initialOffset=pg(d?Kv({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild((l="input, textarea, select, canvas, [contenteditable]",y=(o=f).querySelectorAll(l),(b=(m=o.cloneNode(!0)).querySelectorAll(l),function(e){if(Array.isArray(e))return Av(e)}(b)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(b)||Lv(b)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e,t){"file"!==e.type&&(e.value=y[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===yg.Canvas&&y[t].width>0&&y[t].height>0&&e.getContext("2d").drawImage(y[t],0,0)})),m)),rg(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-g.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-g.top,"px"),width:"".concat(t.width,"px")}),d&&t.helper.focus(),c&&(t.sortableGhost=f,rg(f,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},d){var O=p?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,_=O.top,P=O.left,k=O.width,j=_+O.height,C=P+k;t.axis.x&&(t.minTranslate.x=P-t.boundingClientRect.left,t.maxTranslate.x=C-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=_-t.boundingClientRect.top,t.maxTranslate.y=j-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(p?0:E.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(p?t.contentWindow.innerWidth:E.left+E.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(p?0:E.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(p?t.contentWindow.innerHeight:E.top+E.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,d?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(tg.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),tg.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:v}),u&&u({node:f,index:v,collection:h,isKeySorting:d,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),d&&t.keyMove(0)},o=t.props,i=o.axis,a=o.getHelperDimensions,s=o.helperClass,c=o.hideSortableGhost,l=o.updateBeforeSortStart,u=o.onSortStart,p=o.useWindowAsScrollContainer,f=n.node,h=n.collection,d=t.manager.isKeySorting,y=function(){if("function"==typeof l){t._awaitingUpdateBeforeSortStart=!0;var n=function(t,n){try{var r=function(){var t=f.sortableInfo.index;return Promise.resolve(l({collection:h,index:t,node:f,isKeySorting:d},e)).then((function(){}))}()}catch(e){return n(!0,e)}return r&&r.then?r.then(n.bind(null,!1),n.bind(null,!0)):n(!1,value)}(0,(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),qv(Hv(Hv(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),qv(Hv(Hv(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,s=i.isKeySorting,c=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(tg.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),tg.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&rg(t.sortableGhost,{opacity:"",visibility:""});for(var l=0,u=c.length;l<u;l++){var p=c[l],f=p.node;p.edgeOffset=null,p.boundingClientRect=null,og(f,null),ig(f,null),p.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:c},e),t.touched=!1})),qv(Hv(Hv(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=Kv({},t.translate),o=0,i=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),i=t.translate.y-r.y),t.translate=r,og(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=i)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),qv(Hv(Hv(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),qv(Hv(Hv(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,o=r.shouldCancelStart,i=r.keyCodes,a=Kv({},gg,void 0===i?{}:i);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||a.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),a.lift.includes(n)&&!t.manager.active?t.keyLift(e):a.drop.includes(n)&&t.manager.active?t.keyDrop(e):a.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):a.up.includes(n)?t.keyMove(-1):a.down.includes(n)&&t.keyMove(1))})),qv(Hv(Hv(t)),"keyLift",(function(e){var n=e.target,r=ag(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=r.index,i=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:i},t.handlePress(e)})),qv(Hv(Hv(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,i=t.newIndex;if(!(o<0||o>r)){t.prevIndex=i,t.newIndex=o;var a=function(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===a})),c=s.node,l=t.containerScrollDelta,u=s.boundingClientRect||ug(c,l),p=s.translate||{x:0,y:0},f=u.top+p.y-l.top,h=u.left+p.x-l.left,d=i<o,y=d&&t.axis.x?c.offsetWidth-t.width:0,m=d&&t.axis.y?c.offsetHeight-t.height:0;t.handleSortMove({pageX:h+y,pageY:f+m,ignoreTransition:0===e})}})),qv(Hv(Hv(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),qv(Hv(Hv(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),qv(Hv(Hv(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,o=ag(r,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?mg(r):r.sortableInfo)}));var r=new Xv;return function(e){Yv()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}(e),t.manager=r,t.wrappedInstance=(0,l.createRef)(),t.sortableContextValue={manager:r},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return Jv(n,t),Wv(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:dg(e.container)||e.container,e.autoScroller=new bg(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return tg[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return tg[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,o=t.lockToContainerEdges,i=t.transitionDuration,a=t.keyboardSortingTransitionDuration,s=void 0===a?i:a,c=this.manager.isKeySorting,l=e.ignoreTransition,u=pg(e),p={x:u.x-this.initialOffset.x,y:u.y-this.initialOffset.y};if(p.y-=window.pageYOffset-this.initialWindowScroll.top,p.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=p,o){var f=function(e){var t=e.height,n=e.width,r=e.lockOffset,o=Array.isArray(r)?r:[r,r];Yv()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var i=Bv(o,2),a=i[0],s=i[1];return[hg({height:t,lockOffset:a,width:n}),hg({height:t,lockOffset:s,width:n})]}({height:this.height,lockOffset:r,width:this.width}),h=Bv(f,2),d=h[0],y=h[1],m={x:this.width/2-d.x,y:this.height/2-d.y},b={x:this.width/2-y.x,y:this.height/2-y.y};p.x=sg(this.minTranslate.x+m.x,this.maxTranslate.x-b.x,p.x),p.y=sg(this.minTranslate.y+m.y,this.maxTranslate.y-b.y,p.y)}"x"===n?p.y=0:"y"===n&&(p.x=0),c&&s&&!l&&ig(this.helper,s),og(this.helper,p)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,o=this.containerScrollDelta,i=this.windowScrollDelta,a=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+o.left,c=this.offsetEdge.top+this.translate.y+o.top,l=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var p=0,f=a.length;p<f;p++){var h=a[p].node,d=h.sortableInfo.index,y=h.offsetWidth,m=h.offsetHeight,b={height:this.height>m?m/2:this.height/2,width:this.width>y?y/2:this.width/2},v=l&&d>this.index&&d<=u,g=l&&d<this.index&&d>=u,w={x:0,y:0},E=a[p].edgeOffset;E||(E=fg(h,this.container),a[p].edgeOffset=E,l&&(a[p].boundingClientRect=ug(h,o)));var S=p<a.length-1&&a[p+1],O=p>0&&a[p-1];S&&!S.edgeOffset&&(S.edgeOffset=fg(S.node,this.container),l&&(S.boundingClientRect=ug(S.node,o))),d!==this.index?(t&&ig(h,t),this.axis.x?this.axis.y?g||d<this.index&&(s+i.left-b.width<=E.left&&c+i.top<=E.top+b.height||c+i.top+b.height<=E.top)?(w.x=this.width+this.marginOffset.x,E.left+w.x>this.containerBoundingRect.width-b.width&&S&&(w.x=S.edgeOffset.left-E.left,w.y=S.edgeOffset.top-E.top),null===this.newIndex&&(this.newIndex=d)):(v||d>this.index&&(s+i.left+b.width>=E.left&&c+i.top+b.height>=E.top||c+i.top+b.height>=E.top+m))&&(w.x=-(this.width+this.marginOffset.x),E.left+w.x<this.containerBoundingRect.left+b.width&&O&&(w.x=O.edgeOffset.left-E.left,w.y=O.edgeOffset.top-E.top),this.newIndex=d):v||d>this.index&&s+i.left+b.width>=E.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=d):(g||d<this.index&&s+i.left<=E.left+b.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=d)):this.axis.y&&(v||d>this.index&&c+i.top+b.height>=E.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=d):(g||d<this.index&&c+i.top<=E.top+b.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=d))),og(h,w),a[p].translate=w):n&&(this.sortableGhost=h,rg(h,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),l&&(this.newIndex=u);var _=l?this.prevIndex:u;r&&this.newIndex!==_&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:_,isKeySorting:l,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return Yv()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,y.findDOMNode)(this):e(r.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(Sg.Provider,{value:this.sortableContextValue},(0,l.createElement)(e,_e({ref:t},eg(this.props,Eg))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(l.Component),qv(t,"displayName",lg("sortableList",e)),qv(t,"defaultProps",wg),qv(t,"propTypes",vg),n}((function(e){var t=e.content,n=e.onEditThumbnail,r=e.onDelete,o=null!=t&&t.length>1,i=t.map((function(e,t){return u().createElement(Ag,{key:e.id,index:t,contentItem:e,onEditThumbnail:n,onDelete:r},o&&u().createElement(Ig,null))}));return u().createElement("ul",{className:"gallery-editor-content"},i)})),Ig=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Vv(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return qv(Hv(Hv(t=$v(this,(e=Gv(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,l.createRef)()),t}return Jv(n,t),Wv(n,[{key:"componentDidMount",value:function(){(0,y.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return Yv()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(e,_e({ref:t},this.props))}}]),n}(l.Component),qv(t,"displayName",lg("sortableHandle",e)),n}((function(){return u().createElement("span",{className:"handle no-select"},"::")})),Ag=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Vv(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return qv(Hv(Hv(t=$v(this,(e=Gv(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,l.createRef)()),t}return Jv(n,t),Wv(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=(0,y.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return Yv()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,l.createElement)(e,_e({ref:t},eg(this.props,_g)))}}]),n}(l.Component),qv(t,"displayName",lg("sortableElement",e)),qv(t,"contextType",Sg),qv(t,"propTypes",Og),qv(t,"defaultProps",{collection:0}),n}((function(e){var t=e.children,n=e.contentItem,r=e.onEditThumbnail,o=e.onDelete,i=[];return i.push(u().createElement("a",{onClick:r.bind(null,n.id)},"Edit Thumbnail")),i.push(u().createElement("a",{onClick:o.bind(null,n.id)},"Delete")),u().createElement("li",{className:"gallery-editor-content-item"},u().createElement("img",{className:"no-drag",src:n.thumbUrl}),u().createElement("div",{className:"edit"},t,!n.hasOwnProperty("isStatic")&&u().createElement(ko,{wrapperTag:"span",actionTag:"anchor",actionLabel:u().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})))}));const Lg=Rg;function Bg(e){return Bg="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},Bg(e)}function Fg(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,Ug(r.key),r)}}function Ug(e){var t=function(e,t){if("object"!=Bg(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Bg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Bg(t)?t:t+""}function qg(e,t,n){return t=Vg(t),function(e,t){if(t&&("object"===Bg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Kg()?Reflect.construct(t,n||[],Vg(e).constructor):t.apply(e,n))}function Kg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kg=function(){return!!e})()}function Vg(e){return Vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vg(e)}function zg(e,t){return zg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zg(e,t)}var Wg=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=qg(this,t,[e])).handleEditClick=n.handleEditClick.bind(n),n.handleEditCancel=n.handleEditCancel.bind(n),n.handleEditSaveChanges=n.handleEditSaveChanges.bind(n),n.state={mode:"view"},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zg(e,t)}(t,e),n=t,(r=[{key:"handleEditClick",value:function(){this.setState({mode:"edit"})}},{key:"handleEditCancel",value:function(){this.setState({mode:"view"})}},{key:"handleEditSaveChanges",value:function(){var e={headerContentList:null,thumbCropData:null};if(!this.refs.header.validate())return!1;var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData),$.ajax({type:"POST",url:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header"),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({mode:"view"},(function(){this.props.onUpdate(e.header)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}},{key:"render",value:function(){return"view"==this.state.mode?u().createElement("div",{className:"forum-project-gallery"},u().createElement(vv,{gallery:this.props.topic.header,aspectMultiplier:.5625,dataUrl:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header/{0}")},this.props.topic.viewer.canEdit&&u().createElement("div",{className:"edit"},u().createElement("button",{className:"icon icon-after icon-edit",onClick:this.handleEditClick},"Edit Gallery")))):u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Gallery Content"),u().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),u().createElement(Lg,{ref:"header",content:this.props.topic.header.content,required:!0},u().createElement("div",{style:{textAlign:"right"}},u().createElement("button",{onClick:this.handleEditCancel},"Cancel"),u().createElement("button",{onClick:this.handleEditSaveChanges},"Save Changes"))))}}])&&Fg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Wg.propTypes={onUpdate:d().func};const Hg=Wg;function $g(e){return $g="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},$g(e)}function Gg(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,Jg(r.key),r)}}function Jg(e){var t=function(e,t){if("object"!=$g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=$g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$g(t)?t:t+""}function Qg(e,t,n){return t=Xg(t),function(e,t){if(t&&("object"===$g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Yg()?Reflect.construct(t,n||[],Xg(e).constructor):t.apply(e,n))}function Yg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Yg=function(){return!!e})()}function Xg(e){return Xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xg(e)}function Zg(e,t){return Zg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zg(e,t)}const ew=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Qg(this,t,[e])).buildUrl=n.buildUrl.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.handleHeaderGalleryUpdate=n.handleHeaderGalleryUpdate.bind(n),n.parsedQS=yn.parse(e.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.mode=n.parsedQS.mode?n.parsedQS.mode:null,n.postID=n.parsedQS.postID?n.parsedQS.postID:null,n.show=n.parsedQS.show?n.parsedQS.show:null,n.ajaxError=null,n.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zg(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=yn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"componentDidUpdate",value:function(){}},{key:"buildUrl",value:function(){var e="/api/discuss/topic/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){vn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,null,null,e,this.show),this.props.history.push(t)}},{key:"handleHeaderGalleryUpdate",value:function(e){var t=JSON.parse(JSON.stringify(this.state.topic));t.header=e,this.setState({topic:t})}},{key:"render",value:function(){if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics)return u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(kn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(Sl,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}}));var e="".concat(window.location.origin).concat(this.state.topic.url);return this.page>0&&(e+="?page=".concat(this.page)),u().createElement("div",null,u().createElement(dn,null,u().createElement("title",null,this.state.topic.text),u().createElement("meta",{property:"og:url",content:"".concat(window.location.origin).concat(this.state.topic.url)}),u().createElement("meta",{property:"og:type",content:"article"}),u().createElement("meta",{property:"og:title",content:this.state.topic.text}),u().createElement("link",{rel:"canonical",href:e})),u().createElement(pp,{topic:this.state.topic,forumPath:this.state.forum.path},this.state.posts&&this.state.topic.viewer.e&&u().createElement(Mp,{topic:this.state.topic})),this.state.topic.header&&null!=this.state.topic.header&&u().createElement(Hg,{topic:this.state.topic,onUpdate:this.handleHeaderGalleryUpdate}),u().createElement(lb,{mode:"display",topic:this.state.topic,posts:this.state.posts,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))}}])&&Gg(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function tw(e){return tw="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},tw(e)}function nw(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,rw(r.key),r)}}function rw(e){var t=function(e,t){if("object"!=tw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=tw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tw(t)?t:t+""}function ow(e,t,n){return t=aw(t),function(e,t){if(t&&("object"===tw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,iw()?Reflect.construct(t,n||[],aw(e).constructor):t.apply(e,n))}function iw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iw=function(){return!!e})()}function aw(e){return aw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aw(e)}function sw(e,t){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sw(e,t)}const cw=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ow(this,t,[e])).buildUrl=n.buildUrl.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.parsedQS=yn.parse(e.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.mode=n.parsedQS.mode?n.parsedQS.mode:null,n.postID=n.parsedQS.postID?n.parsedQS.postID:null,n.show=n.parsedQS.show?n.parsedQS.show:null,n.ajaxError=null,n.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sw(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=yn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"buildUrl",value:function(){var e="/api/discuss/link/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){vn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.replace(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics?u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(kn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(Sl,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):null}}])&&nw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function lw(e){return lw="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},lw(e)}function uw(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,pw(r.key),r)}}function pw(e){var t=function(e,t){if("object"!=lw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lw(t)?t:t+""}function fw(e,t,n){return t=dw(t),function(e,t){if(t&&("object"===lw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hw()?Reflect.construct(t,n||[],dw(e).constructor):t.apply(e,n))}function hw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hw=function(){return!!e})()}function dw(e){return dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dw(e)}function yw(e,t){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yw(e,t)}const mw=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=fw(this,t,[e])).buildUrl=n.buildUrl.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.ajaxError=null,n.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,post:null,viewer:null,nav:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yw(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/post/"+this.props.match.params.id;return this.addQuerystring(e)}},{key:"addQuerystring",value:function(e){var t=[];return t.length>0&&(e+="?"+t.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,post:t.post,viewer:t.viewer,nav:t.nav})})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics||null===this.state.posts?u().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&u().createElement(kn,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&u().createElement(Sl,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):u().createElement("div",null,u().createElement(dn,null,u().createElement("title",null,this.state.topic.text),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.post.url)})),u().createElement(pp,{viewMode:"PostView",topic:this.state.topic,post:this.state.post,forumPath:this.state.forum.path}),u().createElement("div",{className:"subsection comment"},u().createElement("div",{className:"comment-container"},u().createElement(mh,{post:this.state.post,topic:this.state.topic,viewer:this.state.viewer,displayMode:"single"}))))}}])&&uw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function bw(e){return bw="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},bw(e)}function vw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gw(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,Ew(r.key),r)}}function ww(e,t,n){return t&&gw(e.prototype,t),n&&gw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ew(e){var t=function(e,t){if("object"!=bw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=bw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bw(t)?t:t+""}function Sw(e,t,n){return t=_w(t),function(e,t){if(t&&("object"===bw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ow()?Reflect.construct(t,n||[],_w(e).constructor):t.apply(e,n))}function Ow(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ow=function(){return!!e})()}function _w(e){return _w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_w(e)}function Pw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kw(e,t)}function kw(e,t){return kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kw(e,t)}var jw=function(e){function t(e){var n;vw(this,t),(n=Sw(this,t,[e])).setup=n.setup.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.handleDelayEnd=n.handleDelayEnd.bind(n),n.handleTopicChange=n.handleTopicChange.bind(n),n.handlePostChange=n.handlePostChange.bind(n),n.handleContentChange=n.handleContentChange.bind(n),n.handleSubscribeChange=n.handleSubscribeChange.bind(n),n.handleTopicLinkChange=n.handleTopicLinkChange.bind(n),n.parsedQS=yn.parse(e.location.search),n.viewer=null,n.forum=null;var r=n.props.location.pathname.split("/");return n.state={enabled:!1,type:r[2],mode:r[3],itemID:n.parsedQS.id,form:null,postValue:n.props.value?n.props.value:"",submitDisabled:!1,delay:!1,delayTimeSpan:null},n}return Pw(t,e),ww(t,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-regular light"),this.setup()}},{key:"setup",value:function(){var e="/api/discuss/topic/new?id="+this.state.itemID,t=this;$.getJSON(e).done((function(e,n,r){t.viewer=e.data.viewer,t.forum=e.data.forum,t.setState({enabled:!0,form:e.data.form,postValue:e.data.form.post})})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.props.history.goBack()}))}},{key:"handleCancel",value:function(){this.props.history.goBack()}},{key:"handleSubmit",value:function(){var e=!0;"topic"==this.state.type&&(e=this.refs.topic.validate());var t=!0;"Gallery"===this.state.form.type&&(t=this.refs.header.validate());var n=this.refs.post.validate();e&&t&&n&&this.setState({submitDisabled:!0},(function(){var e=this.state.form;if("Gallery"===this.state.form.type){var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData)}null!=e.postContent&&e.postContent.length>0&&(e.postContentList=e.postContent.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:"/api/discuss/topic/new?id="+this.state.itemID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){switch(e.data.result){case"Success":this.props.history.push(e.data.url);break;case"Delay":this.setState({submitDisabled:!0,delay:!0,delayTimeSpan:e.data.timeSpan});break;case"Refresh":alerts.warning("Possible unwanted content detected. Please edit your post. A moderator has been notified."),this.setState({submitDisabled:!1});break;case"Locked":alerts.error("Account Locked. A moderator has been notified and will review your account."),this.handleCancel()}})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}))}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handleTopicChange",value:function(e){var t=this.state.form;t.title=e,this.setState({form:t})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.postContent=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"handleTopicLinkChange",value:function(e){var t=this.state.form;t.topicLinkFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Start a new discussion in ",this.forum.name))),u().createElement("div",{className:"container subsection"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Cw,{ref:"topic",value:this.state.form.topic,onChange:this.handleTopicChange,enabled:this.state.enabled},u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),u().createElement("label",{htmlFor:"subscribeFL"},"Watch topic +")),this.viewer.e&&this.forum.allowTopicLink&&u().createElement("div",{className:"form-group"},u().createElement("input",{type:"checkbox",id:"linkFL",name:"linkFL",ref:"topicTopicFL",onChange:this.handleTopicLinkChange}),u().createElement("label",{htmlFor:"linkFL"},"Create Topic Link in News & Announcements"))),"Gallery"===this.state.form.type&&u().createElement("div",{className:"gallery-editor"},u().createElement("label",null,"Gallery Content"),u().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),u().createElement(Lg,{ref:"header",content:this.state.form.headerContent,required:!0})),u().createElement("div",{className:"post-editor"},u().createElement(ki,{profile:this.viewer.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),u().createElement(Rm,{ref:"post",type:"Discussion",value:null!=this.state.form.post?this.state.form.post:"",content:this.state.form.postContent,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:this.state.enabled},u().createElement("span",{className:"button-group"},u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),u().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&u().createElement(qm,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))))))}}])}(u().Component),Cw=function(e){function t(e){var n;return vw(this,t),(n=Sw(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.handleTopicChange=n.handleTopicChange.bind(n),n.handleFocus=n.handleFocus.bind(n),n.handleBlur=n.handleBlur.bind(n),n.state={isValid:!1,showValidation:!1},n}return Pw(t,e),ww(t,[{key:"componentDidMount",value:function(){this.handleTopicChange()}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleTopicChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.refs.title.value)}},{key:"handleFocus",value:function(){}},{key:"handleBlur",value:function(){}},{key:"render",value:function(){var e="form-group".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=null;return!0!==this.state.showValidation||this.state.isValid||(t=u().createElement(sa,{message:"topic required and must be 3 or more characters in length"})),u().createElement("div",{className:e},u().createElement("label",{className:"static"},"Discussion Title"),u().createElement("input",{type:"text",name:"title",ref:"title",defaultValue:this.props.value,placeholder:"Enter a discussion title",maxLength:"255",onChange:this.handleTopicChange,onFocus:this.handleFocus,onBlur:this.handleBlur,disabled:!this.props.enabled,tabIndex:"1",autoFocus:!0}),t,this.props.children)}}])}(u().Component);const Tw=it(jw);function xw(e){return xw="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},xw(e)}function Dw(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,Nw(r.key),r)}}function Nw(e){var t=function(e,t){if("object"!=xw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=xw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xw(t)?t:t+""}function Rw(e,t,n){return t=Iw(t),function(e,t){if(t&&("object"===xw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Mw()?Reflect.construct(t,n||[],Iw(e).constructor):t.apply(e,n))}function Mw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Mw=function(){return!!e})()}function Iw(e){return Iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Iw(e)}function Aw(e,t){return Aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Aw(e,t)}var Lw=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Rw(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n.onChange=n.onChange.bind(n),n.handleFocus=n.handleFocus.bind(n),n.handleBlur=n.handleBlur.bind(n),n.state={value:null!=n.props.value?n.props.value:"",validate:!1,isValid:!0,showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Aw(e,t)}(t,e),n=t,(r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=u().createElement(sa,{message:this.props.helpMessage}):e+=" no-help":t=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},u().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),u().createElement("input",{name:this.props.name,type:"text",value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&Dw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Lw.propTypes={name:d().string,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},Lw.defaultProps={required:!1,requiredErrorMessage:"input required."};const Bw=Lw;function Fw(e){return Fw="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},Fw(e)}function Uw(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,qw(r.key),r)}}function qw(e){var t=function(e,t){if("object"!=Fw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Fw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fw(t)?t:t+""}function Kw(e,t,n){return t=zw(t),function(e,t){if(t&&("object"===Fw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vw()?Reflect.construct(t,n||[],zw(e).constructor):t.apply(e,n))}function Vw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vw=function(){return!!e})()}function zw(e){return zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zw(e)}function Ww(e,t){return Ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ww(e,t)}var Hw=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Kw(this,t,[e])).getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n.setDisabled=n.setDisabled.bind(n),n.onChange=n.onChange.bind(n),n.state={value:!!n.props.value&&n.props.value,disabled:!!n.props.disabled&&n.props.disabled},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ww(e,t)}(t,e),n=t,(r=[{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==e&&(t=!1),this.setState({value:t})}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.checked;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){return u().createElement("div",{className:"form-group no-help"},u().createElement("input",{ref:"checkbox",type:"checkbox",id:this.props.name,name:this.props.name,checked:this.state.value,disabled:this.state.disabled,onChange:this.onChange}),u().createElement("label",{htmlFor:this.props.name},this.props.label))}}])&&Uw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Hw.propTypes={name:d().string.isRequired,label:d().string.isRequired,value:d().bool,disabled:d().bool,onChange:d().func};const $w=Hw;function Gw(e){return Gw="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},Gw(e)}function Jw(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,Qw(r.key),r)}}function Qw(e){var t=function(e,t){if("object"!=Gw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Gw(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Gw(t)?t:t+""}function Yw(e,t,n){return t=Zw(t),function(e,t){if(t&&("object"===Gw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Xw()?Reflect.construct(t,n||[],Zw(e).constructor):t.apply(e,n))}function Xw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xw=function(){return!!e})()}function Zw(e){return Zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zw(e)}function eE(e,t){return eE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eE(e,t)}var tE=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Yw(this,t,[e])).setValue=n.setValue.bind(n),n.getValue=n.getValue.bind(n),n.setDisabled=n.setDisabled.bind(n),n.onChange=n.onChange.bind(n),n.state={value:!!n.props.value&&n.props.value,disabled:!!n.props.disabled&&n.props.disabled},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eE(e,t)}(t,e),n=t,(r=[{key:"setValue",value:function(e){this.setState({value:e})}},{key:"getValue",value:function(){return this.state.value}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){return u().createElement("label",{key:t.value,className:"clearfix multi-select"},u().createElement("input",{name:e.props.name,checked:e.state.value==t.value,value:t.value,disabled:e.state.disabled,onChange:e.onChange,type:"radio"}),u().createElement("span",{className:"radio-multi-label"},t.text))})),n=this.props.label?u().createElement("label",{className:"static"},this.props.label):null,r="multi-radio-container";return this.props.className&&(r+=" ".concat(this.props.className)),u().createElement("div",{className:"form-group"},n,u().createElement("div",{className:r},t))}}])&&Jw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);tE.propTypes={name:d().string.isRequired,label:d().string,className:d().string,options:d().array.isRequired,value:d().string,disabled:d().bool,onChange:d().func};const nE=tE;function rE(e){return rE="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},rE(e)}function oE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iE(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,sE(r.key),r)}}function aE(e,t,n){return t&&iE(e.prototype,t),n&&iE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sE(e){var t=function(e,t){if("object"!=rE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rE(t)?t:t+""}function cE(e,t,n){return t=uE(t),function(e,t){if(t&&("object"===rE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lE()?Reflect.construct(t,n||[],uE(e).constructor):t.apply(e,n))}function lE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lE=function(){return!!e})()}function uE(e){return uE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uE(e)}function pE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fE(e,t)}function fE(e,t){return fE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fE(e,t)}var hE=function(e){function t(){return oE(this,t),cE(this,t,arguments)}return pE(t,e),aE(t,[{key:"render",value:function(){var e=[];return this.props.posts.data.forEach((function(t,n){e.push(u().createElement(dE,{key:"p:"+t.postID,post:t}))})),u().createElement("div",{className:"thread-container subsection"},this.props.posts.totalPages>1?u().createElement(Ln,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged},u().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"post":"posts")):u().createElement("div",{className:"gallery-list-info"},u().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"Post":"Posts")),e,this.props.posts.totalPages>1&&u().createElement(Ln,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}])}(u().Component),dE=function(e){function t(){return oE(this,t),cE(this,t,arguments)}return pE(t,e),aE(t,[{key:"render",value:function(){var e=this.props.post;return u().createElement("article",{className:"post-extended"},u().createElement("div",{className:"post-header"},u().createElement("h3",null,u().createElement("a",{href:e.topicUrl},e.topicTitle)),u().createElement(es,{displayMode:"Search",path:e.forumPath})),u().createElement("div",{className:"post-body"},u().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),u().createElement("div",{className:"post-footer"},u().createElement(cs,{data:e.addedBy,addClass:" started"}),e.rating>0&&u().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating))))}}])}(u().Component);const yE=hE;function mE(e){return mE="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},mE(e)}function bE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vE(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,wE(r.key),r)}}function gE(e,t,n){return t&&vE(e.prototype,t),n&&vE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wE(e){var t=function(e,t){if("object"!=mE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mE(t)?t:t+""}function EE(e,t,n){return t=OE(t),function(e,t){if(t&&("object"===mE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,SE()?Reflect.construct(t,n||[],OE(e).constructor):t.apply(e,n))}function SE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(SE=function(){return!!e})()}function OE(e){return OE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OE(e)}function _E(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PE(e,t)}function PE(e,t){return PE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PE(e,t)}var kE=function(e){function t(e){var n;return bE(this,t),(n=EE(this,t,[e])).setup=n.setup.bind(n),n.getData=n.getData.bind(n),n.handleSearch=n.handleSearch.bind(n),n.updateFormFromAdvanced=n.updateFormFromAdvanced.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.addQuerystring=n.addQuerystring.bind(n),n.handleAdvancedClick=n.handleAdvancedClick.bind(n),n.handleDisplayChange=n.handleDisplayChange.bind(n),n.clearForm=n.clearForm.bind(n),n.handleClear=n.handleClear.bind(n),n.page=0,n.form={query:null,display:"Posts",sortOptions:null,sortBy:null},n.state={hasLoaded:!1,showLoader:!1,showAdvanced:!1,display:"Posts",results:null,viewer:null},n}return _E(t,e),gE(t,[{key:"componentDidMount",value:function(){this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=yn.parse(e.location.search),e.location&&e.location.search&&this.parsedQS.q?(null!=e.location.search&&null!=this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()):(this.page=0,this.handleClear())}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/search").done((function(t,n,r){e.form=t.form,e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"getData",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/forum/search".concat(this.page>0?"?page=".concat(this.page):""),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.form}),dataType:"json",context:this}).done((function(e,n,r){t.setState({showLoader:!1,results:e.searchResults,viewer:e.viewer},(function(){vn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({showLoader:!1,results:null,viewer:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleSearch",value:function(e){if(e.preventDefault(),this.page=0,this.refs.query.validate()){this.form.query=this.refs.query.getValue(),this.form.limitToTopicTitle=this.refs.limitToTopicTitle.getValue(),this.form.display=this.refs.display.getValue(),this.form.sortBy=this.refs.sort.getValue(),!0===this.state.showAdvanced&&this.updateFormFromAdvanced();var t=this;this.setState({results:null,viewer:null,showLoader:!0},(function(){var e=t.addQuerystring(t.props.location.pathname);t.props.history.push(e)}))}}},{key:"updateFormFromAdvanced",value:function(){var e=this.refs.advanced.getValue();this.form.profile=e.profile,this.form.limitToProfile=e.limitToProfile,this.form.limitToForums=e.limitToForums}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname);this.props.history.push(t)}},{key:"addQuerystring",value:function(e){var t=[];return null!=this.form&&(this.form.query&&""!=this.form.query&&t.push("q="+encodeURIComponent(this.form.query)),this.form.display&&"Posts"!=this.form.display&&t.push("display="+encodeURIComponent(this.form.display)),this.form.sortBy&&"Newest"!=this.form.sortBy&&t.push("sortBy="+encodeURIComponent(this.form.sortBy))),this.page>0&&t.push("page="+this.page),t.length>0&&(e+="?"+t.join("&")),e}},{key:"handleAdvancedClick",value:function(e){e.preventDefault(),this.state.showAdvanced&&this.updateFormFromAdvanced(),this.setState({showAdvanced:!this.state.showAdvanced})}},{key:"handleDisplayChange",value:function(e){this.form.display=e,this.refs.limitToTopicTitle.setDisabled("Topics"!=e),null!=this.state.results?this.setState({display:e,results:null}):this.setState({display:e})}},{key:"clearForm",value:function(){this.form.query=null,this.form.display="Posts",this.form.profile=null,this.form.limitToProfile=!1,this.form.limitToForums=[],this.form.sortBy="Newest"}},{key:"handleClear",value:function(e){e&&e.preventDefault(),this.refs.query.setValue(null),this.refs.display.setValue("Posts"),this.refs.limitToTopicTitle.setValue(!1),this.refs.limitToTopicTitle.setDisabled(!0),!0===this.state.showAdvanced&&this.refs.advanced.clearValues(),this.page=0,this.clearForm(),this.setState({display:"Posts",results:null,viewer:null})}},{key:"render",value:function(){if(!this.state.hasLoaded)return u().createElement(kn,null);var e=null;return!0===this.state.showLoader?e=u().createElement(kn,null):null!=this.state.results&&(null==this.state.results.data||0==this.state.results.data.length?e=u().createElement("div",{className:"no-content"},"No Results Found"):"Topics"==this.form.display?e=u().createElement(Es,{topics:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}):"Posts"==this.form.display&&(e=u().createElement(yE,{posts:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))),u().createElement("div",null,u().createElement(dn,null,u().createElement("title",null,"Forum Search"),u().createElement("meta",{name:"description",content:"Search and discover all of our Forums in our Community."})),u().createElement("div",{className:"subsection"},u().createElement("div",{className:"forum-search-container"},u().createElement("form",{onSubmit:this.handleSearch},u().createElement(Bw,{ref:"query",name:"query",label:"Search",placeholder:"Search...",required:!0,requiredErrorMessage:"Search query required."}),u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"panel-left",style:{verticalAlign:"baseline"}},u().createElement("div",{className:"panel-inline",style:{marginRight:"20px"}},u().createElement(nE,{ref:"display",name:"first",label:"Display",options:[{text:"Posts",value:"Posts"},{text:"Topics",value:"Topics"}],value:this.form.display,onChange:this.handleDisplayChange})),u().createElement("div",{className:"panel-inline"},u().createElement($w,{ref:"limitToTopicTitle",name:"limitToTopicTitle",label:"Limit search to topic title",value:!1,disabled:"Topics"!=this.state.display}))),u().createElement("div",{className:"panel-right"},u().createElement(wp,{ref:"sort",label:"Sort by",options:"Posts"==this.state.display?this.form.postSortOptions:this.form.topicSortOptions,value:this.form.sortBy}))),u().createElement("div",{className:"forum-search-advanced"},u().createElement("a",{href:"#",onClick:this.handleAdvancedClick},"Advanced Options ",u().createElement("span",{className:"caret"}))),this.state.showAdvanced&&u().createElement(jE,{ref:"advanced",form:this.form}),u().createElement("div",{className:"forum-search-button"},u().createElement("button",{className:"btn btn-default",type:"button",onClick:this.handleClear},"Clear"),u().createElement("button",{className:"btn btn-primary",type:"submit"},"Search"))),e)))}}])}(u().Component),jE=function(e){function t(e){var n;return bE(this,t),(n=EE(this,t,[e])).getValue=n.getValue.bind(n),n.clearValues=n.clearValues.bind(n),n}return _E(t,e),gE(t,[{key:"getValue",value:function(){return{profile:this.refs.profile.getValue(),limitToProfile:this.refs.limitToProfile.getValue(),limitToForums:this.refs.limitToForums.getSelectedForums()}}},{key:"clearValues",value:function(){this.refs.profile.setValue(""),this.refs.limitToProfile.setValue(!1),this.refs.limitToForums.clearSelectedForums()}},{key:"render",value:function(){return u().createElement("div",{className:"forum-search-advanced-container clearfix"},u().createElement("div",{className:"panel-left form-group"},u().createElement("label",{className:"static"},"Filter results by forums"),u().createElement(La,{ref:"limitToForums",forums:this.props.form.limitToForumOptions,selectedForums:this.props.form.limitToForums,style:{marginTop:"10px"}})),u().createElement("div",{className:"panel-right"},u().createElement(Bw,{ref:"profile",name:"profile",label:"Filter results by profile",placeholder:"Filter results by profile...",required:!1},u().createElement($w,{ref:"limitToProfile",name:"limitToProfile",label:"Limit to topics started by profile",value:!1}))))}}])}(u().Component);const CE=it(kE);function TE(e){return TE="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},TE(e)}function xE(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,DE(r.key),r)}}function DE(e){var t=function(e,t){if("object"!=TE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=TE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==TE(t)?t:t+""}function NE(e,t,n){return t=ME(t),function(e,t){if(t&&("object"===TE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,RE()?Reflect.construct(t,n||[],ME(e).constructor):t.apply(e,n))}function RE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(RE=function(){return!!e})()}function ME(e){return ME=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ME(e)}function IE(e,t){return IE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IE(e,t)}const AE=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=NE(this,t,[e])).getData=n.getData.bind(n),n.postID=n.props.match.params.id,n.contentID=n.props.match.params.contentid,n.isModal=n.props.location.state&&n.props.location.state.modal,n.state={content:null,support:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IE(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.isModal||$("body").attr("class","hero-content forum"),this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/forum/content-view?postID=".concat(this.postID,"&contentID=").concat(this.contentID)).done((function(t,n,r){e.setState({content:t.content,support:t.support})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){if(null==this.state.content)return null;this.isModal&&"Video"==this.state.content.type&&$(".tf-overlay-content").css("width","100%");var e=null,t=null;return this.isModal||(e="contentview-container",t="contentview-body"),u().createElement("div",{className:e},!this.isModal&&u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper clearfix"},u().createElement("h2",null,"Content from topic: ",this.state.support.title),u().createElement("h3",null,u().createElement(ft,{to:this.state.support.url},u().createElement("i",{className:"fa fa-long-arrow-left"})," View Post"))))),u().createElement("div",{className:t},u().createElement(lv,{content:this.state.content})))}}])&&xE(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function LE(e){return LE="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},LE(e)}function BE(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,FE(r.key),r)}}function FE(e){var t=function(e,t){if("object"!=LE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=LE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LE(t)?t:t+""}function UE(e,t,n){return t=KE(t),function(e,t){if(t&&("object"===LE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qE()?Reflect.construct(t,n||[],KE(e).constructor):t.apply(e,n))}function qE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qE=function(){return!!e})()}function KE(e){return KE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KE(e)}function VE(e,t){return VE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VE(e,t)}var zE=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=UE(this,t,[e])).handleOverlayClose=n.handleOverlayClose.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VE(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"handleOverlayClose",value:function(){this.props.history.goBack()}},{key:"render",value:function(){var e=this.props.location.state&&this.props.location.state.background;return u().createElement(ot,null,u().createElement(rt,{path:["/discuss/forum/:id/:slug?","/discuss/projects/:id/:slug?","/discuss/topic/new","/discuss/topic/:id/:slug?","/discuss/link/:id/:slug?","/discuss/post/:id","/discuss/post/:id/content/:contentid"]},u().createElement(ot,{location:e||this.props.location},u().createElement(rt,{path:"/discuss/forum/:id/:slug?",component:Iu}),u().createElement(rt,{path:"/discuss/projects/:id/:slug?",component:Iu}),u().createElement(rt,{path:"/discuss/topic/new",component:Tw}),u().createElement(rt,{path:"/discuss/topic/:id/:slug?",component:ew}),u().createElement(rt,{path:"/discuss/link/:id/:slug?",component:cw}),u().createElement(rt,{path:"/discuss/post/:id/content/:contentid",component:AE}),u().createElement(rt,{path:"/discuss/post/:id",component:mw})),e&&u().createElement(rt,{path:"/discuss/post/:id/content/:contentid"},u().createElement(L,{showClose:!0,closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleOverlayClose},u().createElement(AE,null)))),u().createElement(rt,{path:["/discuss/search","/discuss/group/:id/:slug?","/discuss/:root","/discuss"]},u().createElement("section",{id:"heroBanner",style:{backgroundImage:"url(/common/img/assets/headers/discuss_header_3.jpg)"}},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discuss"))),u().createElement(ot,null,u().createElement(rt,{path:"/discuss/search",component:CE}),u().createElement(rt,{path:"/discuss/group/:id/:slug?",component:$l}),u().createElement(rt,{path:"/discuss/:root",component:$l}),u().createElement(rt,{exact:!0,path:"/discuss",component:$l}))))}}])&&BE(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));const WE=function(e){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Discuss | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(at,null,u().createElement(zE,null)))};function HE(e){return HE="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},HE(e)}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,GE(r.key),r)}}function GE(e){var t=function(e,t){if("object"!=HE(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=HE(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HE(t)?t:t+""}function JE(e,t,n){return t=YE(t),function(e,t){if(t&&("object"===HE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,QE()?Reflect.construct(t,n||[],YE(e).constructor):t.apply(e,n))}function QE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(QE=function(){return!!e})()}function YE(e){return YE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YE(e)}function XE(e,t){return XE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XE(e,t)}var ZE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),JE(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XE(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=[];this.props.project.tagLinks&&(this.props.project.tagLinks.contentType&&(e=this.props.project.tagLinks.contentType.map((function(e,t){return u().createElement("span",{key:"c".concat(t),className:"type-c"},u().createElement("a",{href:e.url},e.text))}))),this.props.project.tagLinks.product&&(e=e.concat(this.props.project.tagLinks.product.map((function(e,t){return u().createElement("span",{key:"p".concat(t),className:"type-p"},u().createElement("a",{href:e.url},e.text))})))),this.props.project.tagLinks.usageRights&&(e=e.concat(this.props.project.tagLinks.usageRights.map((function(e,t){return u().createElement("span",{key:"u".concat(t),className:"type-u"},u().createElement("a",{href:e.url},e.text))})))));var t=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:"card"},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("div",{className:"text-container"},u().createElement("h4",null,u().createElement("a",{href:this.props.project.url,dangerouslySetInnerHTML:vn.createMarkup(t)})),u().createElement("div",{className:"tag-links"},e),this.props.children))}}])&&$E(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);ZE.propTypes={project:d().object.isRequired};const eS=ZE;function tS(e){return tS="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},tS(e)}function nS(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,rS(r.key),r)}}function rS(e){var t=function(e,t){if("object"!=tS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=tS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tS(t)?t:t+""}function oS(e,t,n){return t=aS(t),function(e,t){if(t&&("object"===tS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,iS()?Reflect.construct(t,n||[],aS(e).constructor):t.apply(e,n))}function iS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(iS=function(){return!!e})()}function aS(e){return aS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},aS(e)}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sS(e,t)}var cS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oS(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sS(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=null;this.props.collection.attributes.duration&&(e=vn.niceDuration(this.props.collection.attributes.duration));var t=null;null!=this.props.collection.experienceLevel&&"None"!=this.props.collection.experienceLevel&&(t=TFWeb.Resources.UI.getString("Experience.".concat(this.props.collection.experienceLevel)));var n=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(n=this.props.collection.bulletPoints.map((function(e,t){return u().createElement("div",{className:e.type.toLowerCase(),key:t},e.title,", ",u().createElement("span",{dangerouslySetInnerHTML:vn.createMarkup(e.text)}))})));var r=null;if(null!=this.props.collection.productReleases){var o="foundry foundry-".concat(this.props.collection.productReleases.logoClass);r=u().createElement("div",{className:"software"},u().createElement("i",{className:o})," ",this.props.collection.productReleases.names.map((function(e,t){return u().createElement("span",{key:t},e)})))}return u().createElement("article",{className:"card course"},u().createElement("a",{href:this.props.collection.url,className:"card-image"},u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("a",{href:this.props.collection.url,className:"text-container"},u().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.title)}),this.props.collection.itemCount>0&&u().createElement("div",{className:"duration"},u().createElement("span",null,this.props.collection.itemCount," ",1==this.props.collection.itemCount?TFWeb.Resources.UI.Video:TFWeb.Resources.UI.Videos,null!=e?",":"")," ",null!=e&&u().createElement("span",null,e)),n,u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.description)})),(null!=r||null!=t)&&u().createElement("div",{className:"info"},null!=r&&r,null!=t&&u().createElement("div",{className:"experience"},t)))}}])&&nS(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);cS.propTypes={collection:d().object.isRequired},cS.defaultProps={showProfile:!1};const lS=cS;function uS(e){return uS="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},uS(e)}function pS(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,fS(r.key),r)}}function fS(e){var t=function(e,t){if("object"!=uS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uS(t)?t:t+""}function hS(e,t,n){return t=yS(t),function(e,t){if(t&&("object"===uS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dS()?Reflect.construct(t,n||[],yS(e).constructor):t.apply(e,n))}function dS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dS=function(){return!!e})()}function yS(e){return yS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yS(e)}function mS(e,t){return mS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mS(e,t)}var bS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hS(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mS(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.galleryData.map((function(t,n){switch(e.props.galleryOf){case"Project":return"Catalogue"===t.type?u().createElement(eS,{key:t.id,project:t}):u().createElement(Ii,{key:t.id,project:t});case"Collection":return"Course"===t.type?u().createElement(lS,{key:t.id,collection:t}):u().createElement(Lc,{key:t.id,collection:t})}}));return u().createElement(Cc,null,u().createElement("div",null,t))}}])&&pS(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);bS.propTypes={galleryData:d().array.isRequired,galleryOf:d().string};const vS=bS;function gS(e){return gS="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},gS(e)}function wS(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,ES(r.key),r)}}function ES(e){var t=function(e,t){if("object"!=gS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gS(t)?t:t+""}function SS(e,t,n){return t=_S(t),function(e,t){if(t&&("object"===gS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,OS()?Reflect.construct(t,n||[],_S(e).constructor):t.apply(e,n))}function OS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(OS=function(){return!!e})()}function _S(e){return _S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_S(e)}function PS(e,t){return PS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},PS(e,t)}var kS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),SS(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PS(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){"Asset"==this.props.project.type&&this.props.project.contents&&this.props.project.contents.map((function(e,t){var n="c"+t;return u().createElement("span",{key:n,className:"content-type"},e)}));var e=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return u().createElement("article",{className:"card cattery"},u().createElement("a",{href:this.props.project.url,className:"card-image"},u().createElement("img",{src:this.props.project.thumbUrl})),u().createElement("a",{href:this.props.project.url,className:"text-container"},u().createElement("h4",{dangerouslySetInnerHTML:vn.createMarkup(e)}),this.props.project.description&&u().createElement("p",{dangerouslySetInnerHTML:vn.createMarkup(this.props.project.description)})),this.props.children)}}])&&wS(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);kS.propTypes={project:d().object.isRequired,showProfile:d().bool},kS.defaultProps={showProfile:!0};const jS=kS;function CS(e){return CS="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},CS(e)}function TS(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,xS(r.key),r)}}function xS(e){var t=function(e,t){if("object"!=CS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=CS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==CS(t)?t:t+""}function DS(e,t,n){return t=RS(t),function(e,t){if(t&&("object"===CS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,NS()?Reflect.construct(t,n||[],RS(e).constructor):t.apply(e,n))}function NS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(NS=function(){return!!e})()}function RS(e){return RS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RS(e)}function MS(e,t){return MS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},MS(e,t)}var IS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),DS(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MS(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(null==this.props.gallery.data||0==this.props.gallery.data.length)return u().createElement("div",{className:"no-content"},"No Content Found");var e=this,t=this.props.gallery.data.map((function(t,n){switch(e.props.galleryOf){case"Project":return"Catalogue"==t.type?u().createElement(eS,{key:t.id,project:t}):"Cattery"==t.type?u().createElement(jS,{key:t.id,project:t,showProfile:!0}):u().createElement(Ii,{key:t.id,project:t,showProfile:!0});case"Collection":return"Course"===t.type?u().createElement(lS,{key:t.id,collection:t}):u().createElement(Lc,{key:t.id,collection:t})}}));return t=u().createElement("div",null,t),u().createElement("div",{className:"cards-container"},this.props.children&&this.props.children,this.props.gallery.totalPages>1&&u().createElement(Ln,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged,enableKeyEvents:!0,baseUrl:this.props.baseUrl}),t,this.props.gallery.totalPages>1&&u().createElement(Ln,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged,baseUrl:this.props.baseUrl}))}}])&&TS(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);IS.propTypes={gallery:d().object.isRequired,galleryOf:d().string,baseUrl:d().string},IS.defaultProps={galleryOf:"Project"};const AS=IS;function LS(e){return LS="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},LS(e)}function BS(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,FS(r.key),r)}}function FS(e){var t=function(e,t){if("object"!=LS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=LS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LS(t)?t:t+""}function US(e,t,n){return t=KS(t),function(e,t){if(t&&("object"===LS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qS()?Reflect.construct(t,n||[],KS(e).constructor):t.apply(e,n))}function qS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qS=function(){return!!e})()}function KS(e){return KS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KS(e)}function VS(e,t){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},VS(e,t)}var zS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),US(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VS(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"asset-download"},u().createElement("div",{className:"info"},u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",null,u().createElement("p",{className:"title"},this.props.content.title),u().createElement("span",{className:"format"},this.props.content.resourceFormat),u().createElement("span",{className:"filesize"},this.props.content.size))),this.props.children)}}])&&BS(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);zS.propTypes={content:d().object};const WS=zS;function HS(e){return HS="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},HS(e)}function $S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GS(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,QS(r.key),r)}}function JS(e,t,n){return t&&GS(e.prototype,t),n&&GS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QS(e){var t=function(e,t){if("object"!=HS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=HS(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HS(t)?t:t+""}function YS(e,t,n){return t=ZS(t),function(e,t){if(t&&("object"===HS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,XS()?Reflect.construct(t,n||[],ZS(e).constructor):t.apply(e,n))}function XS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(XS=function(){return!!e})()}function ZS(e){return ZS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZS(e)}function eO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tO(e,t)}function tO(e,t){return tO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tO(e,t)}var nO=function(e){function t(e){var n;return $S(this,t),(n=YS(this,t,[e])).getData=n.getData.bind(n),n.onCartClick=n.onCartClick.bind(n),n.handleCartClose=n.handleCartClose.bind(n),n.refresh=n.refresh.bind(n),n.addToCart=n.addToCart.bind(n),n.onRemoveFromCart=n.onRemoveFromCart.bind(n),n.onRemoveAllFromCart=n.onRemoveAllFromCart.bind(n),n.onDownloadAll=n.onDownloadAll.bind(n),n.state={loadStatus:c.LoadStatus.PreLoad,showCart:!1,content:null,highlightCount:!1},n}return eO(t,e),JS(t,[{key:"componentDidMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/share/cart/get").done((function(t,n,r){e.setState({loadStatus:c.LoadStatus.Loaded,content:t})})).fail((function(t,n,r){e.ajaxError=t}))}},{key:"onCartClick",value:function(){this.setState({showCart:!0})}},{key:"handleCartClose",value:function(e){this.setState({showCart:!1})}},{key:"refresh",value:function(){this.getData()}},{key:"addToCart",value:function(e){$.ajax({type:"POST",url:"/api/share/cart/add",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({content:e,highlightCount:!0},(function(){var e=this;setTimeout((function(){e.setState({highlightCount:!1})}),1e3)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveFromCart",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/share/cart/remove",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,n,r){t.setState({content:e})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveAllFromCart",value:function(){var e=this;$.ajax({type:"POST",url:"/api/share/cart/remove-all",contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(t,n,r){e.setState({content:null})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onDownloadAll",value:function(e){this.setState({showCart:!1,loadStatus:c.LoadStatus.PreLoad,content:null},(function(){window.location.replace("/share/cart/download?format="+e)}))}},{key:"render",value:function(){var e="asset-download-cart".concat(!0===this.props.inline?" inline":""),t=this.state.content?this.state.content.length:0,n="count".concat(!0===this.state.highlightCount?" highlight":"");return u().createElement("div",{className:e,ref:"cart"},u().createElement("button",{type:"button",className:"btn btn-small show-cart",onClick:this.onCartClick},"Download Cart ",u().createElement("i",{className:"fa fa-shopping-cart"}),t>0&&u().createElement("span",{className:n},t)),!0===this.state.showCart&&this.state.loadStatus==c.LoadStatus.Loading&&u().createElement(kn,null),!0===this.state.showCart&&this.state.loadStatus==c.LoadStatus.Loaded&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.handleCartClose,contentStyle:{backgroundColor:"white"}},u().createElement(rO,{content:this.state.content,onRemoveFromCart:this.onRemoveFromCart,onRemoveAllFromCart:this.onRemoveAllFromCart,onDownloadAll:this.onDownloadAll})))}}])}(u().Component);nO.propTypes={inline:d().bool},nO.defaultProps={inline:!1};var rO=function(e){function t(){return $S(this,t),YS(this,t,arguments)}return eO(t,e),JS(t,[{key:"render",value:function(){var e=[],t=this.props.content?this.props.content.length:0;return t>0?this.props.content.forEach((function(t,n){e.push(u().createElement(WS,{key:t.id,content:t},u().createElement("button",{className:"remove",type:"button",onClick:this.props.onRemoveFromCart.bind(null,t.data)},u().createElement("i",{className:"glyphicon glyphicon-remove"}))))}),this):e.push(u().createElement("div",{key:"e",className:"empty"},"Download Cart is empty")),u().createElement("div",{className:"asset-download-cart-contents clearfix"},t>1&&u().createElement("div",{style:{textAlign:"right",marginBottom:"10px"}},u().createElement("button",{type:"button",onClick:this.props.onRemoveAllFromCart},"Clear Download Cart")),e,t>0&&u().createElement("div",{className:"asset-download-cart-buttons"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"ModoPackage")},"Download All as Modo Package (.lpk)"),u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"Zip")},"Download All as Zip")))}}])}(u().Component);const oO=nO;function iO(e){return iO="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},iO(e)}function aO(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,sO(r.key),r)}}function sO(e){var t=function(e,t){if("object"!=iO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=iO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==iO(t)?t:t+""}function cO(e,t,n){return t=uO(t),function(e,t){if(t&&("object"===iO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lO()?Reflect.construct(t,n||[],uO(e).constructor):t.apply(e,n))}function lO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lO=function(){return!!e})()}function uO(e){return uO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uO(e)}function pO(e,t){return pO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pO(e,t)}const fO=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=cO(this,t,[e])).getIndex=n.getIndex.bind(n),n.buildQuerystring=n.buildQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.state={hasLoaded:!1,loadStatus:c.LoadStatus.PreLoad,filter:null,gallery:null,galleryOf:null,viewer:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pO(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.getIndex()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&this.getData(e)}},{key:"getIndex",value:function(){var e=this,t="/api/".concat(this.props.section,"/get-index").concat(this.props.location.search);$.getJSON(t).done((function(t,n,r){e.setState({gallery:t.gallery,galleryOf:t.galleryOf,filter:t.filter,viewer:t.viewer,loadStatus:c.LoadStatus.Loaded},(function(){$("#globalFooter").removeClass("hide")}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"buildQuerystring",value:function(e,t){var n=[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&null!=e[r]&&e[r].value&&""!=e[r].value&&("Query"===e[r].type?n.push("".concat(r,"=").concat(encodeURIComponent(e[r].value))):n.push("".concat(r,"=").concat(e[r].value)));t&&t>0&&n.push("page=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"getData",value:function(e){var t=this,n="/api/".concat(this.props.section,"/get").concat(e.location.search);$.getJSON(n).done((function(n,r,o){var i=t.state.filter;if(i&&null!=i&&e.location.search&&null!=e.location.search){var a=yn.parse(e.location.search);for(var s in i)if(i.hasOwnProperty(s)&&null!=i[s]){var c="";a[s]&&(c=a[s]),i[s].value=c}}if(null!=n.filter)for(var l in n.filter)i[l]=n.filter[l];t.setState({gallery:n.gallery,galleryOf:n.galleryOf,filter:i},(function(){vn.updateScrollPosition(!0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.props.location.pathname;e+=t.buildQuerystring(t.state.filter,0),t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname+this.buildQuerystring(this.state.filter,e);this.props.history.push(t)}},{key:"buildBaseUrl",value:function(){return this.props.location.pathname+this.buildQuerystring(this.state.filter,null)}},{key:"render",value:function(){if(this.state.loadStatus!=c.LoadStatus.Loaded)return u().createElement(kn,null);if(this.state.loadStatus==c.LoadStatus.Loaded&&null==this.state.gallery)return u().createElement("div",{className:"no-content"},"No Content Found");var e=this.buildBaseUrl();return u().createElement(Rr,{marginTop:!0},u().createElement(bi,{filter:this.state.filter,onChange:this.handleFilterChange,embeddedNav:this.props.embeddedNav}),u().createElement(AS,{gallery:this.state.gallery,galleryOf:this.state.galleryOf,onPageChanged:this.handleNewPage,baseUrl:e},"share"==this.props.section&&this.state.viewer&&!0===this.state.viewer.isSignedIn&&u().createElement(oO,{inline:this.state.gallery.totalPages>1})))}}])&&aO(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function hO(e){return hO="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},hO(e)}function dO(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,yO(r.key),r)}}function yO(e){var t=function(e,t){if("object"!=hO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hO(t)?t:t+""}function mO(e,t,n){return t=vO(t),function(e,t){if(t&&("object"===hO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bO()?Reflect.construct(t,n||[],vO(e).constructor):t.apply(e,n))}function bO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bO=function(){return!!e})()}function vO(e){return vO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vO(e)}function gO(e,t){return gO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gO(e,t)}var wO=it(function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mO(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gO(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))})),$("#globalFooter").removeClass("hide")}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(ot,null,u().createElement(rt,{path:"/watch/:product/heroes",component:function(e){return u().createElement(EO,{section:"watch/".concat(e.match.params.product,"/heroes")})}}),u().createElement(rt,{path:"/watch/media"},u().createElement(SO,null)),u().createElement(rt,{path:"/watch"},u().createElement(SO,null)))}}])&&dO(n.prototype,r),o&&dO(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(u().Component));function EO(e){return u().createElement(u().Fragment,null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Modo Heroes"),u().createElement("h3",null,"Where Modo skills are a superpower"))),u().createElement(fO,{type:"Training",section:e.section}))}function SO(e){return u().createElement(u().Fragment,null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Become a Better Artist"))),u().createElement(fO,{type:"Training",section:"watch"}))}u().Component;const OO=function(e){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Watch | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(at,null,u().createElement(wO,null)))};function _O(e){return _O="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},_O(e)}function PO(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,kO(r.key),r)}}function kO(e){var t=function(e,t){if("object"!=_O(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=_O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_O(t)?t:t+""}function jO(e,t,n){return t=TO(t),function(e,t){if(t&&("object"===_O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,CO()?Reflect.construct(t,n||[],TO(e).constructor):t.apply(e,n))}function CO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(CO=function(){return!!e})()}function TO(e){return TO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},TO(e)}function xO(e,t){return xO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xO(e,t)}const DO=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),jO(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xO(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("nav",{className:"full-width-tabs"},u().createElement("div",{className:"mobile-options-wrapper"},u().createElement("ul",{className:"tftabs"},this.props.tabs.map((function(e,t){return u().createElement("li",{key:t},e)})))))}}])&&PO(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function NO(e){return NO="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},NO(e)}function RO(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,MO(r.key),r)}}function MO(e){var t=function(e,t){if("object"!=NO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=NO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==NO(t)?t:t+""}function IO(e,t,n){return t=LO(t),function(e,t){if(t&&("object"===NO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,AO()?Reflect.construct(t,n||[],LO(e).constructor):t.apply(e,n))}function AO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(AO=function(){return!!e})()}function LO(e){return LO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},LO(e)}function BO(e,t){return BO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BO(e,t)}var FO=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=IO(this,t,[e])).onClick=n.onClick.bind(n),n.state={profileFollowCount:n.props.profileFollowCount,isFollowed:n.props.isFollowed},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BO(e,t)}(t,e),n=t,(r=[{key:"onClick",value:function(e){e.preventDefault(),$.ajax({type:"POST",url:"/api/social/follow",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,profile:this.props.profile,value:!this.state.isFollowed}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isFollowed:e.value,profileFollowCount:e.result})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement("div",{className:"follow-wrapper"},this.state.isFollowed?u().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-close",onClick:this.onClick},"Stop Following"):u().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-add",onClick:this.onClick},"Follow"),u().createElement("span",{className:"followers icon icon-before icon-account",title:"Followers"},this.state.profileFollowCount))}}])&&RO(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);FO.propTypes={consumer:d().string.isRequired,profile:d().string.isRequired,isFollowed:d().bool},FO.defaultProps={isFollowed:!1};const UO=FO;function qO(e){return qO="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},qO(e)}function KO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VO(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,WO(r.key),r)}}function zO(e,t,n){return t&&VO(e.prototype,t),n&&VO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WO(e){var t=function(e,t){if("object"!=qO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=qO(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qO(t)?t:t+""}function HO(e,t,n){return t=GO(t),function(e,t){if(t&&("object"===qO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$O()?Reflect.construct(t,n||[],GO(e).constructor):t.apply(e,n))}function $O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($O=function(){return!!e})()}function GO(e){return GO=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GO(e)}function JO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QO(e,t)}function QO(e,t){return QO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QO(e,t)}var YO=function(e){function t(e){var n;KO(this,t),(n=HO(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.profileFollowCount=n.props.profile.metrics.profileFollow;var r=n.props.profile.metrics;return delete r.profileFollow,n.state={metrics:r},n}return JO(t,e),zO(t,[{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.profile;!0===e.viewer.canEdit&&e.url;var t=null;if(e.viewer.isSignedIn&&!e.viewer.canEdit){var n=!1;null!=e.viewer.actions&&null!=e.viewer.actions.follow&&(n=e.viewer.actions.follow.value),t=u().createElement(UO,{consumer:"Profile",profile:e.name,isFollowed:n,profileFollowCount:this.profileFollowCount,onChange:this.onMetricsChange})}else t=u().createElement("div",{className:"follow-wrapper"},u().createElement("span",{className:"followers icon icon-before icon-account"},this.profileFollowCount," Followers"));var r={backgroundImage:"url(".concat(e.avatarUrl,")")};return u().createElement("section",{className:"profile-details-section"},u().createElement(dn,{title:e.name}),u().createElement("div",{className:"main"},u().createElement("div",{className:"intro centred clearfix"},u().createElement("div",{className:"user-info"},u().createElement("div",{className:"profile"},u().createElement("div",{className:"profile-image",style:r}),u().createElement("p",{className:"profile-name"},e.name," ",!0===e.viewer.canEdit&&u().createElement("a",{href:e.url+"/edit",className:"icon icon-after icon-refresh edit"},"Edit")," ",e.viewer.e&&e.viewer.e.link&&u().createElement("a",{href:e.viewer.e.link,className:"icon icon-after icon-arrow edit"},"Account")),!1,!1,u().createElement("p",{className:"profile-joined"},"Joined ",e.joined),!1),null!=e.badges&&u().createElement(XO,{badges:e.badges}),u().createElement("div",{className:"profile-stats clearfix"},u().createElement(ro,{metrics:this.state.metrics,displayClass:"dark"})),u().createElement("div",{className:"profile-ctas"},t)))))}}])}(u().Component);YO.propTypes={profile:d().object.isRequired};var XO=function(e){function t(e){return KO(this,t),HO(this,t,[e])}return JO(t,e),zO(t,[{key:"render",value:function(){var e=this;if(null==this.props.badges)return null;var t=Object.keys(this.props.badges).map((function(t,n){return e.props.badges[t].map((function(e,t){return u().createElement("li",{key:n+":"+t},u().createElement("span",{className:e.badge},e.name))}))}));return u().createElement("ul",{className:"profile-badges list-inline"},t)}}])}(u().Component);XO.propTypes={badges:d().object.isRequired};const ZO=YO;function e_(e){return e_="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},e_(e)}function t_(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,n_(r.key),r)}}function n_(e){var t=function(e,t){if("object"!=e_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=e_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==e_(t)?t:t+""}function r_(e,t,n){return t=i_(t),function(e,t){if(t&&("object"===e_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o_()?Reflect.construct(t,n||[],i_(e).constructor):t.apply(e,n))}function o_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o_=function(){return!!e})()}function i_(e){return i_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i_(e)}function a_(e,t){return a_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a_(e,t)}var s_=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=r_(this,t,[e])).handleDelete=n.handleDelete.bind(n),n.handleUnpublish=n.handleUnpublish.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a_(e,t)}(t,e),n=t,r=[{key:"handleDelete",value:function(e){this.props.onDelete(this.props.type,e)}},{key:"handleUnpublish",value:function(e){this.props.onUnpublish(this.props.type,e)}},{key:"render",value:function(){var e=this.props.viewer.isOwner?u().createElement("a",{href:"/project/new",className:"edit-cta icon icon-after icon-add"},"Upload new project"):null,t=this.props.projectGallery.hasMore?u().createElement("button",{type:"button",className:"load-more",onClick:this.props.onViewAll.bind(null,this.props.profile.urlSafeName,this.props.type)},"View all"):null,n=this.props.projectGallery.data.map((function(e,t){return u().createElement(Ii,{key:e.id,project:e,showProfile:!1})}));return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,this.props.label),u().createElement("p",{className:"project-count"},this.props.projectGallery.totalRecords," Projects"),e),u().createElement("div",{className:"content-section"},u().createElement(Cc,null,u().createElement("div",null,n)),t))}}],r&&t_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);s_.propTypes={projectGallery:d().object.isRequired,viewer:d().object,profile:d().object,type:d().string,label:d().string,onViewAll:d().func,onDelete:d().func,onUnpublish:d().func};const c_=s_;function l_(e){return l_="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},l_(e)}function u_(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,p_(r.key),r)}}function p_(e){var t=function(e,t){if("object"!=l_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=l_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l_(t)?t:t+""}function f_(e,t,n){return t=d_(t),function(e,t){if(t&&("object"===l_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h_()?Reflect.construct(t,n||[],d_(e).constructor):t.apply(e,n))}function h_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h_=function(){return!!e})()}function d_(e){return d_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d_(e)}function y_(e,t){return y_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y_(e,t)}const m_=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=f_(this,t,[e])).onViewAll=n.onViewAll.bind(n),n.state={hasLoaded:!1,profile:null,viewer:null,projectDictionaries:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y_(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/profile/"+this.props.profile.routeName+"/projects").done((function(t){e.setState({hasLoaded:!0,profile:t.profile,viewer:t.viewer,projectDictionaries:t.projectDictionaries})})).fail((function(t){e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"onViewAll",value:function(e,t){var n=this;$.getJSON("/api/profile/"+e+"/projects/"+t).done((function(e){var r=n.state.projectDictionaries;r[t].data=r[t].data.concat(e.projectDictionaries.data),r[t].hasMore=!1,n.setState({projectDictionaries:r})})).fail((function(e){}))}},{key:"render",value:function(){if(!this.state.hasLoaded)return u().createElement(kn,null);var e=null,t=[];if(null!=this.state.projectDictionaries)for(var n in TFWeb.Enums.ProjectTypes){var r=n.toLowerCase();this.state.projectDictionaries.hasOwnProperty(r)&&t.push(u().createElement(c_,{key:n,onViewAll:this.onViewAll,viewer:this.state.viewer,profile:this.state.profile,projectGallery:this.state.projectDictionaries[r],label:n,type:r}))}else e=this.state.viewer.isOwner?u().createElement("div",{className:"subsection no-content"},u().createElement("a",{href:"/project/new"},"+ Start your portfolio by sharing a project today!")):u().createElement("div",{className:"subsection no-content"},u().createElement("p",null,this.state.profile.name," hasn't shared any projects.  Encourage them to start their portfolio today."));return u().createElement("div",null,e,t)}}])&&u_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function b_(e){return b_="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},b_(e)}function v_(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,g_(r.key),r)}}function g_(e){var t=function(e,t){if("object"!=b_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=b_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==b_(t)?t:t+""}function w_(e,t,n){return t=S_(t),function(e,t){if(t&&("object"===b_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,E_()?Reflect.construct(t,n||[],S_(e).constructor):t.apply(e,n))}function E_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(E_=function(){return!!e})()}function S_(e){return S_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S_(e)}function O_(e,t){return O_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O_(e,t)}const __=it(function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=w_(this,t,[e])).addQuerystring=n.addQuerystring.bind(n),n.getData=n.getData.bind(n),n.handleFilterChange=n.handleFilterChange.bind(n),n.handleNewPage=n.handleNewPage.bind(n),n.hasLoaded=!1,n.mode=n.props.mode,n.parsedQS=yn.parse(n.props.location.search),n.page=n.parsedQS.page?n.parsedQS.page:0,n.state={pagedData:null,viewer:null,filter:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O_(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=yn.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this,n="/api/profile/".concat(this.props.profile.routeName,"/").concat(this.mode.toLowerCase()).concat(e.location.search),r=!this.hasLoaded;$.getJSON(n).done((function(e,n,o){t.hasLoaded=!0,t.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){if(!r){var e=document.querySelector("div.app");e&&e.scrollIntoView()}}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"render",value:function(){if(!1===this.hasLoaded)return u().createElement(kn,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return u().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Topics":e=u().createElement(Es,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage});break;case"Posts":e=u().createElement(yE,{posts:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage})}return u().createElement("div",{className:"subsection"},u().createElement("div",{className:"subsection-filter"},u().createElement("h3",null,"Forum ",this.mode),u().createElement(bi,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&v_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));function P_(e){return P_="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},P_(e)}function k_(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,j_(r.key),r)}}function j_(e){var t=function(e,t){if("object"!=P_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=P_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==P_(t)?t:t+""}function C_(e,t,n){return t=x_(t),function(e,t){if(t&&("object"===P_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,T_()?Reflect.construct(t,n||[],x_(e).constructor):t.apply(e,n))}function T_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(T_=function(){return!!e})()}function x_(e){return x_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x_(e)}function D_(e,t){return D_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D_(e,t)}var N_=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),C_(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D_(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?product=").concat(encodeURIComponent(t.product));return u().createElement("span",{key:n,className:"tag product"},u().createElement("a",{href:r},u().createElement("img",{src:t.logo,alt:t.product})))}return u().createElement("span",{key:n,className:"tag product"},u().createElement("img",{src:t.logo,alt:t.product}))}));return u().createElement("div",null,this.props.children?this.props.children:u().createElement("h4",null,TFWeb.Resources.UI.Products),u().createElement("div",{className:"tags"},t))}}])&&k_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);N_.propTypes={list:d().array,path:d().string},N_.defaultProps={list:[]};const R_=N_;function M_(e){return M_="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},M_(e)}function I_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A_(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,B_(r.key),r)}}function L_(e,t,n){return t&&A_(e.prototype,t),n&&A_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function B_(e){var t=function(e,t){if("object"!=M_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=M_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==M_(t)?t:t+""}function F_(e,t,n){return t=q_(t),function(e,t){if(t&&("object"===M_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,U_()?Reflect.construct(t,n||[],q_(e).constructor):t.apply(e,n))}function U_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(U_=function(){return!!e})()}function q_(e){return q_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},q_(e)}function K_(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V_(e,t)}function V_(e,t){return V_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V_(e,t)}u().Component;var z_=function(e){function t(e){return I_(this,t),F_(this,t,[e])}return K_(t,e),L_(t,[{key:"componentDidMount",value:function(){$("body").attr("class","profile-details editable")}},{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Profile",titleTemplate:"%s | Foundry Community"}),u().createElement(H_,null),u().createElement(ZO,{profile:this.props.profile}),u().createElement(at,null,u().createElement(W_,{profile:this.props.profile})))}}])}(u().Component),W_=it(function(e){function t(e){return I_(this,t),F_(this,t,[e])}return K_(t,e),L_(t,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){var e=this,t=[u().createElement(gt,{to:"/profile/".concat(this.props.profile.routeName),isActive:function(){return e.props.location.pathname==e.props.profile.url},activeClassName:"selected"},"Portfolio"),u().createElement(gt,{to:"/profile/".concat(this.props.profile.routeName,"/topics"),activeClassName:"selected"},"Topics"),u().createElement(gt,{to:"/profile/".concat(this.props.profile.routeName,"/posts"),activeClassName:"selected"},"Posts")];return u().createElement("div",null,u().createElement(DO,{tabs:t}),u().createElement(ot,null,u().createElement(rt,{path:"/profile/:name/posts"},u().createElement(__,{mode:"Posts",profile:this.props.profile})),u().createElement(rt,{path:"/profile/:name/topics"},u().createElement(__,{mode:"Topics",profile:this.props.profile})),u().createElement(rt,{path:"/profile/:name/about"},u().createElement(m_,{profile:this.props.profile})),u().createElement(rt,{exact:!0,path:"/profile/:name"},u().createElement(m_,{profile:this.props.profile}))))}}])}(u().Component)),H_=function(e){function t(){return I_(this,t),F_(this,t,arguments)}return K_(t,e),L_(t,[{key:"render",value:function(){return u().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}})}}])}(u().Component);const $_=z_;function G_(e){return G_="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},G_(e)}function J_(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,Q_(r.key),r)}}function Q_(e){var t=function(e,t){if("object"!=G_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=G_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==G_(t)?t:t+""}function Y_(e,t,n){return t=Z_(t),function(e,t){if(t&&("object"===G_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X_()?Reflect.construct(t,n||[],Z_(e).constructor):t.apply(e,n))}function X_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X_=function(){return!!e})()}function Z_(e){return Z_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Z_(e)}function eP(e,t){return eP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eP(e,t)}const tP=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Y_(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eP(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Share | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discover Assets"))),u().createElement(at,null,u().createElement(rt,{path:"/share"},u().createElement(fO,{type:"Asset",section:"share"}))))}}])&&J_(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component),nP=function(e){return u().createElement("div",{className:"app"},u().createElement(dn,{defaultTitle:"Explore | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot"},"Discover Portfolios"))),u().createElement(at,null,u().createElement(rt,{path:"/explore"},u().createElement(fO,{type:"Portfolio",section:"explore"}))))},rP=function(e){return u().createElement(u().Fragment,null,u().createElement(dn,null,u().createElement("title",null,"Cattery FAQ"),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin,"/cattery/faq")})),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,u().createElement("img",{src:"/common/img/logos/Cattery_BlackYellow.svg"})," FAQ"))),u().createElement("div",{className:"content-section"},u().createElement("ul",{className:"faq"},u().createElement("li",null,u().createElement("h4",null,"What is Cattery?"),u().createElement("p",null,"There are thousands of amazing open source machine learning models available for use, but getting them into Nuke can be tricky. As of Nuke 13.1 it’s possible to convert image to image models in PyTorch’s TorchScript format into .cat files that can be run natively in the Inference node, but the conversion process does require some time and engineering knowledge (",u().createElement("a",{href:"https://learn.foundry.com/nuke/developers/14.0/catfilecreationreferenceguide/index.html"},"NUKE's .cat File Creation Guide"),"). So we thought someone should save everyone the hassle and do it once and for all! And that’s Cattery - a library of open-source machine learning models already converted to .cat files to run natively inside Nuke.")),u().createElement("li",null,u().createElement("h4",null,"Can I use Cattery models for commercial use?"),u().createElement("p",null,"All the .cat files in Cattery are converted from open source machine learning models with licenses that allow for commercial use, however the datasets they are trained on may be unknown or have non-commercial licenses. ")),u().createElement("li",null,u().createElement("h4",null,"If the data doesn’t allow commercial use, surely I can’t use these commercially?"),u().createElement("p",null,"Well, maybe. The legal situation around machine learning models is both unclear and fast changing. Ultimately, it is a decision for the user and their legal departments to decide on how they wish to use the models and their comfort level with any associated risk.")),u().createElement("li",null,u().createElement("h4",null,"But it says the models are provided under a BSD-3 clause license, doesn’t it?"),u().createElement("p",null,"Foundry’s work converting the models into the .cat format are covered by the BSD-3 clause license that allows for commercial use, but the underlying models are still governed by their own licenses.")),u().createElement("li",null,u().createElement("h4",null,"Where can I see the licenses for the models?"),u().createElement("p",null,"The download page for each model links to the original GitHub repo that the model was ported from. The repo will have a license file that refers to the model and the model weights. However, this repo may include other repos which will have their own license files. Additionally, the academic papers that the models are based on tend to refer to the datasets they are trained on, which will have additional license information.")),u().createElement("li",null,u().createElement("h4",null,"Jeez, that’s a lot of different licenses, isn’t it? "),u().createElement("p",null,"It can be, unfortunately!")),u().createElement("li",null,u().createElement("h4",null,"Which Nuke versions do Cattery models run in?"),u().createElement("p",null,"Most of the models run in Nuke 13.1 onwards, but a few require later versions of PyTorch that are only available in Nuke 14.0 onwards. The specific requirements for each model can be found next to its download link."),u().createElement("p",null,"The Cattery toolbar is only available in Nuke 14.0 onwards.")),u().createElement("li",null,u().createElement("h4",null,"How do I install the models?"),u().createElement("p",null,"The install instructions can be found under the Instructions tab next to the Downloads area on each .cat file page.")),u().createElement("li",null,u().createElement("h4",null,"Can I contribute to Cattery?"),u().createElement("p",null,"Yes! We’ll be opening up Cattery to user submissions soon. If you’re interested in being one of the initial contributors, please email ",u().createElement("a",{href:"mailto:cattery@foundry.com"},"cattery@foundry.com"))))))};function oP(e){return oP="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},oP(e)}function iP(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,aP(r.key),r)}}function aP(e){var t=function(e,t){if("object"!=oP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=oP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oP(t)?t:t+""}function sP(e,t,n){return t=lP(t),function(e,t){if(t&&("object"===oP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cP()?Reflect.construct(t,n||[],lP(e).constructor):t.apply(e,n))}function cP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cP=function(){return!!e})()}function lP(e){return lP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lP(e)}function uP(e,t){return uP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uP(e,t)}var pP=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=sP(this,t,[e])).handleTabClick=n.handleTabClick.bind(n),n.setTab=n.setTab.bind(n),n.state={selectedIndex:n.props.selectedIndex},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uP(e,t)}(t,e),n=t,(r=[{key:"handleTabClick",value:function(e,t){t.preventDefault(),t.stopPropagation(),this.setTab(e)}},{key:"setTab",value:function(e){this.setState({selectedIndex:e})}},{key:"render",value:function(){var e=this,t=[];if(Array.isArray(this.props.children))for(var n=0;n<this.props.children.length;n++)this.props.children[n].props.visible&&t.push(this.props.children[n]);else t.push(this.props.children);return u().createElement("div",{className:this.props.className},u().createElement("ul",{className:"tftabs"},t.map((function(n,r){if(n.props.visible){var o="".concat(e.state.selectedIndex==r?"selected":"");return u().createElement("li",{key:r,className:1==t.length?"single":""},u().createElement("a",{href:"#",className:o,onClick:e.handleTabClick.bind(null,r)},n.props.label))}}))),t[this.state.selectedIndex])}}])&&iP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);pP.propTypes={selectedIndex:d().number,children:d().oneOfType([d().array,d().element]).isRequired,className:d().string},pP.defaultProps={selectedIndex:0,className:""};const fP=pP;function hP(e){return hP="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},hP(e)}function dP(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,yP(r.key),r)}}function yP(e){var t=function(e,t){if("object"!=hP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hP(t)?t:t+""}function mP(e,t,n){return t=vP(t),function(e,t){if(t&&("object"===hP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bP()?Reflect.construct(t,n||[],vP(e).constructor):t.apply(e,n))}function bP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bP=function(){return!!e})()}function vP(e){return vP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vP(e)}function gP(e,t){return gP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gP(e,t)}var wP=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),mP(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gP(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"tftabs-panel"},this.props.children)}}])&&dP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);wP.propTypes={label:d().string.isRequired,children:d().node.isRequired},wP.defaultProps={visible:!0};const EP=wP;function SP(e){return SP="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},SP(e)}function OP(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,_P(r.key),r)}}function _P(e){var t=function(e,t){if("object"!=SP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=SP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==SP(t)?t:t+""}function PP(e,t,n){return t=jP(t),function(e,t){if(t&&("object"===SP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kP()?Reflect.construct(t,n||[],jP(e).constructor):t.apply(e,n))}function kP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(kP=function(){return!!e})()}function jP(e){return jP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jP(e)}function CP(e,t){return CP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},CP(e,t)}var TP=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=PP(this,t,[e])).onClick=n.onClick.bind(n),n.state={isLiked:n.props.isLiked},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CP(e,t)}(t,e),n=t,(r=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/like",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isLiked}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isLiked:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("likes",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link like".concat(this.state.isLiked?" active":"");return u().createElement("span",null,u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"))}}])&&OP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);TP.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,isLiked:d().bool,onChange:d().func},TP.defaultProps={isLiked:!1};const xP=TP;function DP(e){return DP="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},DP(e)}function NP(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,RP(r.key),r)}}function RP(e){var t=function(e,t){if("object"!=DP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=DP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DP(t)?t:t+""}function MP(e,t,n){return t=AP(t),function(e,t){if(t&&("object"===DP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,IP()?Reflect.construct(t,n||[],AP(e).constructor):t.apply(e,n))}function IP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(IP=function(){return!!e})()}function AP(e){return AP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},AP(e)}function LP(e,t){return LP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},LP(e,t)}var BP=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=MP(this,t,[e]),e=Object.assign({},e),n.state={uniqueness:(Math.random()+"").replace(".",""),value:e.value||0,stars:[],halfStar:{at:Math.floor(e.value),hidden:e.half&&e.value%1<.5}},n.state.config={count:e.count,size:e.size,char:e.char,color1:e.color1,color2:e.color2,half:e.half,edit:e.edit},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&LP(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){this.setState({stars:this.getStars(this.state.value)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({stars:this.getStars(e.value),value:e.value,halfStar:{at:Math.floor(e.value),hidden:this.state.config.half&&e.value%1<.5}})}},{key:"isDecimal",value:function(e){return e%1!=0}},{key:"getRate",value:function(){return this.state.config.half?Math.floor(this.state.value):Math.round(this.state.value)}},{key:"getStars",value:function(e){void 0===e&&(e=this.getRate());for(var t=[],n=0;n<this.state.config.count;n++)t.push({active:n<=e-1});return t}},{key:"mouseOver",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o=Number(e.target.getAttribute("data-index"));if(n.half){var i=this.moreThanHalf(e,n.size);r.hidden=i,i&&(o+=1),r.at=o}else o+=1;this.setState({stars:this.getStars(o)})}}},{key:"moreThanHalf",value:function(e,t){var n=e.target,r=e.clientX-n.getBoundingClientRect().left;return(r=Math.round(Math.abs(r)))>t/2}},{key:"mouseLeave",value:function(){var e=this.state,t=e.value,n=e.halfStar,r=e.config;r.edit&&(r.half&&(n.hidden=!this.isDecimal(t),n.at=Math.floor(this.state.value)),this.setState({stars:this.getStars()}))}},{key:"clicked",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o,i=Number(e.target.getAttribute("data-index"));if(n.half){var a=this.moreThanHalf(e,n.size);r.hidden=a,a&&(i+=1),o=a?i:i+.5,r.at=i}else o=i+=1;this.setState({value:o,stars:this.getStars(i)}),this.props.onChange(o)}}},{key:"renderHalfStarStyleElement",value:function(){var e=this.state,t=e.config,n=e.uniqueness;return u().createElement("style",{dangerouslySetInnerHTML:{__html:qP(t.color2,n)}})}},{key:"renderStars",value:function(){var e=this,t=this.state,n=t.halfStar,r=t.stars,o=t.uniqueness,i=t.config,a=i.color1,s=i.color2,c=i.size,l=i.char,p=i.half,f=i.edit;return r.map((function(t,r){var i="";p&&!n.hidden&&n.at===r&&(i="react-stars-".concat(o));var h=Object.assign({},UP,{color:t.active?s:a,cursor:f?"pointer":"default",fontSize:"".concat(c,"px")});return u().createElement("span",{className:i,style:h,key:r,"data-index":r,"data-forhalf":l,onMouseOver:e.mouseOver.bind(e),onMouseMove:e.mouseOver.bind(e),onMouseLeave:e.mouseLeave.bind(e),onClick:e.clicked.bind(e)},l)}))}},{key:"render",value:function(){var e=this.props.className;return u().createElement("span",{className:e,style:FP},this.state.config.half?this.renderHalfStarStyleElement():"",this.renderStars())}}],r&&NP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);BP.propTypes={className:d().string,edit:d().bool,half:d().bool,value:d().number,count:d().number,char:d().string,size:d().number,color1:d().string,color2:d().string},BP.defaultProps={edit:!0,half:!0,value:0,count:5,char:"★",size:15,color1:"gray",color2:"#ffd700",onChange:function(){}};var FP={overflow:"hidden",position:"relative"},UP={position:"relative",overflow:"hidden",cursor:"pointer",display:"block",float:"left"},qP=function(e,t){return"\n    .react-stars-".concat(t,":before {\n      position: absolute;\n      overflow: hidden;\n      display: block;\n      z-index: 1;\n      top: 0; left: 0;\n      width: 50%;\n      content: attr(data-forhalf);\n      color: ").concat(e,";\n  }")};const KP=BP;function VP(e){return VP="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},VP(e)}function zP(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,WP(r.key),r)}}function WP(e){var t=function(e,t){if("object"!=VP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=VP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==VP(t)?t:t+""}function HP(e,t,n){return t=GP(t),function(e,t){if(t&&("object"===VP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$P()?Reflect.construct(t,n||[],GP(e).constructor):t.apply(e,n))}function $P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($P=function(){return!!e})()}function GP(e){return GP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GP(e)}function JP(e,t){return JP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},JP(e,t)}var QP=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=HP(this,t,[e])).onChange=n.onChange.bind(n),n.state={rating:n.props.rating},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JP(e,t)}(t,e),n=t,(r=[{key:"onChange",value:function(e){$.ajax({type:"POST",url:"/api/social/rate/",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({rating:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("rating",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return u().createElement(KP,{className:"rate",value:this.state.rating,onChange:this.onChange,count:5,half:!1,size:24,color1:"rgba(255,255,255,.5)",color2:"#FCB434"})}}])&&zP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);QP.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,rating:d().number,onChange:d().func},QP.defaultProps={rating:null};const YP=QP;function XP(e){return XP="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},XP(e)}function ZP(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,ek(r.key),r)}}function ek(e){var t=function(e,t){if("object"!=XP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=XP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==XP(t)?t:t+""}function tk(e,t,n){return t=rk(t),function(e,t){if(t&&("object"===XP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nk()?Reflect.construct(t,n||[],rk(e).constructor):t.apply(e,n))}function nk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nk=function(){return!!e})()}function rk(e){return rk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rk(e)}function ok(e,t){return ok=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ok(e,t)}var ik=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=tk(this,t,[e])).onClick=n.onClick.bind(n),n.state={isWatched:n.props.isWatched},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ok(e,t)}(t,e),n=t,(r=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isWatched}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isWatched:e.value}),null!=e.result&&e.result>=0&&this.props.onChange("watch",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link watch".concat(this.state.isWatched?" active":"");return u().createElement("button",{type:"button",className:e,onClick:this.onClick},"Watch")}}])&&ZP(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function ak(e){return ak="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},ak(e)}function sk(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,ck(r.key),r)}}function ck(e){var t=function(e,t){if("object"!=ak(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ak(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ak(t)?t:t+""}function lk(e,t,n){return t=pk(t),function(e,t){if(t&&("object"===ak(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,uk()?Reflect.construct(t,n||[],pk(e).constructor):t.apply(e,n))}function uk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(uk=function(){return!!e})()}function pk(e){return pk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pk(e)}function fk(e,t){return fk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fk(e,t)}ik.propTypes={consumer:d().string.isRequired,id:d().number.isRequired,isWatched:d().bool},ik.defaultProps={isWatched:!1};var hk=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),lk(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fk(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){var r="".concat(e.props.path,"?").concat(t.value);return u().createElement("span",{key:n,className:"tag category"},u().createElement("a",{href:r},t.text))}));return u().createElement("div",null,u().createElement("h4",null,TFWeb.Resources.UI.Categories),u().createElement("div",{className:"tags"},t))}}])&&sk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);hk.propTypes={list:d().array,path:d().string.isRequired},hk.defaultProps={list:[]};const dk=hk;function yk(e){return yk="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},yk(e)}function mk(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,bk(r.key),r)}}function bk(e){var t=function(e,t){if("object"!=yk(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yk(t)?t:t+""}function vk(e,t,n){return t=wk(t),function(e,t){if(t&&("object"===yk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,gk()?Reflect.construct(t,n||[],wk(e).constructor):t.apply(e,n))}function gk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gk=function(){return!!e})()}function wk(e){return wk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wk(e)}function Ek(e,t){return Ek=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ek(e,t)}var Sk=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),vk(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ek(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?tags=").concat(encodeURIComponent(t));return u().createElement("span",{key:n,className:"tag"},u().createElement("a",{href:r},t))}return u().createElement("span",{key:n,className:"tag"},t)})),n=null!=this.props.label&&"undefined"!=this.props.label?this.props.label:TFWeb.Resources.UI.Tags;return u().createElement("div",null,u().createElement("h4",null,n),u().createElement("div",{className:"tags"},t))}}])&&mk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Sk.propTypes={list:d().array,path:d().string,label:d().string},Sk.defaultProps={list:[]};const Ok=Sk;function _k(e){return _k="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},_k(e)}function Pk(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,kk(r.key),r)}}function kk(e){var t=function(e,t){if("object"!=_k(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=_k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_k(t)?t:t+""}function jk(e,t,n){return t=Tk(t),function(e,t){if(t&&("object"===_k(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ck()?Reflect.construct(t,n||[],Tk(e).constructor):t.apply(e,n))}function Ck(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ck=function(){return!!e})()}function Tk(e){return Tk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tk(e)}function xk(e,t){return xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xk(e,t)}var Dk=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),jk(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xk(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"extension-download asset-download"},u().createElement("div",{className:"info"},u().createElement("img",{src:this.props.content.thumbUrl}),u().createElement("div",null,u().createElement("p",{className:"title"},this.props.content.title),u().createElement("span",{className:"format"},this.props.content.resourceFormat),u().createElement("table",null,u().createElement("tbody",null,u().createElement("tr",null,u().createElement("td",null,u().createElement("span",null,"File Size:")),u().createElement("td",null,u().createElement("span",null,this.props.content.size))),u().createElement("tr",null,u().createElement("td",null,u().createElement("span",null,"Compatibility:")),u().createElement("td",null,u().createElement("ul",null,this.props.content.productReleases.map((function(e,t){return u().createElement("li",{key:t},e)}))))),u().createElement("tr",null,u().createElement("td",{colSpan:"2"},this.props.children)))))))}}])&&Pk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Dk.propTypes={content:d().object};const Nk=Dk;function Rk(e){return Rk="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},Rk(e)}function Mk(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,Ik(r.key),r)}}function Ik(e){var t=function(e,t){if("object"!=Rk(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Rk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rk(t)?t:t+""}function Ak(e,t,n){return t=Bk(t),function(e,t){if(t&&("object"===Rk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lk()?Reflect.construct(t,n||[],Bk(e).constructor):t.apply(e,n))}function Lk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Lk=function(){return!!e})()}function Bk(e){return Bk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bk(e)}function Fk(e,t){return Fk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fk(e,t)}const Uk=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Ak(this,t,[e])).onAction=n.onAction.bind(n),n.state={hasLoaded:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fk(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/legal/agreement/".concat(this.props.license)).done((function(t,n,r){e.title=t.title,e.text=t.text,e.setState({hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onAction",value:function(e){!0===e?$.ajax({type:"POST",url:"/api/legal/agreement/".concat(this.props.license),contentType:"application/json; charset=utf-8",data:JSON.stringify({agree:e}),dataType:"json",context:this}).done((function(t,n,r){this.props.onAction(this.props.license,e,t)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})):this.props.onAction(e,null)}},{key:"render",value:function(){return this.state.hasLoaded?u().createElement("div",{className:"license-agreement"},u().createElement("h1",null,this.title),u().createElement("div",{className:"license-view"},u().createElement("div",{dangerouslySetInnerHTML:vn.createMarkup(this.text)})),u().createElement("div",{style:{textAlign:"right"}},u().createElement("button",{style:{marginRight:"5px"},onClick:this.onAction.bind(null,!1)},"Cancel"),u().createElement("button",{className:"btn-primary",style:{paddingLeft:"60px",paddingRight:"60px"},onClick:this.onAction.bind(null,!0)},"I Agree"))):null}}])&&Mk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function qk(e){return qk="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},qk(e)}function Kk(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,Vk(r.key),r)}}function Vk(e){var t=function(e,t){if("object"!=qk(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=qk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qk(t)?t:t+""}function zk(e,t,n){return t=Hk(t),function(e,t){if(t&&("object"===qk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Wk()?Reflect.construct(t,n||[],Hk(e).constructor):t.apply(e,n))}function Wk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Wk=function(){return!!e})()}function Hk(e){return Hk=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hk(e)}function $k(e,t){return $k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$k(e,t)}var Gk=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=zk(this,t,[e])).onDownload=n.onDownload.bind(n),n.handleTOS=n.handleTOS.bind(n),n.closeTOS=n.closeTOS.bind(n),n.DownloadType={Download:1,Cart:2},n.download=null,n.tos=[],n.state={showTOS:!1,tos:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$k(e,t)}(t,e),n=t,r=[{key:"onDownload",value:function(e,t){var n=this.props.list[e];return this.download={type:this.DownloadType.Download,index:e,format:t},this.setState({showTOS:!0,tos:n.license}),!1}},{key:"doDownload",value:function(e,t){var n=this.props.list[e],r="/extension/".concat(this.props.projectID,"/content/").concat(n.data,"/download");null!=t&&(r+="?format=".concat(t)),window.location.replace(r)}},{key:"handleTOS",value:function(e,t,n){for(var r=this,o=0;o<=this.props.list.length-1;o++)this.props.list[o].license==e&&(this.props.list[o].viewer.licenseAgreement=n);this.setState({showTOS:!1,tos:null},(function(){if(t&&null!=r.download)switch(r.download.type){case r.DownloadType.Download:r.doDownload(r.download.index,r.download.format);break;case r.DownloadType.Cart:r.addToCart(r.download.index)}}))}},{key:"closeTOS",value:function(){!0===this.state.showTOS&&this.setState({showTOS:!1})}},{key:"render",value:function(){var e=[];return this.props.list.forEach((function(t,n){var r=[];this.props.viewer.isSignedIn?r.push(u().createElement("li",{key:"d"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,null)},"Download"))):r=u().createElement("li",null,u().createElement("a",{href:this.props.viewer.signInUrl,className:"button btn-small icon icon-after icon-download"},"Sign in to download")),e.push(u().createElement(Nk,{key:t.id,content:t},u().createElement("ul",{className:"files"},r)))}),this),u().createElement(u().Fragment,null,u().createElement("div",{className:"share-downloads"},e),this.state.showTOS&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!1,onClose:this.closeTOS,contentStyle:{backgroundColor:"white",padding:"40px"}},u().createElement(Uk,{id:6,license:this.state.tos,onAction:this.handleTOS})))}}],r&&Kk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Gk.propTypes={projectID:d().number,list:d().array,viewer:d().object};const Jk=Gk;function Qk(e){return Qk="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},Qk(e)}function Yk(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,Xk(r.key),r)}}function Xk(e){var t=function(e,t){if("object"!=Qk(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Qk(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qk(t)?t:t+""}function Zk(e,t,n){return t=tj(t),function(e,t){if(t&&("object"===Qk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ej()?Reflect.construct(t,n||[],tj(e).constructor):t.apply(e,n))}function ej(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ej=function(){return!!e})()}function tj(e){return tj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tj(e)}function nj(e,t){return nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nj(e,t)}var rj=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Zk(this,t,[e])).initValue=n.initValue.bind(n),n.validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n.onChange=n.onChange.bind(n),n.handleFocus=n.handleFocus.bind(n),n.handleBlur=n.handleBlur.bind(n),n.changeLocale=n.changeLocale.bind(n),n.state={currentCulture:Object.keys(TFGlobal.cultures)[0],value:n.initValue(n.props.value),validate:!1,isValid:!0,showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nj(e,t)}(t,e),n=t,r=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"initValue",value:function(e){var t=null!=e?e:{};return Object.keys(TFGlobal.cultures).forEach((function(e){t.hasOwnProperty(e)||(t[e]="")})),t}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value.en}},{key:"getValue",value:function(){var e=JSON.parse(JSON.stringify(this.state.value));return Object.keys(e).forEach((function(t){""==e[t]&&delete e[t]})),e}},{key:"setValue",value:function(e){var t=this.initValue(e);this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=JSON.parse(JSON.stringify(this.state.value));n[this.state.currentCulture]=e.target.value,this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(e.target.value)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"changeLocale",value:function(e){this.setState({currentCulture:e})}},{key:"render",value:function(){var e=this,t="localized-string-editor form-group";!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=u().createElement(sa,{message:this.props.helpMessage})):n=u().createElement(sa,{message:this.props.requiredErrorMessage});var r,o=Object.keys(TFGlobal.cultures).map((function(t,n){var r=t==e.state.currentCulture?"active":"";return""!=e.state.value[t]&&(r+=" hasText"),u().createElement("li",{key:n},u().createElement("a",{onClick:e.changeLocale.bind(null,t),className:r},TFGlobal.cultures[t]))}));return r=1==this.props.rows?u().createElement("input",{name:this.props.name,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}):u().createElement("textarea",{name:this.props.name,type:"text",rows:this.props.rows,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),u().createElement("div",{className:t},u().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),u().createElement("div",null,r,u().createElement("ul",null,o)),n,this.props.children)}}],r&&Yk(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);rj.propTypes={value:d().object,rows:d().number,name:d().string,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},rj.defaultProps={rows:5,required:!1,requiredErrorMessage:"input required."};const oj=rj;function ij(e){return ij="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},ij(e)}function aj(){return aj=Object.assign?Object.assign.bind():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},aj.apply(this,arguments)}function sj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cj(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,uj(r.key),r)}}function lj(e,t,n){return t&&cj(e.prototype,t),n&&cj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function uj(e){var t=function(e,t){if("object"!=ij(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ij(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ij(t)?t:t+""}function pj(e,t,n){return t=hj(t),function(e,t){if(t&&("object"===ij(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fj()?Reflect.construct(t,n||[],hj(e).constructor):t.apply(e,n))}function fj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fj=function(){return!!e})()}function hj(e){return hj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hj(e)}function dj(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yj(e,t)}function yj(e,t){return yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yj(e,t)}var mj=function(e){function t(e){var n;return sj(this,t),(n=pj(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getTags=n.getTags.bind(n),n.updateTags=n.updateTags.bind(n),n.onDelete=n.onDelete.bind(n),n.getTagIndex=n.getTagIndex.bind(n),n.handleKeyDown=n.handleKeyDown.bind(n),n.setInputWidth=n.setInputWidth.bind(n),n.resetInput=n.resetInput.bind(n),n.onBlur=n.onBlur.bind(n),n.handleGroupFocus=n.handleGroupFocus.bind(n),n.handleGroupBlur=n.handleGroupBlur.bind(n),n.inputDefaultLength=16,n.inputCharWidth=8,n.state={tags:n.props.tags?n.props.tags:[],highlightIndex:null,inputWidth:n.inputDefaultLength*n.inputCharWidth,validate:!1,isValid:!0===n.props.required&&null!=n.props.tags&&n.props.tags.length>0,showValidation:!1,hasFocus:!1},n}return dj(t,e),lj(t,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.tags&&this.state.tags.length>0}},{key:"getTags",value:function(){return this.state.tags}},{key:"updateTags",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];-1==this.state.tags.indexOf(r)&&t.push(r)}if(t.length>0){var o=this.state.tags.concat(t);this.setState({tags:o})}}},{key:"onDelete",value:function(e){var t=this.state.tags;t.splice(e,1),this.setState({tags:t,isValid:this.valid()})}},{key:"getTagIndex",value:function(e){for(var t=0;t<this.state.tags.length;t++)if(this.state.tags[t].toLowerCase()==e.toLowerCase())return t;return null}},{key:"handleKeyDown",value:function(e){var t=this,n=this.refs.input.value;if(188==e.keyCode){e.preventDefault();var r=this.getTagIndex(n);if(null==r){var o=this.state.tags;o.push(n),this.setState({tags:o,isValid:this.valid()}),this.resetInput()}else this.setState({highlightIndex:r}),this.setInputWidth(n.length),setTimeout((function(){t.setState({highlightIndex:null})}),1e3)}else 27==e.keyCode?(e.preventDefault(),this.resetInput()):this.setInputWidth(n.length)}},{key:"setInputWidth",value:function(e){if(e>this.inputDefaultLength){var t=e*this.inputCharWidth;t>this.state.inputWidth&&this.setState({inputWidth:t})}}},{key:"resetInput",value:function(){this.setState({inputWidth:this.inputDefaultLength*this.inputCharWidth}),this.refs.input.value=""}},{key:"onBlur",value:function(){this.resetInput()}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.state.tags.map((function(t,n){var r="";return e.state.highlightIndex==n&&(r+="highlight"),u().createElement(bj,{key:t,className:r,data:t,onDelete:e.onDelete.bind(null,n)})})),n={style:{width:this.state.inputWidth}},r="tag-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(r+=" has-focus"):r+=" has-error";var o="active";!0===this.props.required&&(o+=" required");var i=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(i=u().createElement(sa,{message:this.props.helpMessage})):i=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:r,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:o},this.props.label),u().createElement("div",null,t,u().createElement("input",aj({type:"text",ref:"input",placeholder:this.props.placeholder,onKeyDown:this.handleKeyDown,onBlur:this.onBlur},n))),i)}}])}(u().Component);mj.propTypes={tags:d().array,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string},mj.defaultProps={label:"Tags",placeholder:"Add New Tag...",helpMessage:"Enter tags separated by a comma.",required:!1,requiredErrorMessage:"At least one item is required"};var bj=function(e){function t(){return sj(this,t),pj(this,t,arguments)}return dj(t,e),lj(t,[{key:"render",value:function(){return u().createElement("span",{className:this.props.className},this.props.data," ",u().createElement("button",{type:"button",className:"close",onClick:this.props.onDelete},u().createElement("span",null,"×")))}}])}(u().Component);const vj=mj;function gj(e){return gj="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},gj(e)}function wj(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,Ej(r.key),r)}}function Ej(e){var t=function(e,t){if("object"!=gj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gj(t)?t:t+""}function Sj(e,t,n){return t=_j(t),function(e,t){if(t&&("object"===gj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Oj()?Reflect.construct(t,n||[],_j(e).constructor):t.apply(e,n))}function Oj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oj=function(){return!!e})()}function _j(e){return _j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_j(e)}function Pj(e,t){return Pj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pj(e,t)}const kj=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Sj(this,t,[e])).setup=n.setup.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.form=null,n.state={loadStatus:c.LoadStatus.PreLoad},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pj(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/"+this.props.id).done((function(t,n,r){e.form=t,e.setState({loadStatus:c.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){this.refs.titleLocalizations.validate()&&this.refs.product.validate()&&this.refs.category.validate()&&(this.form.titleLocalizations=this.refs.titleLocalizations.getValue(),this.form.descriptionLocalizations=this.refs.descriptionLocalizations.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),$.ajax({type:"POST",url:"/admintia/api/project/"+this.props.id,data:this.form,dataType:"json",context:this}).done((function(e,t,n){window.location.replace(e.data.url)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})))}},{key:"render",value:function(){return this.state.loadStatus!=c.LoadStatus.Loaded?u().createElement(kn,null):u().createElement("div",{className:"clearfix"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12",style:{marginBottom:"20px"}},u().createElement(oj,{ref:"titleLocalizations",label:"Title",placeholder:"Name your project...",value:this.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."})),u().createElement("div",{className:"col-md-12"},u().createElement(oj,{ref:"descriptionLocalizations",label:"Project Description",placeholder:"Project description...",value:this.form.descriptionLocalizations,rows:10,required:!1,requiredErrorMessage:"English description required at minimum."})),u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),u().createElement("div",{className:"col-md-12"},u().createElement(vj,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData}))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}])&&wj(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function jj(e){return jj="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},jj(e)}function Cj(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,Tj(r.key),r)}}function Tj(e){var t=function(e,t){if("object"!=jj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=jj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jj(t)?t:t+""}function xj(e,t,n){return t=Nj(t),function(e,t){if(t&&("object"===jj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dj()?Reflect.construct(t,n||[],Nj(e).constructor):t.apply(e,n))}function Dj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dj=function(){return!!e})()}function Nj(e){return Nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nj(e)}function Rj(e,t){return Rj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rj(e,t)}const Mj=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=xj(this,t,[e])).setup=n.setup.bind(n),n.handleEditClick=n.handleEditClick.bind(n),n.handleEditCancel=n.handleEditCancel.bind(n),n.handleEditComplete=n.handleEditComplete.bind(n),n.state={showPanel:!1,showEdit:!1,showSpam:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rj(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"render",value:function(){return u().createElement("div",{className:"topic-editor clearfix"},u().createElement("ul",{className:"list-inline"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Project")),this.props.project.viewer.eMessage&&u().createElement("li",{className:"emessage"},this.props.project.viewer.eMessage)),this.state.showEdit&&u().createElement(kj,{id:this.props.project.id,onCancel:this.handleEditCancel}))}}])&&Cj(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function Ij(e){return Ij="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},Ij(e)}function Aj(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,Lj(r.key),r)}}function Lj(e){var t=function(e,t){if("object"!=Ij(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ij(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ij(t)?t:t+""}function Bj(e,t,n){return t=Uj(t),function(e,t){if(t&&("object"===Ij(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Fj()?Reflect.construct(t,n||[],Uj(e).constructor):t.apply(e,n))}function Fj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fj=function(){return!!e})()}function Uj(e){return Uj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Uj(e)}function qj(e,t){return qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qj(e,t)}var Kj=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bj(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qj(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(null==this.props.licenses||0==this.props.licenses.length)return null;var e=[];return this.props.licenses.forEach((function(t,n){var r="";for(n=0;n<t.entities.length;n++)n>0&&(n<t.entities.length-1?r+=", ":n==t.entities.length-1&&(r+=" & ")),r+=t.entities[n];e.push(u().createElement("li",{key:n},u().createElement("span",null,r)," ",t.entities.length>1?"are":"is"," shared under the ",u().createElement("a",{href:t.url},t.title)," license."))})),u().createElement("ul",{className:"license-smalltext-view"},e)}}])&&Aj(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Kj.propTypes={licenses:d().array};const Vj=Kj;function zj(e){return zj="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},zj(e)}function Wj(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,Hj(r.key),r)}}function Hj(e){var t=function(e,t){if("object"!=zj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=zj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zj(t)?t:t+""}function $j(e,t,n){return t=Jj(t),function(e,t){if(t&&("object"===zj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Gj()?Reflect.construct(t,n||[],Jj(e).constructor):t.apply(e,n))}function Gj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Gj=function(){return!!e})()}function Jj(e){return Jj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jj(e)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qj(e,t)}var Yj=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=$j(this,t,[e])).getView=n.getView.bind(n),n.onMetricsChange=n.onMetricsChange.bind(n),n.state={hasLoaded:!1,project:null,metrics:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.getView(),$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"getView",value:function(){var e="/api/cattery/view/".concat(this.props.match.params.id),t=this;$.getJSON(e).done((function(e,n,r){t.setState({project:e,metrics:e.metrics,hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onMetricsChange",value:function(e,t){var n=Co()(this.state.metrics);n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this;if(!1===this.state.hasLoaded)return u().createElement(kn,null);var t=this.state.project,n=null;if(!0===t.viewer.isSignedIn){var r=!1;null!=t.viewer.actions&&(null!=t.viewer.actions.like&&(r=t.viewer.actions.like.value),null!=t.viewer.actions.watch&&t.viewer.actions.watch.value),n=[],!1===t.viewer.isOwner&&n.push(u().createElement(xP,{key:0,consumer:"Project",id:t.id,isLiked:r,onChange:this.onMetricsChange}))}var o=null;return!0===t.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===t.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement(u().Fragment,null,u().createElement(dn,null,u().createElement("title",null,"Cattery - ",this.state.project.title),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin).concat(this.state.project.url)})),u().createElement("div",{className:"extension-view"},u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:vn.createMarkup(t.title)}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(np,null),u().createElement("time",null,"Published ",t.publishedDT),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"})),t.viewer.e&&u().createElement(Mj,{project:t})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(vv,{gallery:t.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(t.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Description"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.description)}),u().createElement(dk,{list:t.categories,path:this.props.filterPath}),!1,u().createElement(R_,{list:t.products,path:this.props.filterPath})))),u().createElement(fP,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(EP,{label:"Downloads",visible:!0},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(Jk,{list:t.content,projectID:t.id,viewer:t.viewer})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"License and Acknowledgment"),t.license&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.license)})))),u().createElement(EP,{label:"Instructions",visible:t.installation||t.usage},u().createElement("div",{className:"project-info-container"},t.installation&&u().createElement(u().Fragment,null,u().createElement("h4",null,"Install"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.installation)})),t.usage&&u().createElement(u().Fragment,null,u().createElement("h4",null,"How To Use"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.usage)})))))))}}])&&Wj(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Yj.propTypes={project:d().object,filterPath:d().string},Yj.defaultProps={filterPath:"/cattery"};const Xj=it(Yj);function Zj(e){return Zj="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},Zj(e)}function eC(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,tC(r.key),r)}}function tC(e){var t=function(e,t){if("object"!=Zj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Zj(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zj(t)?t:t+""}function nC(e,t,n){return t=oC(t),function(e,t){if(t&&("object"===Zj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rC()?Reflect.construct(t,n||[],oC(e).constructor):t.apply(e,n))}function rC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rC=function(){return!!e})()}function oC(e){return oC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oC(e)}function iC(e,t){return iC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iC(e,t)}var aC=it(function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),nC(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iC(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return u().createElement(ot,null,u().createElement(rt,{exact:!0,strict:!0,path:"/cattery/faq"},u().createElement(rP,null)),u().createElement(rt,{path:"/cattery/:id/:slug?"},u().createElement(Xj,null)),u().createElement(rt,{path:"/cattery"},u().createElement(u().Fragment,null,u().createElement(dn,null,u().createElement("title",null,"Cattery"),u().createElement("link",{rel:"canonical",href:"".concat(window.location.origin,"/cattery")})),u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,u().createElement("img",{src:"/common/img/logos/Cattery_BlackYellow.svg"})),u().createElement("p",null,"A library of open-source machine learning models converted to .cat files to run natively inside Nuke."),u().createElement("p",null,"The .cat files in this library are all subject to the ",u().createElement("a",{href:"/license/bsd3clause"},"BSD 3-Clause license"),". Foundry does not certify or approve, nor are we responsible for, the licensing or legal framework to the underlying pre-trained model, associated training data, and dependencies. The User should undertake independent investigation of the underlying files in so far as it is relevant to the User's intended use."),u().createElement("p",null,"Additional information can be found in our ",u().createElement("a",{href:"/cattery/faq"},"Cattery FAQ"),"."))),u().createElement("div",{className:"content-section"},u().createElement(fO,{type:"Cattery",section:"cattery"})))))}}])&&eC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component));const sC=function(e){return $("#globalFooter").removeClass("hide"),u().createElement("div",{className:"app cattery"},u().createElement(dn,{defaultTitle:"Cattery | Foundry Community",titleTemplate:"%s | Foundry Community"}),u().createElement(at,null,u().createElement(aC,null)))};function cC(e){return cC="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},cC(e)}function lC(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,uC(r.key),r)}}function uC(e){var t=function(e,t){if("object"!=cC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cC(t)?t:t+""}function pC(e,t,n){return t=hC(t),function(e,t){if(t&&("object"===cC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fC()?Reflect.construct(t,n||[],hC(e).constructor):t.apply(e,n))}function fC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fC=function(){return!!e})()}function hC(e){return hC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hC(e)}function dC(e,t){return dC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dC(e,t)}var yC=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=pC(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.state={metrics:n.props.project.metrics},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dC(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=[];e.content.forEach((function(e,n){t.push(u().createElement(lv,{key:e.id,content:e}))}),this);var n=null;if(!0===this.props.isSignedIn){var r=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(r=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),n=[],!1===e.viewer.isOwner&&n.push(u().createElement(xP,{key:0,consumer:"Project",id:e.id,isLiked:r,onChange:this.onMetricsChange}))}var o=null;return!0===e.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:vn.createMarkup(e.title)}),u().createElement(ki,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(np,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(Mj,{project:e})))),u().createElement("div",{className:"portfolio-project-gallery"},t),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(e.description)})),u().createElement("div",{className:"project-info-block-section"},u().createElement(dk,{list:e.categories,path:this.props.filterPath}),u().createElement(Ok,{list:e.tags,path:this.props.filterPath}),u().createElement(R_,{list:e.products,path:this.props.filterPath})))))}}])&&lC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);yC.propTypes={project:d().object,isSignedIn:d().bool,filterPath:d().string},yC.defaultProps={isSignedIn:!1,filterPath:"/explore"};const mC=yC;function bC(e){return bC="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},bC(e)}function vC(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,gC(r.key),r)}}function gC(e){var t=function(e,t){if("object"!=bC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=bC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bC(t)?t:t+""}function wC(e,t,n){return t=SC(t),function(e,t){if(t&&("object"===bC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,EC()?Reflect.construct(t,n||[],SC(e).constructor):t.apply(e,n))}function EC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(EC=function(){return!!e})()}function SC(e){return SC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SC(e)}function OC(e,t){return OC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OC(e,t)}var _C=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=wC(this,t,[e])).getData=n.getData.bind(n),n.state={hasLoaded:!1,collections:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OC(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){null!=this.props.projectID&&this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/playlist/containing/"+this.props.projectID).done((function(t,n,r){e.setState({hasLoaded:!0,collections:t.collections})})).fail((function(e,t,n){}))}},{key:"render",value:function(){if(!1===this.state.hasLoaded||!0===this.state.hasLoaded&&null===this.state.collections)return null;var e=this.state.collections.map((function(e,t){return u().createElement(Lc,{key:e.id,collection:e})}));return u().createElement("div",{className:"subsection project"},u().createElement("div",{className:"subsection-intro"},u().createElement("h3",null,"Courses and Playlists containing this video")),u().createElement("div",{className:"content-section"},u().createElement(Cc,null,u().createElement("div",null,e))))}}])&&vC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);_C.propTypes={projectID:d().number};const PC=_C;function kC(e){return kC="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},kC(e)}function jC(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,CC(r.key),r)}}function CC(e){var t=function(e,t){if("object"!=kC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=kC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kC(t)?t:t+""}function TC(e,t,n){return t=DC(t),function(e,t){if(t&&("object"===kC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xC()?Reflect.construct(t,n||[],DC(e).constructor):t.apply(e,n))}function xC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xC=function(){return!!e})()}function DC(e){return DC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},DC(e)}function NC(e,t){return NC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NC(e,t)}var RC=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=TC(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.state={metrics:n.props.project.metrics},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NC(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===this.props.isSignedIn){var n=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(n=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===this.props.project.viewer.isOwner&&t.push(u().createElement(xP,{key:0,consumer:"Project",id:e.id,isLiked:n,onChange:this.onMetricsChange}))}var r=null;return!0===e.isFeatured?r=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},r,u().createElement("h2",{dangerouslySetInnerHTML:vn.createMarkup(e.title)}),u().createElement(ki,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},t,u().createElement(np,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(Mj,{project:e})))),u().createElement("div",{className:"training-project-gallery"},u().createElement(lv,{display:"hero",content:e.content[0]})),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(e.description)})),u().createElement("div",{className:"project-info-block-section"},u().createElement(dk,{list:e.categories,path:this.props.filterPath}),u().createElement(Ok,{list:e.tags,path:this.props.filterPath}),u().createElement(R_,{list:e.products,path:this.props.filterPath})))),u().createElement(PC,{projectID:e.id}))}}])&&jC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);RC.propTypes={project:d().object,isSignedIn:d().bool,filterPath:d().string},RC.defaultProps={isSignedIn:!1,filterPath:"/watch"};const MC=RC;function IC(e){return IC="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},IC(e)}function AC(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,LC(r.key),r)}}function LC(e){var t=function(e,t){if("object"!=IC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=IC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==IC(t)?t:t+""}function BC(e,t,n){return t=UC(t),function(e,t){if(t&&("object"===IC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,FC()?Reflect.construct(t,n||[],UC(e).constructor):t.apply(e,n))}function FC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(FC=function(){return!!e})()}function UC(e){return UC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},UC(e)}function qC(e,t){return qC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qC(e,t)}var KC=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=BC(this,t,[e])).getTOS=n.getTOS.bind(n),n.addToCart=n.addToCart.bind(n),n.onDownload=n.onDownload.bind(n),n.handleTOS=n.handleTOS.bind(n),n.closeTOS=n.closeTOS.bind(n),n.DownloadType={Download:1,Cart:2},n.download=null,n.tos=[],n.state={showTOS:!1,tos:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qC(e,t)}(t,e),n=t,r=[{key:"getTOS",value:function(e){}},{key:"addToCart",value:function(e){var t=this.props.list[e];if(null==t.viewer.licenseAgreement)return this.download={type:this.DownloadType.Cart,index:e,format:null},this.setState({showTOS:!0,tos:t.license}),!1;this.refs.cart.addToCart(t.data)}},{key:"onDownload",value:function(e,t){var n=this.props.list[e];if(null==n.viewer.licenseAgreement)return this.download={type:this.DownloadType.Download,index:e,format:t},this.setState({showTOS:!0,tos:n.license}),!1;var r="/share/".concat(this.props.projectID,"/content/").concat(n.data,"/download");null!=t&&(r+="?format=".concat(t)),window.location.replace(r)}},{key:"handleTOS",value:function(e,t,n){for(var r=this,o=0;o<=this.props.list.length-1;o++)this.props.list[o].license==e&&(this.props.list[o].viewer.licenseAgreement=n);this.setState({showTOS:!1,tos:null},(function(){if(t&&null!=r.download)switch(r.download.type){case r.DownloadType.Download:r.onDownload(r.download.index,r.download.format);break;case r.DownloadType.Cart:r.addToCart(r.download.index)}}))}},{key:"closeTOS",value:function(){!0===this.state.showTOS&&this.setState({showTOS:!1})}},{key:"render",value:function(){var e=[];return this.props.list.forEach((function(t,n){var r=[];if(this.props.viewer.isSignedIn||this.props.viewer.isDassault){var o,i=t.niceFormat;"ModoPackage"===t.format&&(o=u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,"zip")},"Download as Zip")),r.push(u().createElement("li",{key:"d"},u().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,null)},"Download ",i),o)),this.props.viewer.isSignedIn&&r.push(u().createElement("li",{key:"c"},u().createElement("button",{type:"button",className:"button btn-small",onClick:this.addToCart.bind(null,n)},"Add to Download Cart")))}else r=u().createElement("li",null,u().createElement("a",{href:this.props.viewer.signInUrl,className:"button btn-small icon icon-after icon-download"},"Sign in to download"));e.push(u().createElement(WS,{key:t.id,content:t},u().createElement("ul",{className:"files"},r)))}),this),u().createElement("div",{style:{position:"relative"}},u().createElement("h4",{className:"clearfix"},"Downloads ",!0===this.props.viewer.isSignedIn&&u().createElement(oO,{ref:"cart",inline:!0})),u().createElement("div",{className:"share-downloads"},e),this.state.showTOS&&u().createElement(L,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!1,onClose:this.closeTOS,contentStyle:{backgroundColor:"white",padding:"40px"}},u().createElement(Uk,{id:6,license:this.state.tos,onAction:this.handleTOS})))}}],r&&AC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);KC.propTypes={projectID:d().number,list:d().array,viewer:d().object};const VC=KC;function zC(e){return zC="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},zC(e)}function WC(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,HC(r.key),r)}}function HC(e){var t=function(e,t){if("object"!=zC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=zC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zC(t)?t:t+""}function $C(e,t,n){return t=JC(t),function(e,t){if(t&&("object"===zC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,GC()?Reflect.construct(t,n||[],JC(e).constructor):t.apply(e,n))}function GC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(GC=function(){return!!e})()}function JC(e){return JC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JC(e)}function QC(e,t){return QC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},QC(e,t)}var YC=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=$C(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.state={metrics:n.props.project.metrics},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QC(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===e.viewer.isSignedIn){var n=null;null!=e.viewer.actions&&(null!=e.viewer.actions.rate&&(n=e.viewer.actions.rate.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===e.viewer.isOwner&&t.push(u().createElement(YP,{key:0,consumer:"Project",id:e.id,rating:n}))}var r=null;return!0===e.isFeatured?r=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=u().createElement("h3",null,"Work in progress")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},r,u().createElement("h2",{dangerouslySetInnerHTML:vn.createMarkup(e.title)}),u().createElement(ki,{profile:e.profile}),u().createElement("div",{className:"hero-meta clearfix"},t,u().createElement(np,null),u().createElement("time",null,"Published ",e.publishedDT),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&u().createElement(Mj,{project:e})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(vv,{gallery:e.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(e.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Project info"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(e.description)}),u().createElement(VC,{list:e.content,projectID:e.id,viewer:e.viewer}),u().createElement(dk,{list:e.categories,path:this.props.filterPath}),u().createElement(Ok,{list:e.tags,path:this.props.filterPath}),u().createElement(R_,{list:e.products,path:this.props.filterPath}),u().createElement(Vj,{licenses:e.licenses})))))}}])&&WC(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);YC.propTypes={project:d().object,filterPath:d().string},YC.defaultProps={filterPath:"/share"};const XC=YC;function ZC(e){return ZC="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},ZC(e)}function eT(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,tT(r.key),r)}}function tT(e){var t=function(e,t){if("object"!=ZC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ZC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ZC(t)?t:t+""}function nT(e,t,n){return t=oT(t),function(e,t){if(t&&("object"===ZC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,rT()?Reflect.construct(t,n||[],oT(e).constructor):t.apply(e,n))}function rT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rT=function(){return!!e})()}function oT(e){return oT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oT(e)}function iT(e,t){return iT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iT(e,t)}var aT=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=nT(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.state={metrics:n.props.project.metrics},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iT(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this,t=this.props.project,n=null;if(!0===t.viewer.isSignedIn){var r=null;null!=t.viewer.actions&&(null!=t.viewer.actions.rate&&(r=t.viewer.actions.rate.value),null!=t.viewer.actions.watch&&t.viewer.actions.watch.value),n=[],!1===t.viewer.isOwner&&n.push(u().createElement(YP,{key:0,consumer:"Project",id:t.id,rating:r}))}var o=null;return!0===t.isFeatured?o=u().createElement("h3",null,u().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===t.completionStatus&&(o=u().createElement("h3",null,"Work in progress")),u().createElement("div",{className:"extension-view"},u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper"},o,u().createElement("h2",{dangerouslySetInnerHTML:vn.createMarkup(t.title)}),u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(np,null),u().createElement("time",null,"Published ",t.publishedDT),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"})),t.viewer.e&&u().createElement(Mj,{project:t})))),u().createElement("div",{className:"project-info-block"},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(vv,{gallery:t.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(t.id,"/content/{0}")})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"Description"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.description)}),u().createElement(dk,{list:t.categories,path:this.props.filterPath}),!1,u().createElement(R_,{list:t.products,path:this.props.filterPath})))),u().createElement(fP,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(EP,{label:"Downloads",visible:!0},u().createElement("div",{className:"project-info-container clearfix"},u().createElement("div",{className:"project-info-block-section"},u().createElement(Jk,{list:t.content,projectID:t.id,viewer:t.viewer})),u().createElement("div",{className:"project-info-block-section"},u().createElement("h4",null,"License and Acknowledgment"),t.license&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.license)})))),u().createElement(EP,{label:"Instructions",visible:t.installation||t.usage},u().createElement("div",{className:"project-info-container"},t.installation&&u().createElement(u().Fragment,null,u().createElement("h4",null,"Install"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.installation)})),t.usage&&u().createElement(u().Fragment,null,u().createElement("h4",null,"How To Use"),u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(t.usage)}))))))}}])&&eT(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);aT.propTypes={project:d().object,filterPath:d().string},aT.defaultProps={filterPath:"/cattery"};const sT=aT;function cT(e){return cT="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},cT(e)}function lT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uT(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,fT(r.key),r)}}function pT(e,t,n){return t&&uT(e.prototype,t),n&&uT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fT(e){var t=function(e,t){if("object"!=cT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cT(t)?t:t+""}function hT(e,t,n){return t=yT(t),function(e,t){if(t&&("object"===cT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dT()?Reflect.construct(t,n||[],yT(e).constructor):t.apply(e,n))}function dT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dT=function(){return!!e})()}function yT(e){return yT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yT(e)}function mT(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bT(e,t)}function bT(e,t){return bT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bT(e,t)}var vT=function(e){function t(e){var n;return lT(this,t),(n=hT(this,t,[e])).setup=n.setup.bind(n),n.handleCancel=n.handleCancel.bind(n),n.handleSubmit=n.handleSubmit.bind(n),n.onCourseTypeChange=n.onCourseTypeChange.bind(n),n.state={form:n.props.form?n.props.form:null,loadStatus:n.props.form?c.LoadStatus.Loaded:c.LoadStatus.PreLoad},n}return mT(t,e),pT(t,[{key:"componentDidMount",value:function(){null==this.state.form&&this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.form!==this.state.form&&this.setState({form:e.form})}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/collection/"+this.props.id).done((function(t,n,r){e.setState({form:t,loadStatus:c.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel&&this.props.onCancel()}},{key:"handleSubmit",value:function(){var e=this;if(this.refs.titleLocalizations.validate()){var t=this.refs.pac.getSelectedOptions(),n={courseType:this.refs.courseType.getValue(),titleLocalizations:this.refs.titleLocalizations.getValue(),coverDescriptionLocalizations:this.refs.coverDescriptionLocalizations.getValue(),descriptionLocalizations:this.refs.descriptionLocalizations.getValue(),productData:t.productData,categoryData:t.categoryData,tagData:this.refs.tags.getTags()};$.ajax({type:"POST",url:"/admintia/api/collection/"+this.props.id,data:n,dataType:"json",context:this}).done((function(t,n,r){e.props.onSubmit&&e.props.onSubmit(t.data.form),alerts.success("updated")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"onCourseTypeChange",value:function(e){var t=Co()(this.state.form);t.courseType=e,this.setState({form:t})}},{key:"render",value:function(){if(this.state.loadStatus!=c.LoadStatus.Loaded)return u().createElement(kn,null);var e=10,t="Full Description",n="Full (overview) description...";switch(this.state.form.courseType){case"Article":e=30,t="Article Body",n="Article body...";break;case"Link":e=1,t="Target Url",n="Target url the course card will link to (absolute url, not relative)..."}return u().createElement("div",{className:"admin-collection-form clearfix"},u().createElement("div",{className:"row",style:{marginBottom:"20px",borderBottom:"1px solid #EEE"}},u().createElement("div",{className:"col-md-12"},u().createElement(nE,{ref:"courseType",name:"courseType",label:"Course Type",options:this.state.form.courseTypeOptions,value:this.state.form.courseType,onChange:this.onCourseTypeChange}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(oj,{ref:"titleLocalizations",label:"Title",placeholder:"Name your collection...",value:this.state.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(oj,{ref:"coverDescriptionLocalizations",label:"Cover Description",placeholder:"Cover (simple) description...",value:this.state.form.coverDescriptionLocalizations,rows:5,required:!1,requiredErrorMessage:"English cover description required at minimum."}))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(oj,{ref:"descriptionLocalizations",label:t,placeholder:n,value:this.state.form.descriptionLocalizations,rows:e,required:!1,requiredErrorMessage:"English description required at minimum."}))),u().createElement(gT,{ref:"pac",form:this.state.form}),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(vj,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.state.form.tagData}))),u().createElement("ul",{className:"list-inline pull-right"},u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),u().createElement("li",null,u().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Changes"))))}}])}(u().Component),gT=function(e){function t(e){var n;return lT(this,t),(n=hT(this,t,[e])).getSelectedOptions=n.getSelectedOptions.bind(n),n.handleProductChange=n.handleProductChange.bind(n),n.handleCategoryChange=n.handleCategoryChange.bind(n),n.state={productData:n.props.form?n.props.form.productData:null,categoryOptions:n.props.form?n.props.form.categoryOptions:null,categoryData:n.props.form?n.props.form.categoryData:null},n}return mT(t,e),pT(t,[{key:"getSelectedOptions",value:function(){return{productData:this.refs.product.getSelectedOptions(),categoryData:this.refs.category.getSelectedOptions()}}},{key:"handleProductChange",value:function(e){$.ajax({type:"GET",url:"/admintia/api/common/get-categories",traditional:!0,data:{products:null==e?void 0:e.map((function(e){return e.value}))},context:this}).done((function(t,n,r){this.setState({productData:e,categoryOptions:t})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleCategoryChange",value:function(e){this.setState({categoryData:e})}},{key:"render",value:function(){return u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!1,options:this.props.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.productData,onChange:this.handleProductChange})),u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!1,options:this.state.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.categoryData,onChange:this.handleCategoryChange})))}}])}(u().Component);vT.propTypes={id:d().number.isRequired,form:d().object,onCancel:d().func,onSubmit:d().func};const wT=vT;function ET(e){return ET="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},ET(e)}function ST(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,OT(r.key),r)}}function OT(e){var t=function(e,t){if("object"!=ET(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ET(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ET(t)?t:t+""}function _T(e,t,n){return t=kT(t),function(e,t){if(t&&("object"===ET(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,PT()?Reflect.construct(t,n||[],kT(e).constructor):t.apply(e,n))}function PT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(PT=function(){return!!e})()}function kT(e){return kT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kT(e)}function jT(e,t){return jT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jT(e,t)}const CT=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=_T(this,t,[e])).setup=n.setup.bind(n),n.handleEditClick=n.handleEditClick.bind(n),n.handleEditCancel=n.handleEditCancel.bind(n),n.handleEditComplete=n.handleEditComplete.bind(n),n.state={showPanel:!1,showEdit:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jT(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/collection/e").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(e){window.location.reload(!0)}},{key:"render",value:function(){return u().createElement("div",{className:"topic-editor clearfix"},u().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Collection"),this.state.showEdit&&u().createElement(wT,{id:this.props.id,onSubmit:this.handleEditComplete,onCancel:this.handleEditCancel}))}}])&&ST(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function TT(e){return TT="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},TT(e)}function xT(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,DT(r.key),r)}}function DT(e){var t=function(e,t){if("object"!=TT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=TT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==TT(t)?t:t+""}function NT(e,t,n){return t=MT(t),function(e,t){if(t&&("object"===TT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,RT()?Reflect.construct(t,n||[],MT(e).constructor):t.apply(e,n))}function RT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(RT=function(){return!!e})()}function MT(e){return MT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MT(e)}function IT(e,t){return IT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IT(e,t)}var AT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),NT(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IT(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.duration)return null;var e=vn.niceDuration(this.props.duration);return u().createElement("div",{className:"duration clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Length),u().createElement("div",{className:"length",dangerouslySetInnerHTML:vn.createMarkup(e)}))}}])&&xT(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);AT.propTypes={duration:d().number};const LT=AT;function BT(e){return BT="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},BT(e)}function FT(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,UT(r.key),r)}}function UT(e){var t=function(e,t){if("object"!=BT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=BT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BT(t)?t:t+""}function qT(e,t,n){return t=VT(t),function(e,t){if(t&&("object"===BT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,KT()?Reflect.construct(t,n||[],VT(e).constructor):t.apply(e,n))}function KT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(KT=function(){return!!e})()}function VT(e){return VT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VT(e)}function zT(e,t){return zT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zT(e,t)}const WT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qT(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zT(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=null,o=null;t.video.attributes.duration&&(r=vn.niceDuration(t.video.attributes.duration),!t.viewer||!0!==t.viewer.hasWatchedAll||null!=t.viewer.timestamp&&0!=t.viewer.timestamp?t.viewer&&null!=t.viewer.timestamp&&0!=t.viewer.timestamp&&(o=100*(t.viewer.timestamp/t.video.attributes.duration).toFixed(2)):o=100);var i="".concat(e.props.playerUrl,"?start=").concat(n);return u().createElement("li",{key:n},u().createElement("a",{href:i},u().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),u().createElement("div",{className:"info-container"},u().createElement("div",{className:"info"},u().createElement("span",{className:"title",dangerouslySetInnerHTML:vn.createMarkup(t.title)}),t.viewer&&1==t.viewer.hasWatchedAll&&u().createElement("span",{className:"watched fa fa-check-circle-o"}),null!=r&&u().createElement("span",{className:"duration"},r)),null!=o&&u().createElement(Mh,{percentComplete:o}))))}));return u().createElement("div",{className:"curriculum"},u().createElement("ol",null,t))}}])&&FT(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function HT(e){return HT="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},HT(e)}function $T(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,GT(r.key),r)}}function GT(e){var t=function(e,t){if("object"!=HT(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=HT(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HT(t)?t:t+""}function JT(e,t,n){return t=YT(t),function(e,t){if(t&&("object"===HT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,QT()?Reflect.construct(t,n||[],YT(e).constructor):t.apply(e,n))}function QT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(QT=function(){return!!e})()}function YT(e){return YT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},YT(e)}function XT(e,t){return XT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XT(e,t)}var ZT=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=JT(this,t,[e])).onDownload=n.onDownload.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XT(e,t)}(t,e),n=t,r=[{key:"onDownload",value:function(e){var t=this.props.files[e],n="/collection/".concat(this.props.id,"/content/").concat(t.id,"/download");window.location.replace(n)}},{key:"render",value:function(){var e=this;if(null==this.props.files||0==this.props.files.length)return null;var t=this.props.files.map((function(t,n){return u().createElement("li",{onClick:e.onDownload.bind(null,n),key:n},u().createElement("div",{className:"title"},t.title),t.attributes&&t.attributes.size&&u().createElement("div",{className:"filesize icon icon-after icon-download"},vn.niceFileSize(t.attributes.size)))}));return u().createElement("ul",{className:"playlist-files"},t)}}],r&&$T(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);ZT.propTypes={id:d().number.isRequired,files:d().array};const ex=ZT;function tx(e){return tx="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},tx(e)}function nx(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,rx(r.key),r)}}function rx(e){var t=function(e,t){if("object"!=tx(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=tx(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tx(t)?t:t+""}function ox(e,t,n){return t=ax(t),function(e,t){if(t&&("object"===tx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ix()?Reflect.construct(t,n||[],ax(e).constructor):t.apply(e,n))}function ix(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ix=function(){return!!e})()}function ax(e){return ax=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ax(e)}function sx(e,t){return sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sx(e,t)}var cx=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=ox(this,t,[e])).handleEditContentClick=n.handleEditContentClick.bind(n),n.startingIndex=0,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sx(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"handleEditContentClick",value:function(){this.setState({mode:this.Modes.Edit})}},{key:"render",value:function(){var e=this,t="Watch Playlist";return this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?t="Watch Again":(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(t="Continue Watching")),u().createElement("div",null,u().createElement("section",{id:"heroBanner"},u().createElement("div",{className:"hero-content"},u().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.title)}),this.props.collection.viewer.e&&u().createElement(CT,{id:this.props.collection.id}))),u().createElement("div",{className:"playlist-header"},u().createElement("div",{className:"teaser"},null!=this.props.collection.teaser?u().createElement(lv,{display:"hero",content:this.props.collection.teaser}):u().createElement("img",{src:this.props.collection.thumbUrl})),u().createElement("div",{className:"info playlist-data"},u().createElement(LT,{duration:this.props.collection.attributes.duration}),!1,u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},t))),u().createElement(fP,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(EP,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&u().createElement("div",{className:"description",dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.description)}),u().createElement(WT,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),u().createElement(Ok,{list:this.props.collection.tags,path:this.props.filterPath}),u().createElement(R_,{list:this.props.collection.products,path:this.props.filterPath})),u().createElement(EP,{label:TFWeb.Resources.UI.Files,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},u().createElement(ex,{id:this.props.collection.id,files:this.props.collection.files}))))}}])&&nx(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);cx.propTypes={collection:d().object,filterPath:d().string},cx.defaultProps={filterPath:"/watch"};const lx=cx;function ux(e){return ux="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},ux(e)}function px(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,fx(r.key),r)}}function fx(e){var t=function(e,t){if("object"!=ux(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ux(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ux(t)?t:t+""}function hx(e,t,n){return t=yx(t),function(e,t){if(t&&("object"===ux(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dx()?Reflect.construct(t,n||[],yx(e).constructor):t.apply(e,n))}function dx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dx=function(){return!!e})()}function yx(e){return yx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yx(e)}function mx(e,t){return mx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},mx(e,t)}var bx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hx(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mx(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list)return null;var e=this.props.list.map((function(e,t){return u().createElement("li",{key:t},u().createElement("a",{href:e.url},e.title))}));return u().createElement("div",{className:"gallery-membership"},"Course in ",u().createElement("ul",null,e))}}])&&px(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);bx.propTypes={list:d().array};const vx=bx;function gx(e){return gx="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},gx(e)}function wx(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,Ex(r.key),r)}}function Ex(e){var t=function(e,t){if("object"!=gx(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gx(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gx(t)?t:t+""}function Sx(e,t,n){return t=_x(t),function(e,t){if(t&&("object"===gx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ox()?Reflect.construct(t,n||[],_x(e).constructor):t.apply(e,n))}function Ox(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ox=function(){return!!e})()}function _x(e){return _x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_x(e)}function Px(e,t){return Px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Px(e,t)}const kx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Sx(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Px(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=null,t=null,n=null;return this.props.bannerImage&&(e={backgroundImage:"url(".concat(this.props.bannerImage.fileName,")")},t="bannerBkgImg",n={paddingTop:"70px"}),u().createElement("section",{id:"heroBanner",className:t,style:e},u().createElement("div",{className:"hero-content"},u().createElement("div",{className:"row-wrapper",style:n},u().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:vn.createMarkup(this.props.title)}),this.props.children)))}}])&&wx(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);function jx(e){return jx="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},jx(e)}function Cx(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,Tx(r.key),r)}}function Tx(e){var t=function(e,t){if("object"!=jx(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=jx(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jx(t)?t:t+""}function xx(e,t,n){return t=Nx(t),function(e,t){if(t&&("object"===jx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dx()?Reflect.construct(t,n||[],Nx(e).constructor):t.apply(e,n))}function Dx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Dx=function(){return!!e})()}function Nx(e){return Nx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Nx(e)}function Rx(e,t){return Rx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rx(e,t)}var Mx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xx(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rx(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"instructors clearfix"},u().createElement("h4",null,this.props.list.length>1?TFWeb.Resources.UI.Instructors:TFWeb.Resources.UI.Instructor),u().createElement("div",{className:"instructor"},e))}}])&&Cx(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Mx.propTypes={list:d().array},Mx.defaultProps={list:[]};const Ix=Mx;function Ax(e){return Ax="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},Ax(e)}function Lx(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,Bx(r.key),r)}}function Bx(e){var t=function(e,t){if("object"!=Ax(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ax(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ax(t)?t:t+""}function Fx(e,t,n){return t=qx(t),function(e,t){if(t&&("object"===Ax(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ux()?Reflect.construct(t,n||[],qx(e).constructor):t.apply(e,n))}function Ux(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ux=function(){return!!e})()}function qx(e){return qx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qx(e)}function Kx(e,t){return Kx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kx(e,t)}var Vx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Fx(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kx(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"captions clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Captions),u().createElement("div",{className:"closed-captions"},e))}}])&&Lx(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Vx.propTypes={list:d().array},Vx.defaultProps={list:[]};const zx=Vx;function Wx(e){return Wx="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},Wx(e)}function Hx(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,$x(r.key),r)}}function $x(e){var t=function(e,t){if("object"!=Wx(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Wx(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wx(t)?t:t+""}function Gx(e,t,n){return t=Qx(t),function(e,t){if(t&&("object"===Wx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Jx()?Reflect.construct(t,n||[],Qx(e).constructor):t.apply(e,n))}function Jx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jx=function(){return!!e})()}function Qx(e){return Qx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qx(e)}function Yx(e,t){return Yx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Yx(e,t)}var Xx=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gx(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yx(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return u().createElement("span",{key:t},e)}));return u().createElement("div",{className:"releases clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.VersionRequired),u().createElement("div",{className:"software"},e))}}])&&Hx(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);Xx.propTypes={list:d().array},Xx.defaultProps={list:[]};const Zx=Xx;function eD(e){return eD="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},eD(e)}function tD(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,nD(r.key),r)}}function nD(e){var t=function(e,t){if("object"!=eD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eD(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eD(t)?t:t+""}function rD(e,t,n){return t=iD(t),function(e,t){if(t&&("object"===eD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oD()?Reflect.construct(t,n||[],iD(e).constructor):t.apply(e,n))}function oD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oD=function(){return!!e})()}function iD(e){return iD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iD(e)}function aD(e,t){return aD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aD(e,t)}var sD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),rD(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aD(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){if(!this.props.experienceLevel||"None"==this.props.experienceLevel)return null;var e=TFWeb.Resources.UI.getString("Experience.".concat(this.props.experienceLevel));return u().createElement("div",{className:"experience clearfix"},u().createElement("h4",null,TFWeb.Resources.UI.Level),u().createElement("div",{className:"experience-level",dangerouslySetInnerHTML:vn.createMarkup(e)}))}}])&&tD(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);sD.propTypes={experienceLevel:d().string};const cD=sD;function lD(e){return lD="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},lD(e)}function uD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pD(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,hD(r.key),r)}}function fD(e,t,n){return t&&pD(e.prototype,t),n&&pD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hD(e){var t=function(e,t){if("object"!=lD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lD(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lD(t)?t:t+""}function dD(e,t,n){return t=mD(t),function(e,t){if(t&&("object"===lD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yD()?Reflect.construct(t,n||[],mD(e).constructor):t.apply(e,n))}function yD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yD=function(){return!!e})()}function mD(e){return mD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mD(e)}function bD(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vD(e,t)}function vD(e,t){return vD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vD(e,t)}var gD=function(e){function t(e){var n;return uD(this,t),(n=dD(this,t,[e])).onMetricsChange=n.onMetricsChange.bind(n),n.viewDownloads=n.viewDownloads.bind(n),n.startingIndex=0,n.state={metrics:n.props.collection.metrics},n}return bD(t,e),fD(t,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"viewDownloads",value:function(){this.tabs.setTab(1)}},{key:"render",value:function(){var e=this,t=this.props.collection,n=null;if(!0===t.viewer.isSignedIn){var r=null;null!=t.viewer.actions&&null!=t.viewer.actions.rate&&(r=t.viewer.actions.rate.value),(n=[]).push(u().createElement(YP,{key:0,consumer:"Collection",id:t.id,rating:r}))}var o=null;if(null!=this.props.collection.playlist&&this.props.collection.playlist.length>0){var i=TFWeb.Resources.UI.CoursePlayButton.StartTheCourse;this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?i=TFWeb.Resources.UI.CoursePlayButton.WatchAgain:(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(i=TFWeb.Resources.UI.CoursePlayButton.ContinueWatching)),o=u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},i)}else null!=this.props.collection.files&&this.props.collection.files.length>0&&(o=u().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.viewDownloads},"View Course Files"));var a=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(a=this.props.collection.bulletPoints.map((function(e,t){var n=e.type.toLowerCase()+" clearfix";return u().createElement("div",{className:n,key:t},u().createElement("h4",null,e.title),u().createElement("div",{className:"length",dangerouslySetInnerHTML:vn.createMarkup(e.text)}))})));var s;return s=null!=this.props.collection.teaser?u().createElement(lv,{display:"hero",content:this.props.collection.teaser},!1):u().createElement(wD,{src:this.props.collection.thumbUrl,playerUrl:this.props.collection.playerUrl,showButton:"Standard"==this.props.collection.courseType&&null!=this.props.collection.playlist&&this.props.collection.playlist.length>0}),u().createElement("div",{className:"course"},u().createElement(kx,{title:this.props.collection.title,bannerImage:this.props.collection.bannerImage},u().createElement("div",{className:"hero-meta clearfix"},n,u().createElement(np,null),u().createElement(vx,{list:this.props.collection.galleryMembership}),u().createElement(ro,{metrics:this.state.metrics,displayClass:"light"}))),u().createElement("div",{className:"playlist-header"},this.props.collection.galleryReturnNav&&u().createElement("div",{className:"gallery-link"},u().createElement("a",{href:this.props.collection.galleryReturnNav.url,className:"icon icon-before icon-backarrow"},this.props.collection.galleryReturnNav.text)),u().createElement("div",{className:"teaser"},u().createElement("div",null,s)),u().createElement("div",{className:"info playlist-data"},u().createElement(Ix,{list:this.props.collection.instructors}),u().createElement(cD,{experienceLevel:this.props.collection.experienceLevel}),u().createElement(LT,{duration:this.props.collection.attributes.duration}),u().createElement(Zx,{list:this.props.collection.productReleases}),u().createElement(zx,{list:this.props.collection.captions}),!1,a,o)),u().createElement(fP,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},u().createElement(EP,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&u().createElement("div",{className:"course-body",dangerouslySetInnerHTML:vn.createMarkup(this.props.collection.description)}),u().createElement(WT,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),!1,!1),u().createElement(EP,{label:TFWeb.Resources.UI.CourseFiles,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},u().createElement(ex,{id:this.props.collection.id,files:this.props.collection.files}))))}}])}(u().Component);gD.propTypes={collection:d().object,filterPath:d().string},gD.defaultProps={filterPath:"/watch"};var wD=function(e){function t(){return uD(this,t),dD(this,t,arguments)}return bD(t,e),fD(t,[{key:"render",value:function(){return u().createElement("div",{className:"teaser-image"},u().createElement("img",{src:this.props.src}),this.props.showButton&&u().createElement("a",{className:"play-button",href:this.props.playerUrl}))}}])}(u().Component);wD.propTypes={src:d().string,playerUrl:d().string,showButton:d().bool},wD.defaultProps={showButton:!1};const ED=gD;var SD=o(1160);function OD(e){return OD="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},OD(e)}function _D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PD(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,jD(r.key),r)}}function kD(e,t,n){return t&&PD(e.prototype,t),n&&PD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jD(e){var t=function(e,t){if("object"!=OD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=OD(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==OD(t)?t:t+""}function CD(e,t,n){return t=xD(t),function(e,t){if(t&&("object"===OD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,TD()?Reflect.construct(t,n||[],xD(e).constructor):t.apply(e,n))}function TD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(TD=function(){return!!e})()}function xD(e){return xD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xD(e)}function DD(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ND(e,t)}function ND(e,t){return ND=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ND(e,t)}var RD=function(e){function t(e){var n;return _D(this,t),(n=CD(this,t,[e])).handleResize=n.handleResize.bind(n),n.handleUnload=n.handleUnload.bind(n),n.setMediaDimensions=n.setMediaDimensions.bind(n),n.onPlaylistClick=n.onPlaylistClick.bind(n),n.setIndex=n.setIndex.bind(n),n.setTimestamp=n.setTimestamp.bind(n),n.captureTimestamp=n.captureTimestamp.bind(n),n.getCurrentTime=n.getCurrentTime.bind(n),n.onReady=n.onReady.bind(n),n.onStart=n.onStart.bind(n),n.onPlay=n.onPlay.bind(n),n.onProgress=n.onProgress.bind(n),n.onPause=n.onPause.bind(n),n.onSeek=n.onSeek.bind(n),n.onEnded=n.onEnded.bind(n),n.handleReplayVideo=n.handleReplayVideo.bind(n),n.handleNextVideo=n.handleNextVideo.bind(n),n.onCancel=n.onCancel.bind(n),n.playingNextTitle=n.playingNextTitle.bind(n),n.onTogglePlaylist=n.onTogglePlaylist.bind(n),n.playerState={Video:"Video",Next:"Next",Completed:"Completed"},n.videoPlayer=null,n.mediaWidth=null,n.mediaHeight=null,n.firstPlay=!0,n.elapsedTimeInterval=10,n.state={playerState:n.playerState.Video,index:n.props.collection.viewer&&n.props.collection.viewer.startIndex?n.props.collection.viewer.startIndex:0,showPlaylist:!0},n}return DD(t,e),kD(t,[{key:"componentDidMount",value:function(){this.setMediaDimensions()}},{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&(window.addEventListener("resize",this.handleResize),window.addEventListener("unload",this.handleUnload))}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.handleResize),window.removeEventListener("unload",this.handleUnload))}},{key:"componentDidUpdate",value:function(){this.setMediaDimensions()}},{key:"handleResize",value:function(e){this.setMediaDimensions()}},{key:"handleUnload",value:function(e){this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"setMediaDimensions",value:function(){this.mediaWidth=this.media.offsetWidth;var e=.5625*this.media.offsetWidth;this.mediaHeight=e}},{key:"onPlaylistClick",value:function(e){this.captureTimestamp(),this.setIndex(e)}},{key:"setIndex",value:function(e){if(e!=this.state.index){var t=this.playerState.Video;null==e&&(t=this.playerState.Completed),this.setState({playerState:t,index:e})}}},{key:"setTimestamp",value:function(e){if(this.props.collection.viewer.isSignedIn&&null!=e&&0!=e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n].index;this.props.collection.playlist[r].viewer.timestamp=e[n].seconds,!0===e[n].hasEnded&&(this.props.collection.playlist[r].viewer.hasWatchedAll=!0),t.push({p:this.props.collection.playlist[r].id,pc:this.props.collection.playlist[r].viewer.hasWatchedAll,t:e[n].seconds})}var o=this.props.collection.viewer.hasWatchedAll;if(!o)for(o=!0,n=0;n<=this.props.collection.playlist.length-1;n++)if(!1===this.props.collection.playlist[n].viewer.hasWatchedAll){o=!1;break}var i={id:this.props.collection.id,plc:o,pt:t};$.ajax({type:"POST",url:"/api/playlist/timestamp",contentType:"application/json; charset=utf-8",data:JSON.stringify(i),dataType:"json",context:this})}}},{key:"captureTimestamp",value:function(){this.player&&this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"getCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.getCurrentTime();return null==e&&(e=0),e}},{key:"onReady",value:function(){this.player&&1==this.firstPlay&&null!=this.props.collection.viewer&&null!=this.props.collection.viewer.timestamp&&this.player.seekTo(Math.floor(this.props.collection.viewer.timestamp),"seconds"),this.firstPlay=!1}},{key:"onStart",value:function(){}},{key:"onPlay",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onProgress",value:function(e){e&&e.playedSeconds&&!isNaN(e.playedSeconds)&&!isNaN(this.currentTime)&&Math.abs(Math.trunc(e.playedSeconds)-this.currentTime)>=this.elapsedTimeInterval&&(this.currentTime=Math.trunc(e.playedSeconds),this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}]))}},{key:"onPause",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onSeek",value:function(e){this.currentTime=e,this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onEnded",value:function(){var e=[{index:this.state.index,seconds:0,hasEnded:!0}],t=this.state.index+1,n=t>this.props.collection.playlist.length-1;n||e.push({index:t,seconds:0,hasEnded:!1}),this.setTimestamp(e),n?this.setIndex(null):this.setState({playerState:this.playerState.Next})}},{key:"handleReplayVideo",value:function(){this.setState({playerState:this.playerState.Video})}},{key:"handleNextVideo",value:function(){this.setIndex(this.state.index+1)}},{key:"onCancel",value:function(){}},{key:"playingNextTitle",value:function(){return this.state.index+1>this.props.collection.playlist.length-1?"":this.props.collection.playlist[this.state.index+1].title}},{key:"onTogglePlaylist",value:function(){this.setState({showPlaylist:!this.state.showPlaylist},(function(){this.setMediaDimensions()}))}},{key:"render",value:function(){var e=this,t=null,n=null;switch(this.state.playerState){case this.playerState.Video:var r=this.props.collection.playlist[this.state.index],o=r.video,i=null,a={};switch(o.format){case"Vimeo":i="https://vimeo.com/"+o.data;break;case"Wistia":i="https://home.wistia.com/medias/"+o.data;break;case"YouTube":i="https://www.youtube.com/watch?v="+o.data,a={youtube:{playerVars:{rel:0}}}}t=u().createElement(SD.Ay,{ref:function(t){e.player=t},url:i,config:a,controls:!0,playing:!0,onReady:this.onReady,onStart:this.onStart,onPlay:this.onPlay,onProgress:this.onProgress,onPause:this.onPause,onSeek:this.onSeek,onEnded:this.onEnded,loop:!1,width:"100%",height:"100%",className:"react-player"}),n=u().createElement("div",{className:"media-description"},u().createElement("h4",null,r.title));break;case this.playerState.Next:t=u().createElement(AD,{secondsRemaining:5,title:this.playingNextTitle(),message:"The video will automatically start in {time} seconds",onNext:this.handleNextVideo,onCancel:this.onCancel,onReplay:this.handleReplayVideo,width:this.mediaWidth,height:this.mediaHeight});break;case this.playerState.Completed:t=u().createElement(MD,{title:this.props.collection.title,url:this.props.collection.url,width:this.mediaWidth,height:this.mediaHeight})}return null==t?null:u().createElement("div",{className:"playlist-viewer",ref:function(t){e.viewer=t}},u().createElement("div",{className:"media-container"},u().createElement("div",{className:"controls",ref:function(t){e.controls=t}},u().createElement("h3",null,u().createElement("a",{href:this.props.collection.url,className:"icon icon-before icon-backarrow icon-color-white"},this.props.collection.title)),!1),u().createElement("div",{className:"media",ref:function(t){e.media=t}},u().createElement("div",{ref:function(t){e.mediaContainer=t},className:"player-wrapper"},t)),n),u().createElement("div",{className:"playlist-container"},u().createElement(ID,{playlist:this.props.collection.playlist,currentIndex:this.state.index,onPlaylistClick:this.onPlaylistClick})))}}])}(u().Component),MD=function(e){function t(){return _D(this,t),CD(this,t,arguments)}return DD(t,e),kD(t,[{key:"render",value:function(){var e={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"};return u().createElement("div",{className:"playlist-dialog playlist-completed",style:e},u().createElement("div",null,"Congratulations. You have completed ",u().createElement("span",null,this.props.title)),u().createElement("a",{href:this.props.url,className:"button"},"Return to overview"))}}])}(u().Component),ID=function(e){function t(e){var n;return _D(this,t),(n=CD(this,t,[e])).scrollToItem=n.scrollToItem.bind(n),n.state={showPlaylist:!0},n}return DD(t,e),kD(t,[{key:"componentDidMount",value:function(){this.scrollToItem()}},{key:"componentDidUpdate",value:function(e,t){this.scrollToItem()}},{key:"scrollToItem",value:function(){if(!($(document).width()<=1024)){var e=document.getElementsByClassName("now-playing");null!=e&&e.length>0&&(vn.isOnScreen(e[0])||e[0].scrollIntoView({behavior:"smooth",block:"center"}))}}},{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=n==e.props.currentIndex?"now-playing":"",o=null;return t.video.attributes.duration&&(o=vn.niceDuration(t.video.attributes.duration)),u().createElement("li",{key:n,className:r,onClick:e.props.onPlaylistClick.bind(null,n)},u().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),u().createElement("div",{className:"info"},u().createElement("h4",{dangerouslySetInnerHTML:vn.createMarkup(t.title)}),null!=o&&u().createElement("span",{className:"duration"},o)))})),n="playlist-items".concat(this.state.showPlaylist?"":" collapsed");return u().createElement("div",{className:n},u().createElement("ol",null,t))}}])}(u().Component),AD=function(e){function t(e){var n;return _D(this,t),(n=CD(this,t,[e])).tick=n.tick.bind(n),n.onReplay=n.onReplay.bind(n),n.onCancel=n.onCancel.bind(n),n.onNext=n.onNext.bind(n),n.format=n.format.bind(n),n.state={secondsRemaining:null},n}return DD(t,e),kD(t,[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onNext&&this.props.onNext())}},{key:"onReplay",value:function(){this.props.onReplay&&this.props.onReplay()}},{key:"onCancel",value:function(){var e=this;clearInterval(this.interval),this.setState({secondsRemaining:null},(function(){e.props.onCancel&&e.props.onCancel()}))}},{key:"onNext",value:function(){this.props.onNext&&this.props.onNext()}},{key:"format",value:function(e,t){if(""==e||null==t)return e;var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=null;null!=this.state.secondsRemaining&&(e="".concat(this.state.secondsRemaining%60));var t={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"},n=this.props.title?"Playing Next: ".concat(this.props.title):null;return u().createElement("div",{className:"playlist-dialog playing-next",style:t},u().createElement("div",null,null!=n&&n,null!=e&&u().createElement("span",null,this.format(this.props.message,{time:e})," ",u().createElement("button",{className:"btn-small",disabled:null==e,onClick:this.onCancel},"Cancel")," ")),u().createElement("div",null,u().createElement("button",{className:"btn-primary icon icon-before icon-refresh",onClick:this.onReplay},"Replay"),u().createElement("button",{className:"btn-primary icon icon-after icon-arrow",onClick:this.onNext},"Next")))}}])}(u().Component);const LD=RD;function BD(e){return BD="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},BD(e)}function FD(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,UD(r.key),r)}}function UD(e){var t=function(e,t){if("object"!=BD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=BD(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==BD(t)?t:t+""}function qD(e,t,n){return t=VD(t),function(e,t){if(t&&("object"===BD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,KD()?Reflect.construct(t,n||[],VD(e).constructor):t.apply(e,n))}function KD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(KD=function(){return!!e})()}function VD(e){return VD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VD(e)}function zD(e,t){return zD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zD(e,t)}var WD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qD(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zD(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"button-group"},this.props.currentStage>1&&u().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage-1),className:"btn-default icon icon-before icon-backarrow"},"Back"),u().createElement("button",{id:"btnCancel",type:"button",onClick:this.props.onCancel,className:"btn-default"},"Cancel"),this.props.currentStage<this.props.totalStages&&u().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage+1),className:"btn-default icon icon-after icon-arrow"},"Continue"))}}])&&FD(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);WD.propTypes={currentStage:d().number.isRequired,totalStages:d().number.isRequired,onChange:d().func,onCancel:d().func};const HD=WD;function $D(e){return $D="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},$D(e)}function GD(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,JD(r.key),r)}}function JD(e){var t=function(e,t){if("object"!=$D(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=$D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$D(t)?t:t+""}function QD(e,t,n){return t=XD(t),function(e,t){if(t&&("object"===$D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,YD()?Reflect.construct(t,n||[],XD(e).constructor):t.apply(e,n))}function YD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(YD=function(){return!!e})()}function XD(e){return XD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},XD(e)}function ZD(e,t){return ZD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZD(e,t)}var eN=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),QD(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZD(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.stages.map((function(t,n){var r="";return n+1===e.props.currentStage&&(r="active"),u().createElement("li",{key:n,className:r},t)}));return u().createElement("ol",{className:"steps"},t)}}])&&GD(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);eN.propTypes={stages:d().array.isRequired,currentStage:d().number.isRequired};const tN=eN;function nN(e){return nN="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},nN(e)}function rN(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,oN(r.key),r)}}function oN(e){var t=function(e,t){if("object"!=nN(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=nN(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nN(t)?t:t+""}function iN(e,t,n){return t=sN(t),function(e,t){if(t&&("object"===nN(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,aN()?Reflect.construct(t,n||[],sN(e).constructor):t.apply(e,n))}function aN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(aN=function(){return!!e})()}function sN(e){return sN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sN(e)}function cN(e,t){return cN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cN(e,t)}var lN=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),iN(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cN(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.stages.length;return u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement(tN,{stages:this.props.stages,currentStage:this.props.currentStage})),u().createElement("div",{className:"col-md-6 text-right button-row"},u().createElement(HD,{currentStage:this.props.currentStage,totalStages:e,onChange:this.props.onChange,onCancel:this.props.onCancel})))}}])&&rN(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);lN.propTypes={stages:d().array.isRequired,currentStage:d().number.isRequired,onChange:d().func,onCancel:d().func};const uN=lN;function pN(e){return pN="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},pN(e)}function fN(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,hN(r.key),r)}}function hN(e){var t=function(e,t){if("object"!=pN(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pN(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pN(t)?t:t+""}function dN(e,t,n){return t=mN(t),function(e,t){if(t&&("object"===pN(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yN()?Reflect.construct(t,n||[],mN(e).constructor):t.apply(e,n))}function yN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yN=function(){return!!e})()}function mN(e){return mN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mN(e)}function bN(e,t){return bN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bN(e,t)}var vN=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dN(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bN(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return u().createElement("div",{className:"tfnode placeholder-node"},u().createElement("hr",null),u().createElement("div",null,!0===this.props.showContent?u().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddContent},u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),this.props.title," Content"):null,!0===this.props.showText?u().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddText},u().createElement("strong",null,"A"),u().createElement("br",null),this.props.title," Text"):null))}}])&&fN(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);vN.propTypes={showContent:d().bool,showText:d().bool,onAddContent:d().func,onAddText:d().func},vN.defaultProps={showContent:!0,showText:!0};const gN=vN;var wN=o(1683);function EN(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function SN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EN(n,!0).forEach((function(t){ON(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ON(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _N=function(e,t){if(null==e)return t;for(var n=(f=2,function(e){if(Array.isArray(e))return e}(p=t)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(p,f)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),r=n[0],o=n[1],i=SN({},r),a=function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(o),s=0,c=Object.keys(e);s<c.length;s++){var l=c[s];if(r.hasOwnProperty(l)){var u=r[l];i[l]=SN({},u,{},e[l])}else i[l]=e[l],a.push(l)}var p,f;return[i,a]};var PN={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};const kN=function(e){if(null==e)return e;for(var t={},n=!1,r=0,o=Object.keys(e);r<o.length;r++){var i=o[r],a=i;PN.hasOwnProperty(i)&&(a=PN[i],n=!0),t[a]=e[i]}return n?t:e};var jN=/^(moz|ms|o|webkit)-/,CN=/^\d+$/,TN=/([A-Z])/g,xN={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const DN=function(e){return Object.keys(e).map((function(t){var n=function(e,t){var n;return"string"==typeof t?n=CN.test(t):(n=!0,t=String(t)),n&&"0"!==t&&!0!==xN[e]?t+"px":t}(t,e[t]),r=function(e){return e.replace(TN,"-$1").toLowerCase().replace(jN,"-$1-")}(t);return"".concat(r,": ").concat(n)})).join("; ")};var NN,RN,MN,IN="header-one",AN="header-two",LN="header-three",BN="header-four",FN="header-five",UN="header-six",qN="unordered-list-item",KN="ordered-list-item",VN="blockquote",zN="code-block",WN="atomic",HN="LINK",$N="IMAGE",GN="BOLD",JN="CODE",QN="ITALIC",YN="STRIKETHROUGH",XN="UNDERLINE",ZN=o(3624),eR=new ZN.OrderedSet;function tR(e,t){for(var n=eR,r=eR,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getStyle():eR,a>0&&!(0,ZN.is)(n,r)&&(o.push([e.slice(i,a),r]),i=a)}return o.push([e.slice(i),n]),o}function nR(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function rR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nR(n,!0).forEach((function(t){aR(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function iR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sR=GN,cR=JN,lR=QN,uR=YN,pR=XN,fR="<br>",hR=/^data-([a-z0-9-]+)$/,dR=(aR(NN={},sR,{element:"strong"}),aR(NN,cR,{element:"code"}),aR(NN,lR,{element:"em"}),aR(NN,uR,{element:"del"}),aR(NN,pR,{element:"u"}),NN),yR=[sR,lR,pR,uR,cR],mR=(aR(RN={},HN,{url:"href",href:"href",rel:"rel",target:"target",title:"title",className:"class"}),aR(RN,$N,{src:"src",height:"height",width:"width",alt:"alt",className:"class"}),RN),bR=(aR(MN={},HN,(function(e,t){for(var n=mR.hasOwnProperty(e)?mR[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:hR.test(s)&&(o[s]=c)}return o})),aR(MN,$N,(function(e,t){for(var n=mR.hasOwnProperty(e)?mR[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:hR.test(s)&&(o[s]=c)}return o})),MN);function vR(e,t){switch(e){case IN:return["h1"];case AN:return["h2"];case LN:return["h3"];case BN:return["h4"];case FN:return["h5"];case UN:return["h6"];case qN:case KN:return["li"];case VN:return["blockquote"];case zN:return["pre","code"];case WN:return["figure"];default:return null===t?[]:[t||"p"]}}var gR=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),aR(this,"blocks",void 0),aR(this,"contentState",void 0),aR(this,"currentBlock",void 0),aR(this,"indentLevel",void 0),aR(this,"output",void 0),aR(this,"totalBlocks",void 0),aR(this,"wrapperTag",void 0),aR(this,"options",void 0),aR(this,"inlineStyles",void 0),aR(this,"inlineStyleFn",void 0),aR(this,"styleOrder",void 0),null==n&&(n={}),this.contentState=t,this.options=n;var r=oR(_N(n.inlineStyles,[dR,yR]),2),o=r[0],i=r[1];this.inlineStyles=o,this.inlineStyleFn=n.inlineStyleFn,this.styleOrder=i}var t,n;return t=e,(n=[{key:"generate",value:function(){for(this.output=[],this.blocks=this.contentState.getBlocksAsArray(),this.totalBlocks=this.blocks.length,this.currentBlock=0,this.indentLevel=0,this.wrapperTag=null;this.currentBlock<this.totalBlocks;)this.processBlock();return this.closeWrapperTag(),this.output.join("").trim()}},{key:"processBlock",value:function(){var e=this.options,t=e.blockRenderers,n=e.defaultBlockTag,r=this.blocks[this.currentBlock],o=r.getType(),i=function(e){switch(e){case qN:return"ul";case KN:return"ol";default:return null}}(o);this.wrapperTag!==i&&(this.wrapperTag&&this.closeWrapperTag(),i&&this.openWrapperTag(i)),this.indent();var a=null!=t&&t.hasOwnProperty(o)?t[o]:null,s=a?a(r):null;if(null!=s)return this.output.push(s),this.output.push("\n"),void(this.currentBlock+=1);this.writeStartTag(r,n),this.output.push(this.renderBlockContent(r));var c=this.getNextBlock();if(function(e){switch(e){case qN:case KN:return!0;default:return!1}}(o)&&c&&c.getDepth()===r.getDepth()+1){this.output.push("\n");var l=this.wrapperTag;this.wrapperTag=null,this.indentLevel+=1,this.currentBlock+=1,this.processBlocksAtDepth(c.getDepth()),this.wrapperTag=l,this.indentLevel-=1,this.indent()}else this.currentBlock+=1;this.writeEndTag(r,n)}},{key:"processBlocksAtDepth",value:function(e){for(var t=this.blocks[this.currentBlock];t&&t.getDepth()===e;)this.processBlock(),t=this.blocks[this.currentBlock];this.closeWrapperTag()}},{key:"getNextBlock",value:function(){return this.blocks[this.currentBlock+1]}},{key:"writeStartTag",value:function(e,t){var n,r=vR(e.getType(),t);if(this.options.blockStyleFn){var o=this.options.blockStyleFn(e)||{},i=o.attributes,a=o.style;if(i=kN(i),null!=a){var s=DN(a);i=null==i?{style:s}:rR({},i,{style:s})}n=wR(i)}else n="";var c=!0,l=!1,u=void 0;try{for(var p,f=r[Symbol.iterator]();!(c=(p=f.next()).done);c=!0){var h=p.value;this.output.push("<".concat(h).concat(n,">"))}}catch(e){l=!0,u=e}finally{try{c||null==f.return||f.return()}finally{if(l)throw u}}}},{key:"writeEndTag",value:function(e,t){var n=vR(e.getType(),t);if(1===n.length)this.output.push("</".concat(n[0],">\n"));else{var r=[],o=!0,i=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;r.unshift("</".concat(l,">"))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}this.output.push(r.join("")+"\n")}}},{key:"openWrapperTag",value:function(e){this.wrapperTag=e,this.indent(),this.output.push("<".concat(e,">\n")),this.indentLevel+=1}},{key:"closeWrapperTag",value:function(){var e=this.wrapperTag;e&&(this.indentLevel-=1,this.indent(),this.output.push("</".concat(e,">\n")),this.wrapperTag=null)}},{key:"indent",value:function(){this.output.push("  ".repeat(this.indentLevel))}},{key:"withCustomInlineStyles",value:function(e,t){if(!this.inlineStyleFn)return e;var n=this.inlineStyleFn(t);if(!n)return e;var r=n.element,o=void 0===r?"span":r,i=n.attributes,a=n.style,s=wR(rR({},i,{style:a&&DN(a)}));return"<".concat(o).concat(s,">").concat(e,"</").concat(o,">")}},{key:"renderBlockContent",value:function(e){var t=this,n=e.getType(),r=e.getText();return""===r?fR:function(e,t){for(var n=null,r=null,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getEntity():null,a>0&&n!==r&&(o.push([r,tR(e.slice(i,a),t.slice(i,a))]),i=a)}return o.push([n,tR(e.slice(i),t.slice(i))]),o}(r=this.preserveWhitespace(r),e.getCharacterList()).map((function(e){var r,o=oR(e,2),i=o[0],a=o[1].map((function(e){var r=oR(e,2),o=r[0],i=r[1],a=function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split(" ").join("&nbsp;").split("\n").join(fR+"\n")}(o),s=!0,c=!1,l=void 0;try{for(var u,p=t.styleOrder[Symbol.iterator]();!(s=(u=p.next()).done);s=!0){var f=u.value;if((f!==cR||n!==zN)&&i.has(f)){var h=t.inlineStyles[f],d=h.element,y=h.attributes,m=h.style;if(null==d&&(d="span"),y=kN(y),null!=m){var b=DN(m);y=null==y?{style:b}:rR({},y,{style:b})}var v=wR(y);a="<".concat(d).concat(v,">").concat(a,"</").concat(d,">")}}}catch(e){c=!0,l=e}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}return t.withCustomInlineStyles(a,i)})).join(""),s=i?t.contentState.getEntity(i):null,c=null==s?null:s.getType().toUpperCase();if(null!=s&&t.options.entityStyleFn&&(r=t.options.entityStyleFn(s))){var l=r,u=l.element,p=l.attributes,f=l.style;if(null==u&&(u="span"),p=kN(p),null!=f){var h=DN(f);p=null==p?{style:h}:rR({},p,{style:h})}var d=wR(p);return"<".concat(u).concat(d,">").concat(a,"</").concat(u,">")}if(null!=c&&c===HN){var y=wR(bR.hasOwnProperty(c)?bR[c](c,s):null);return"<a".concat(y,">").concat(a,"</a>")}if(null!=c&&c===$N){var m=wR(bR.hasOwnProperty(c)?bR[c](c,s):null);return"<img".concat(m,"/>")}return a})).join("")}},{key:"preserveWhitespace",value:function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r++)" "!==e[r]||0!==r&&r!==t-1&&" "!==e[r-1]?n[r]=e[r]:n[r]=" ";return n.join("")}}])&&iR(t.prototype,n),e}();function wR(e){if(null==e)return"";for(var t=[],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],i=e[o];null!=i&&t.push(" ".concat(o,'="').concat((i+"").split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;"),'"'))}return t.join("")}function ER(e,t,n){for(var r=e.text,o=e.characterMeta,i=t.length,a=n.length,s=[],c=o.slice(0,0),l=0,u=r.indexOf(t);-1!==u;)s.push(r.slice(l,u)+n),c=c.concat(o.slice(l,u),SR(o.slice(u,u+1),a)),l=u+i,u=r.indexOf(t,l);return s.push(r.slice(l)),c=c.concat(o.slice(l)),{text:s.join(""),characterMeta:c}}function SR(e,t){for(var n=e.slice(0,0);t-- >0;)n=n.concat(e);return n}var OR="unstyled",_R="header-one",PR="header-two",kR="header-three",jR="header-four",CR="header-five",TR="header-six",xR="unordered-list-item",DR="ordered-list-item",NR="blockquote",RR="code-block",MR="atomic",IR="LINK",AR="IMAGE",LR="BOLD",BR="CODE",FR="ITALIC",UR="STRIKETHROUGH",qR="UNDERLINE";new ZN.OrderedSet;var KR={a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,var:1,video:1,wbr:1,acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1},VR={area:1,base:1,br:1,col:1,colgroup:1,command:1,dl:1,embed:1,head:1,hgroup:1,hr:1,iframe:1,img:1,input:1,keygen:1,link:1,meta:1,ol:1,optgroup:1,option:1,param:1,script:1,select:1,source:1,style:1,table:1,tbody:1,textarea:1,tfoot:1,thead:1,title:1,tr:1,track:1,ul:1,wbr:1,basefont:1,dialog:1,dir:1,isindex:1},zR={img:1};function WR(e){return WR="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},WR(e)}function HR(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function $R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function GR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var JR=/^data:/i,QR=(0,ZN.OrderedSet)(),YR=new wN.ContentBlock({key:(0,wN.genKey)(),text:"",type:OR,characterList:(0,ZN.List)(),depth:0}),XR=/(\r\n|\r|\n)/g,ZR="\r",eM=/^data-([a-z0-9-]+)$/,tM={a:{href:"url",rel:"rel",target:"target",title:"title"},img:{src:"src",alt:"alt",width:"width",height:"height"}},nM=function(e,t){var n={};if(tM.hasOwnProperty(e))for(var r=tM[e],o=0;o<t.attributes.length;o++){var i=t.attributes[o],a=i.name,s=i.value;if("string"==typeof s){var c=s;r.hasOwnProperty(a)?n[r[a]]=c:eM.test(a)&&(n[a]=c)}}return n},rM={a:function(e,t,n){var r,o=nM(t,n);if(null!=(r=o.url)&&!r.match(JR))return e.createEntity(IR,o)},img:function(e,t,n){var r=nM(t,n);if(null!=r.src)return e.createEntity(AR,r)}},oM=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),GR(this,"contentStateForEntities",void 0),GR(this,"blockStack",void 0),GR(this,"blockList",void 0),GR(this,"depth",void 0),GR(this,"options",void 0),GR(this,"inlineCreators",{Style:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return{type:"STYLE",style:e}})),Entity:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return{type:"ENTITY",entityKey:t.createEntity(e,iM(n),r)}}}),this.options=n,this.contentStateForEntities=wN.ContentState.createFromBlockArray([]),this.blockStack=[],this.blockList=[],this.depth=0}var t,n;return t=e,n=[{key:"process",value:function(e){this.processBlockElement(e);var t=[];return this.blockList.forEach((function(e){var n=function(e){var t="",n=(0,ZN.Seq)();return e.forEach((function(e){t+=e.text,n=n.concat(e.characterMeta)})),{text:t,characterMeta:n}}(e.textFragments),r=n.text,o=n.characterMeta,i=!1;if(r===ZR&&(i=!0,r=""),"pre"===e.tagName){var a=function(e,t){return"\n"===e.charAt(0)&&(e=e.slice(1),t=t.slice(1)),{text:e,characterMeta:t}}(r,o);r=a.text,o=a.characterMeta}else{var s=function(e,t){var n=function(e,t){for(;" "===e.charAt(0);)e=e.slice(1),t=t.slice(1);return{text:e,characterMeta:t}}(e=e.replace(/[ \t\n]/g," "),t),r=function(e,t){for(;" "===e.slice(-1);)e=e.slice(0,-1),t=t.slice(0,-1);return{text:e,characterMeta:t}}(e=n.text,t=n.characterMeta);e=r.text,t=r.characterMeta;for(var o=e.length;o--;)" "===e.charAt(o)&&" "===e.charAt(o-1)&&(e=e.slice(0,o)+e.slice(o+1),t=t.slice(0,o).concat(t.slice(o+1)));var i=ER({text:e,characterMeta:t},"\r ",ZR),a=ER({text:e=i.text,characterMeta:t=i.characterMeta}," \r",ZR);return{text:e=a.text,characterMeta:t=a.characterMeta}}(r,o);r=s.text,o=s.characterMeta}((r=r.split(ZR).join("\n")).length||i)&&t.push(new wN.ContentBlock({key:(0,wN.genKey)(),text:r,type:e.type,characterList:o.toList(),depth:e.depth,data:e.data?(0,ZN.Map)(e.data):(0,ZN.Map)()}))})),t.length||(t=[YR]),wN.ContentState.createFromBlockArray(t,this.contentStateForEntities.getEntityMap())}},{key:"getBlockTypeFromTagName",value:function(e){var t=this.options.blockTypes;if(t&&t[e])return t[e];switch(e){case"li":return"ol"===this.blockStack.slice(-1)[0].tagName?DR:xR;case"blockquote":return NR;case"h1":return _R;case"h2":return PR;case"h3":return kR;case"h4":return jR;case"h5":return CR;case"h6":return TR;case"pre":return RR;case"figure":return MR;default:return OR}}},{key:"processBlockElement",value:function(e){if(e){var t,n,r=this.options.customBlockFn,o=e.nodeName.toLowerCase();if(r){var i=r(e);null!=i&&(t=i.type,n=i.data)}var a=!0;if(null==t&&(a=!1,t=this.getBlockTypeFromTagName(o)),t===RR){var s=e.getAttribute("data-language");s&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HR(n,!0).forEach((function(t){GR(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{language:s}))}var c=function(e){switch(e){case xR:case DR:return!0;default:return!1}}(t),l=!VR.hasOwnProperty(o);if(!a&&t===OR){var u=this.blockStack.slice(-1)[0];u&&(t=u.type)}var p={tagName:o,textFragments:[],type:t,styleStack:[QR],entityStack:[null],depth:c?this.depth:0,data:n};l&&(this.blockList.push(p),c&&(this.depth+=1)),this.blockStack.push(p),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),this.blockStack.pop(),l&&c&&(this.depth-=1)}}},{key:"processInlineElement",value:function(e){var t=e.nodeName.toLowerCase();if("br"!==t){var n=this.blockStack.slice(-1)[0],r=n.styleStack.slice(-1)[0],o=n.entityStack.slice(-1)[0],i=this.options.customInlineFn,a=i?i(e,this.inlineCreators):null;if(null!=a)switch(a.type){case"STYLE":r=r.add(a.style);break;case"ENTITY":o=a.entityKey}else r=function(e,t,n){switch(t){case"b":case"strong":return e.add(LR);case"i":case"em":return e.add(FR);case"u":case"ins":return e.add(qR);case"code":return e.add(BR);case"s":case"del":return e.add(UR);default:return n&&n[t]?e.add(n[t]):e}}(r,t,this.options.elementStyles),rM.hasOwnProperty(t)&&(o=rM[t](this,t,e)||o);n.styleStack.push(r),n.entityStack.push(o),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),zR.hasOwnProperty(t)&&this.processText(" "),n.entityStack.pop(),n.styleStack.pop()}else this.processText(ZR)}},{key:"processTextNode",value:function(e){var t=e.nodeValue;t=(t=t.replace(XR,"\n")).split("​").join(ZR),this.processText(t)}},{key:"processText",value:function(e){var t=this.blockStack.slice(-1)[0],n=t.styleStack.slice(-1)[0],r=t.entityStack.slice(-1)[0],o=wN.CharacterMetadata.create({style:n,entity:r}),i=(0,ZN.Repeat)(o,e.length);t.textFragments.push({text:e,characterMeta:i})}},{key:"processNode",value:function(e){if(1===e.nodeType){var t=e,n=t.nodeName.toLowerCase();KR.hasOwnProperty(n)?this.processInlineElement(t):this.processBlockElement(t)}else 3===e.nodeType&&this.processTextNode(e)}},{key:"createEntity",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return this.contentStateForEntities=this.contentStateForEntities.createEntity(e,n,t),this.contentStateForEntities.getLastCreatedEntityKey()}}],n&&$R(t.prototype,n),e}();function iM(e){var t={};if(null!==e&&"object"===WR(e)&&!Array.isArray(e))for(var n=e,r=0,o=Object.keys(n);r<o.length;r++){var i=o[r],a=n[i];"string"==typeof a&&(t[i]=a)}return t}function aM(e){var t;return"undefined"!=typeof DOMParser?t=(new DOMParser).parseFromString(e,"text/html"):(t=document.implementation.createHTMLDocument("")).documentElement&&(t.documentElement.innerHTML=e),t.body||t.createElement("body")}var sM={};function cM(e){return cM="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},cM(e)}function lM(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uM(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,fM(r.key),r)}}function pM(e,t,n){return t&&uM(e.prototype,t),n&&uM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fM(e){var t=function(e,t){if("object"!=cM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cM(t)?t:t+""}function hM(e,t,n){return t=yM(t),function(e,t){if(t&&("object"===cM(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dM()?Reflect.construct(t,n||[],yM(e).constructor):t.apply(e,n))}function dM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dM=function(){return!!e})()}function yM(e){return yM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yM(e)}function mM(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bM(e,t)}function bM(e,t){return bM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bM(e,t)}var vM=function(e){function t(e){var n;return lM(this,t),(n=hM(this,t,[e])).state={editorState:n._setHTML(),hasFocus:!1},n.focus=function(){return n._handleFocus()},n.blur=function(){return n._handleBlur()},n.onChange=function(e){return n.setState({editorState:e})},n.handleKeyCommand=function(e){return n._handleKeyCommand(e)},n.toggleBlockType=function(e){return n._toggleBlockType(e)},n.toggleInlineStyle=function(e){return n._toggleInlineStyle(e)},n.getHTML=function(){return n._getHTML()},n}return mM(t,e),pM(t,[{key:"componentDidMount",value:function(){this._handleFocus()}},{key:"_handleFocus",value:function(){this.setState({hasFocus:!0}),this.refs.editor.focus()}},{key:"_handleBlur",value:function(){this.setState({hasFocus:!1})}},{key:"_handleKeyCommand",value:function(e){var t=this.state.editorState,n=wN.RichUtils.handleKeyCommand(t,e);return!!n&&(this.onChange(n),!0)}},{key:"_toggleBlockType",value:function(e){this.onChange(wN.RichUtils.toggleBlockType(this.state.editorState,e))}},{key:"_toggleInlineStyle",value:function(e){this.onChange(wN.RichUtils.toggleInlineStyle(this.state.editorState,e))}},{key:"_setHTML",value:function(){if(this.props.importValue){var e=(t=this.props.importValue,r=(n=sM).parser,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["parser"]),null==r&&(r=aM),function(e,t){return new oM(t).process(e)}(r(t),o));return wN.EditorState.createWithContent(e)}return wN.EditorState.createEmpty();var t,n,r,o}},{key:"_getHTML",value:function(){return e=this.state.editorState.getCurrentContent(),new gR(e,undefined).generate();var e}},{key:"render",value:function(){var e=this.state.editorState;return u().createElement("div",{className:"RichEditor-root"},!0===this.state.hasFocus?u().createElement("div",{className:"text-node-controls",onClick:this.focus},u().createElement(PM,{editorState:e,onToggle:this.toggleInlineStyle}),u().createElement(OM,{editorState:e,onToggle:this.toggleBlockType})):null,u().createElement("div",{className:"RichEditor-editor",onClick:this.focus,onFocus:this.focus,onBlur:this.blur},u().createElement(wN.Editor,{blockStyleFn:wM,customStyleMap:gM,editorState:e,handleKeyCommand:this.handleKeyCommand,onChange:this.onChange,ref:"editor",spellCheck:!0})))}}])}(u().Component),gM={CODE:{backgroundColor:"rgba(0, 0, 0, 0.05)",fontFamily:'"Inconsolata", "Menlo", "Consolas", monospace',fontSize:16,padding:2}};function wM(e){return"blockquote"===e.getType()?"RichEditor-blockquote":null}var EM=function(e){function t(){var e;return lM(this,t),(e=hM(this,t)).onToggle=function(t){t.preventDefault(),e.props.onToggle(e.props.style)},e}return mM(t,e),pM(t,[{key:"render",value:function(){var e="RichEditor-styleButton";return this.props.active&&(e+=" RichEditor-activeButton"),u().createElement("span",{className:e,onMouseDown:this.onToggle},this.props.label)}}])}(u().Component),SM=[{label:"Blockquote",style:"blockquote"}],OM=function(e){var t=e.editorState,n=t.getSelection(),r=t.getCurrentContent().getBlockForKey(n.getStartKey()).getType();return u().createElement("span",{className:"RichEditor-controls"},SM.map((function(t){return u().createElement(EM,{key:t.label,active:t.style===r,label:t.label,onToggle:e.onToggle,style:t.style})})))},_M=[{label:"Bold",style:"BOLD"},{label:"Italic",style:"ITALIC"}],PM=function(e){var t=e.editorState.getCurrentInlineStyle();return u().createElement("span",{className:"RichEditor-controls"},_M.map((function(n){return u().createElement(EM,{key:n.label,active:t.has(n.style),label:n.label,onToggle:e.onToggle,style:n.style})})))};const kM=vM;function jM(e){return jM="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},jM(e)}function CM(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,TM(r.key),r)}}function TM(e){var t=function(e,t){if("object"!=jM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=jM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jM(t)?t:t+""}function xM(e,t,n){return t=NM(t),function(e,t){if(t&&("object"===jM(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,DM()?Reflect.construct(t,n||[],NM(e).constructor):t.apply(e,n))}function DM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(DM=function(){return!!e})()}function NM(e){return NM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},NM(e)}function RM(e,t){return RM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RM(e,t)}var MM=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xM(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RM(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=!0===this.props.showDelete?u().createElement("button",{type:"button",className:"btn",onClick:this.props.onDelete},this.props.deleteButtonLabel," ",u().createElement("i",{className:"glyphicon glyphicon-remove"})):null,t=!0===this.props.showReplace?u().createElement("button",{type:"button",className:"btn",onClick:this.props.onReplace},this.props.replaceButtonLabel," ",u().createElement("i",{className:"glyphicon glyphicon-repeat"})):null;return u().createElement("div",{className:"controls"},e,t,null!=this.props.index&&this.props.index>0?u().createElement("button",{type:"button",className:"btn",title:"Move Up",onClick:this.props.onMoveUp},"Move Up ",u().createElement("i",{className:"glyphicon glyphicon-arrow-up"})):null,null!=this.props.index&&this.props.index<this.props.indexOf-1?u().createElement("button",{type:"button",className:"btn",title:"Move Down",onClick:this.props.onMoveDown},"Move Down ",u().createElement("i",{className:"glyphicon glyphicon-arrow-down"})):null)}}])&&CM(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);MM.propTypes={index:d().number,indexOf:d().number,showDelete:d().bool,showReplace:d().bool,deleteButtonLabel:d().string,replaceButtonLabel:d().string,onDelete:d().func,onReplace:d().func,onMoveUp:d().func,onMoveDown:d().func},MM.defaultProps={index:null,showDelete:!1,showReplace:!1,deleteButtonLabel:"Remove",replaceButtonLabel:"Replace"};const IM=MM;function AM(e){return AM="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},AM(e)}function LM(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,BM(r.key),r)}}function BM(e){var t=function(e,t){if("object"!=AM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=AM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AM(t)?t:t+""}function FM(e,t,n){return t=qM(t),function(e,t){if(t&&("object"===AM(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,UM()?Reflect.construct(t,n||[],qM(e).constructor):t.apply(e,n))}function UM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(UM=function(){return!!e})()}function qM(e){return qM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qM(e)}function KM(e,t){return KM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},KM(e,t)}var VM=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=FM(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getNodes=n.getNodes.bind(n),n.getContent=n.getContent.bind(n),n.hasContent=n.hasContent.bind(n),n.onSave=n.onSave.bind(n),n.tryAddStagingNode=n.tryAddStagingNode.bind(n),n.getStagingIndex=n.getStagingIndex.bind(n),n.onAddText=n.onAddText.bind(n),n.onAddContent=n.onAddContent.bind(n),n.onAcceptContent=n.onAcceptContent.bind(n),n.onDeleteNode=n.onDeleteNode.bind(n),n.onMoveUpNode=n.onMoveUpNode.bind(n),n.onMoveDownNode=n.onMoveDownNode.bind(n),n.updateNodeOrder=n.updateNodeOrder.bind(n),n.deleteContentItem=n.deleteContentItem.bind(n),n.getContentItem=n.getContentItem.bind(n),n._content=n.props.importContent?n.props.importContent:[],n._nodes=n.props.importNodes?n.props.importNodes:[],n.tryAddStagingNode(),n.state={nodes:n._nodes,isValid:n.valid(),showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&KM(e,t)}(t,e),n=t,r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this.onSave(),this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onSave",value:function(){var e=this.getStagingIndex();null!=e&&this._nodes.splice(e,1);for(var t=0;t<this._nodes.length;t++)if("Text"==this._nodes[t].type){var n=this.refs[this._nodes[t].id].getHTML();this._nodes[t].data=n}}},{key:"tryAddStagingNode",value:function(){if(!this.hasContent()){var e={id:vn.generateUID(),type:"Staging",usage:null,data:null,children:null};this._nodes.unshift(e)}}},{key:"getStagingIndex",value:function(){for(var e=0;e<this._nodes.length;e++)if("Staging"==this._nodes[e].type)return e;return null}},{key:"onAddText",value:function(e,t){null!=t&&t.preventDefault();var n={id:vn.generateUID(),type:"Text",usage:"Content",data:"",children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault();var n={id:vn.generateUID(),type:"Staging",usage:null,data:null,children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAcceptContent",value:function(e,t){var n=[],r=this;e.forEach((function(e){r._content.push(e);var t={id:vn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)}));var o=this._nodes.length,i=this.getStagingIndex();null!==i&&(o=i+1);var a=this._nodes;this._nodes=a.slice(0,o).concat(n).concat(a.slice(o)),t&&this._nodes.splice(i,1),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);"Content"==n[0].type&&this.deleteContentItem(n[0].data),this.tryAddStagingNode(),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"deleteContentItem",value:function(e){for(var t=0;t<this._content.length;t++)this._content[t].id==e&&this._content.splice(t,1)}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[],n=null,r=null;return this.state.nodes.forEach((function(e,o){switch(n=o,"Staging"==e.type||null!=r&&"Staging"==r.type||t.push(u().createElement(gN,{key:vn.generateUID(),title:"Insert",onAddText:this.onAddText.bind(null,o),onAddContent:this.onAddContent.bind(null,o)})),e.type){case"Staging":t.push(u().createElement("div",{className:"tfnode",key:e.id},this.hasContent()?u().createElement(IM,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Cancel Content Upload",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}):null,u().createElement(ym,{groupsAllowed:["Portfolio"],onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))));break;case"Text":t.push(u().createElement("div",{className:"tfnode text-node",key:e.id},u().createElement(IM,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Text",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),u().createElement(kM,{ref:e.id,importValue:e.data})));break;case"Content":var i=this.getContentItem(e.data);t.push(u().createElement("div",{className:"tfnode content-node",key:e.id},u().createElement(IM,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),u().createElement(lv,{ref:e.id,key:e.id,content:i})))}r=e}),this),null!=n&&"Staging"!=this.state.nodes[n].type&&t.push(u().createElement(gN,{key:vn.generateUID(),title:"Add",onAddText:this.onAddText.bind(null,null),onAddContent:this.onAddContent.bind(null,null)})),u().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:u().createElement(sa,{message:"At least one content item (image/video) is required"}))}}],r&&LM(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);VM.propTypes={fileSizeLimit:d().number,importContent:d().array,importNodes:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},VM.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const zM=VM;function WM(e){return WM="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},WM(e)}function HM(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,$M(r.key),r)}}function $M(e){var t=function(e,t){if("object"!=WM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=WM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==WM(t)?t:t+""}function GM(e,t,n){return t=QM(t),function(e,t){if(t&&("object"===WM(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JM()?Reflect.construct(t,n||[],QM(e).constructor):t.apply(e,n))}function JM(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(JM=function(){return!!e})()}function QM(e){return QM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},QM(e)}function YM(e,t){return YM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},YM(e,t)}var XM=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=GM(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getNodes=n.getNodes.bind(n),n.getContent=n.getContent.bind(n),n.hasContent=n.hasContent.bind(n),n.onStagingCancel=n.onStagingCancel.bind(n),n.onAddContent=n.onAddContent.bind(n),n.onAcceptContent=n.onAcceptContent.bind(n),n.getContentItem=n.getContentItem.bind(n),n._content=n.props.importContent?n.props.importContent:[],n._nodes=n.props.importNodes?n.props.importNodes:[],n.state={nodes:n._nodes,showStaging:!n.hasContent(),isValid:n.valid(),showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YM(e,t)}(t,e),n=t,(r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onStagingCancel",value:function(){this.setState({showStaging:!1})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault(),this.setState({showStaging:!0})}},{key:"onAcceptContent",value:function(e,t){var n=[];e.forEach((function(e){var t={id:vn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)})),this._content=e,this._nodes=n,this.setState({nodes:this._nodes,isValid:this.valid(),showStaging:!1})}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[];if(this.state.showStaging)t.push(u().createElement("div",{className:"tfnode",key:0},this.hasContent()?u().createElement(IM,{showReplace:!0,onReplace:this.onStagingCancel,replaceButtonLabel:"Cancel Replace"}):null,u().createElement(ym,{groupsAllowed:["Training"],allowMultipleFiles:!1,onAccept:this.onAcceptContent,autoAcceptContent:!0,closeAfterAutoAcceptContent:!0},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop a video or click in this area to upload"))));else{var n=this.getContentItem(this.state.nodes[0].data);t.push(u().createElement("div",{className:"tfnode content-node",key:1},u().createElement(IM,{showReplace:!0,onReplace:this.onAddContent.bind(null,null,null),replaceButtonLabel:"Replace Video"}),u().createElement(lv,{content:n})))}return u().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:u().createElement(sa,{message:"At least one content item (image/video) is required"}))}}])&&HM(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);XM.propTypes={fileSizeLimit:d().number,importContent:d().array,importNodes:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},XM.defaultProps={required:!1,requiredErrorMessage:"At least on content item is required."};const ZM=XM;function eI(e){return eI="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},eI(e)}function tI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oI(r.key),r)}}function rI(e,t,n){return t&&nI(e.prototype,t),n&&nI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oI(e){var t=function(e,t){if("object"!=eI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eI(t)?t:t+""}function iI(e,t,n){return t=sI(t),function(e,t){if(t&&("object"===eI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,aI()?Reflect.construct(t,n||[],sI(e).constructor):t.apply(e,n))}function aI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(aI=function(){return!!e})()}function sI(e){return sI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sI(e)}function cI(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lI(e,t)}function lI(e,t){return lI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lI(e,t)}var uI=function(e){function t(e){var n;tI(this,t),(n=iI(this,t,[e])).getThumbnailData=n.getThumbnailData.bind(n),n.getContentIndex=n.getContentIndex.bind(n),n.updateContent=n.updateContent.bind(n),n.onSelectThumbnail=n.onSelectThumbnail.bind(n),n.onAcceptCrop=n.onAcceptCrop.bind(n),n.onShowCrop=n.onShowCrop.bind(n),n.onCancelCrop=n.onCancelCrop.bind(n);var r=null;return null!=n.props.content&&(r=null!=n.props.contentThumbnail?n.getContentIndex(n.props.content,n.props.contentThumbnail.id):0),n.state={content:null!=n.props.content?n.props.content:[],selectedContentIndex:r,showImageCropModal:!1,crop:null!=n.props.contentThumbnail?n.props.contentThumbnail.crop:null},n}return cI(t,e),rI(t,[{key:"getThumbnailData",value:function(){return null==this.state.selectedContentIndex?null:{id:this.state.content[this.state.selectedContentIndex].id,crop:this.state.crop}}},{key:"getContentIndex",value:function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null}},{key:"updateContent",value:function(e){var t=null,n=null;e.length>0&&null!=this.state.content&&this.state.content.length>0&&(null!=this.state.selectedContentIndex&&(t=this.state.content[this.state.selectedContentIndex].id),null!=t&&(n=this.getContentIndex(e,t))),null==n&&e.length>0&&(n=0),this.setState({content:e,selectedContentIndex:n})}},{key:"onSelectThumbnail",value:function(e,t){this.setState({selectedContentIndex:t,crop:null})}},{key:"onAcceptCrop",value:function(e){this.setState({crop:e,showImageCropModal:!1})}},{key:"onShowCrop",value:function(){this.setState({showImageCropModal:!0})}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){!0!==this.state.showValidation||this.state.isValid,this.props.required;var e=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(e=u().createElement(HelpBlock,{message:this.props.helpMessage})):e=u().createElement(HelpBlock,{message:this.props.requiredErrorMessage});var t=null!=this.state.content&&this.state.content.length>0&&null!=this.state.selectedContentIndex?this.state.content[this.state.selectedContentIndex].id:null;return u().createElement("div",{className:"form-group thumbnail-editor clearfix"},u().createElement("label",{className:"static"},this.props.label),u().createElement("div",null,u().createElement(fI,{size:this.props.size,id:t,crop:this.state.crop}),u().createElement("div",{className:"controls",style:{marginLeft:this.props.size.width+10}},u().createElement("ul",{className:"list-unstyled"},this.state.content.length>1&&u().createElement("li",null,u().createElement(pI,{content:this.state.content,onSelectThumbnail:this.onSelectThumbnail})),u().createElement("li",null,u().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowCrop},"Edit Thumbnail")))),e),this.state.showImageCropModal&&u().createElement(L,null,u().createElement(Iv,{src:this.state.content[this.state.selectedContentIndex].coverUrl,size:this.props.size,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}])}(u().Component);uI.propTypes={size:d().object.isRequired,content:d().array,contentThumbnail:d().object,label:d().string.isRequired,helpMessage:d().string};var pI=function(e){function t(){return tI(this,t),iI(this,t,arguments)}return cI(t,e),rI(t,[{key:"render",value:function(){var e=[],t=this;return this.props.content.forEach((function(n,r){e.push(u().createElement("div",{key:n.id,onClick:t.props.onSelectThumbnail.bind(null,n.id,r)},u().createElement("img",{style:{width:"200px",height:"auto"},src:n.thumbUrl})))})),u().createElement(ko,{wrapperTag:"div",actionTag:"button",actionLabel:"Select Cover Image",options:e,dropdownClassName:"thumbnails"})}}])}(u().Component);pI.propTypes={content:d().array.isRequired,onSelectThumbnail:d().func.isRequired};var fI=function(e){function t(){return tI(this,t),iI(this,t,arguments)}return cI(t,e),rI(t,[{key:"render",value:function(){var e={width:this.props.size.width,height:this.props.size.height},t="/project/cover?id="+this.props.id;return null!=this.props.crop&&(t+="&x="+this.props.crop.x+"&y="+this.props.crop.y+"&w="+this.props.crop.width+"&h="+this.props.crop.height),u().createElement("div",{className:"thumb",style:e},null!=this.props.id?u().createElement("img",{src:t}):null)}}])}(u().Component);fI.propTypes={size:d().object.isRequired,id:d().number,crop:d().object};const hI=uI;function dI(e){return dI="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},dI(e)}function yI(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,mI(r.key),r)}}function mI(e){var t=function(e,t){if("object"!=dI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=dI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dI(t)?t:t+""}function bI(e,t,n){return t=gI(t),function(e,t){if(t&&("object"===dI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,vI()?Reflect.construct(t,n||[],gI(e).constructor):t.apply(e,n))}function vI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(vI=function(){return!!e})()}function gI(e){return gI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gI(e)}function wI(e,t){return wI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wI(e,t)}var EI=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=bI(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.setValue=n.setValue.bind(n),n.onChange=n.onChange.bind(n),n.handleFocus=n.handleFocus.bind(n),n.handleBlur=n.handleBlur.bind(n),n.state={value:null!=n.props.value?n.props.value:"",validate:!1,isValid:!0,showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wI(e,t)}(t,e),n=t,(r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=u().createElement(sa,{message:this.props.helpMessage}):e+=" no-help":t=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:e},u().createElement("label",{className:"dynamic for-textarea",htmlFor:this.props.name},this.props.label),u().createElement("textarea",{name:this.props.name,rows:this.props.rows,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&yI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);EI.propTypes={name:d().string,rows:d().number,label:d().string,placeholder:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string,onChange:d().func},EI.defaultProps={rows:7,required:!1,requiredErrorMessage:"input required."};const SI=EI;function OI(e){return OI="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},OI(e)}function _I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PI(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,jI(r.key),r)}}function kI(e,t,n){return t&&PI(e.prototype,t),n&&PI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jI(e){var t=function(e,t){if("object"!=OI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=OI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==OI(t)?t:t+""}function CI(e,t,n){return t=xI(t),function(e,t){if(t&&("object"===OI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,TI()?Reflect.construct(t,n||[],xI(e).constructor):t.apply(e,n))}function TI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(TI=function(){return!!e})()}function xI(e){return xI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xI(e)}function DI(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NI(e,t)}function NI(e,t){return NI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NI(e,t)}var RI=function(e){function t(e){var n;return _I(this,t),(n=CI(this,t,[e])).changeStage=n.changeStage.bind(n),n.processLastStage=n.processLastStage.bind(n),n.editCancel=n.editCancel.bind(n),n.onContentDelete=n.onContentDelete.bind(n),n.onPublishToProfileChange=n.onPublishToProfileChange.bind(n),n.onPublishToForumChange=n.onPublishToForumChange.bind(n),n.onPublishAsHeroChange=n.onPublishAsHeroChange.bind(n),n.onSubmit=n.onSubmit.bind(n),n.stages=["Upload Content","Add Info","Publish"],n.form=n.props.form,n.state={currentStage:1},n}return DI(t,e),kI(t,[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.deliverablesContentData=this.refs.contentEditor.getContent(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==wv(this.form.deliverablesContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=this.refs.contentEditor.validate();break;case 2:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),t=this.refs.title.validate()&&this.refs.description.validate()&&this.refs.product.validate()&&this.refs.category.validate();break;case 3:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){if(this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue(),"Portfolio"==this.props.projectType){var e=this.refs.publishToForum.getValue();if(this.form.publishedToForumFL=e.checked,this.form.publishedToForumID=e.forumID,!this.refs.publishToForum.validate())return!1}return"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(this.form.publishAsHeroFL=this.refs.publishAsHero.getValue()),!0}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onPublishToForumChange",value:function(e){}},{key:"onPublishAsHeroChange",value:function(e){}},{key:"onSubmit",value:function(){var e=!0;if(3==this.state.currentStage&&(e=this.processLastStage()),"Portfolio"==this.props.projectType&&!e)return!1;var t={deliverablesContentNodes:this.form.deliverablesContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,productData:this.form.productData,categoryData:this.form.categoryData,tagData:this.form.tagData,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()};"Portfolio"==this.props.projectType&&(t.publishedToForumFL=this.form.publishedToForumFL,t.publishedToForumID=this.form.publishedToForumID),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(t.publishAsHeroFL=this.form.publishAsHeroFL);var n=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit/"),data:t}).done((function(e,t,r){alerts.success("Project Saved"),window.location.replace(n.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:switch(this.props.projectType){case"Portfolio":e=u().createElement(zM,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0});break;case"Training":e=u().createElement(ZM,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0})}break;case 2:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Bw,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(hI,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.deliverablesContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),u().createElement("div",{className:"col-md-6"},u().createElement(wa,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),u().createElement("div",{className:"col-md-12"},u().createElement(vj,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData})));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",null,u().createElement("legend",null,"Project Status"),u().createElement(nE,{ref:"status",name:"status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue}))),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($w,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))),"Portfolio"==this.props.projectType&&u().createElement(MI,{ref:"publishToForum",checked:this.form.publishedToForumFL,forumID:this.form.publishedToForumID,options:this.form.publishedToForumOptions,forumPath:this.form.publishedToForumPath,topicUrl:this.form.publishedToForumTopicUrl}),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&1==this.form.viewer.isHero&&u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Foundry Heroes"),u().createElement($w,{ref:"publishAsHero",name:"publishAsHero",label:"Allow Publish As Hero Project",value:this.form.publishAsHeroFL,onChange:this.onPublishAsHeroChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(uN,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])}(u().Component);RI.propTypes={form:d().object.isRequired,projectType:d().string.isRequired};var MI=function(e){function t(e){var n;return _I(this,t),(n=CI(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getValue=n.getValue.bind(n),n.onCheckboxChange=n.onCheckboxChange.bind(n),n.onForumChange=n.onForumChange.bind(n),n.checked=n.props.checked,n.forumID=n.props.forumID,n.state={disabled:!n.props.checked,isValid:!0,showValidation:!1},n}return DI(t,e),kI(t,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){if(!1===this.checked||null!=this.props.forumPath)return!0;var e=!1;return!0===this.checked&&(e=this.refs.forumSelect.validate()),!0===this.checked&&e&&null!=this.forumID}},{key:"getValue",value:function(){return{checked:this.checked,forumID:this.forumID}}},{key:"onCheckboxChange",value:function(e){this.checked=e,this.setState({disabled:!e})}},{key:"onForumChange",value:function(e){this.forumID=e}},{key:"render",value:function(){var e;return e=null!=this.props.forumPath?u().createElement("div",{className:"project-publish-forum"},u().createElement("p",null,"Forum: ",u().createElement("a",{href:this.props.forumPath.url},this.props.forumPath.name)),u().createElement("p",null,"Topic: ",u().createElement("a",{href:this.props.topicUrl},"Link"))):u().createElement(_d,{ref:"forumSelect",value:this.props.forumID,options:this.props.options,required:!0,requiredErrorMessage:"Forum selection required to publish to forum",disabled:this.state.disabled,onChange:this.onForumChange}),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($w,{ref:"checkbox",name:"publishToForum",label:"Publish To Forum",value:this.props.checked,onChange:this.onCheckboxChange})),u().createElement("div",{className:"col-md-6"},e))}}])}(u().Component);const II=RI;function AI(e){return AI="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},AI(e)}function LI(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,BI(r.key),r)}}function BI(e){var t=function(e,t){if("object"!=AI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=AI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==AI(t)?t:t+""}function FI(e,t,n){return t=qI(t),function(e,t){if(t&&("object"===AI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,UI()?Reflect.construct(t,n||[],qI(e).constructor):t.apply(e,n))}function UI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(UI=function(){return!!e})()}function qI(e){return qI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qI(e)}function KI(e,t){return KI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},KI(e,t)}var VI=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=FI(this,t,[e])).setup=n.setup.bind(n),n.openInput=n.openInput.bind(n),n.inputChange=n.inputChange.bind(n),n.onEditThumbnail=n.onEditThumbnail.bind(n),n.onAcceptCrop=n.onAcceptCrop.bind(n),n.onCancelCrop=n.onCancelCrop.bind(n),n.imageCropSize=null,n.thumbCropData=null,n.state={src:n.props.src,showImageCropModal:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&KI(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"openInput",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"inputChange",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/replace"),contentType:!1,data:n,processData:!1}).done((function(e,t,n){r.setState({src:e.thumbUrl},(function(){this.props.onChange&&this.props.onChange(e)}))})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"onEditThumbnail",value:function(){this.setState({showImageCropModal:!0})}},{key:"onAcceptCrop",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,n,r){var o=Utils.clone(this.props.content);o.thumbUrl=e,t.setState({showImageCropModal:!1,src:e},(function(){this.props.onChange&&this.props.onChange(o)}))})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.setState({showImageCropModal:!1})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){var e=this,t={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.inputChange},n=[];return n.push(u().createElement("button",{key:0,onClick:this.openInput},"Replace Content Cover")),n.push(u().createElement("button",{key:1,onClick:this.onEditThumbnail.bind(null,this.props.id)},"Edit Thumbnail")),u().createElement("div",{className:"cover-editor"},u().createElement("img",{className:"no-drag",src:this.state.src}),u().createElement("div",{className:"edit"},n),u().createElement("input",t),this.state.showImageCropModal&&u().createElement(L,null,u().createElement(Iv,{src:this.props.content.coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}])&&LI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);VI.propTypes={content:d().object,id:d().number,src:d().string,onChange:d().func};const zI=VI;function WI(e){return WI="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},WI(e)}function HI(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,$I(r.key),r)}}function $I(e){var t=function(e,t){if("object"!=WI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=WI(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==WI(t)?t:t+""}function GI(e,t,n){return t=QI(t),function(e,t){if(t&&("object"===WI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JI()?Reflect.construct(t,n||[],QI(e).constructor):t.apply(e,n))}function JI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(JI=function(){return!!e})()}function QI(e){return QI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},QI(e)}function YI(e,t){return YI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},YI(e,t)}var XI=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=GI(this,t,[e])).validate=n.validate.bind(n),n.getContentForm=n.getContentForm.bind(n),n.getTags=n.getTags.bind(n),n.getProducts=n.getProducts.bind(n),n.onContentChange=n.onContentChange.bind(n),n.state={content:n.props.content,contentForm:null!=n.props.contentForm?n.props.contentForm:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YI(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){if(null==this.state.contentForm){var e=this;$.ajax({type:"GET",url:"/staging/asset",data:{itemID:this.state.content.id},context:this}).done((function(t){var n=t;null!=n.categoryData&&0!=n.categoryData.length||null!=n.productData&&0!=n.productData.length||null!=n.tagData&&0!=n.tagData.length||null==n.defaultProductData||!(n.defaultProductData.length>0)||(n.productData=n.defaultProductData),e.setState({contentForm:n})}))}}},{key:"validate",value:function(){var e=this.refs.category.validate(),t=this.refs.product.validate();return e&&t}},{key:"getContentForm",value:function(){return this.state.contentForm}},{key:"getTags",value:function(){return this.refs.tags.getTags()}},{key:"getProducts",value:function(){return this.refs.product.getSelectedOptions()}},{key:"onContentChange",value:function(e){var t=this;this.setState({content:e},(function(){t.props.onContentChange&&t.props.onContentChange(e)}))}},{key:"render",value:function(){return u().createElement("div",{className:"tfnode asset-node"},u().createElement("div",{style:{textAlign:"right"}},this.props.children),u().createElement("div",{className:"details"},u().createElement("h4",null,u().createElement("span",{className:"content-type"},this.state.content.type)," ",this.state.content.title)),u().createElement("div",{className:"editors"},u().createElement(zI,{content:this.state.content,id:this.state.content.id,src:this.state.content.thumbUrl,onChange:this.onContentChange}),u().createElement("div",{className:"data-editors"},null!=this.state.contentForm&&u().createElement(wa,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.state.contentForm.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.contentForm.productData}),null!=this.state.contentForm&&u().createElement(wa,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.state.contentForm.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.contentForm.categoryData}),null!=this.state.contentForm&&u().createElement(vj,{ref:"tags",label:"Content Tags",placeholder:"Add Tag...",tags:this.state.contentForm.tagData}))))}}])&&HI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);XI.propTypes={content:d().object.isRequired,contentForm:d().object,onContentChange:d().func};const ZI=XI;function eA(e){return eA="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},eA(e)}function tA(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,nA(r.key),r)}}function nA(e){var t=function(e,t){if("object"!=eA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eA(t)?t:t+""}function rA(e,t,n){return t=iA(t),function(e,t){if(t&&("object"===eA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oA()?Reflect.construct(t,n||[],iA(e).constructor):t.apply(e,n))}function oA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oA=function(){return!!e})()}function iA(e){return iA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iA(e)}function aA(e,t){return aA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aA(e,t)}var sA=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=rA(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getNodes=n.getNodes.bind(n),n.getContent=n.getContent.bind(n),n.getContentForms=n.getContentForms.bind(n),n.getExtraInfo=n.getExtraInfo.bind(n),n.hasContent=n.hasContent.bind(n),n.onAcceptContent=n.onAcceptContent.bind(n),n.onDeleteNode=n.onDeleteNode.bind(n),n.onMoveUpNode=n.onMoveUpNode.bind(n),n.onMoveDownNode=n.onMoveDownNode.bind(n),n.updateNodeOrder=n.updateNodeOrder.bind(n),n.getContentForm=n.getContentForm.bind(n),n.onContentChange=n.onContentChange.bind(n),n._content=n.props.contentData?n.props.contentData:[],n._contentForms=n.props.contentForms?n.props.contentForms:[],n._nodes=n.props.contentNodes?n.props.contentNodes:[],n.state={nodes:n._nodes,isValid:n.valid(),showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aA(e,t)}(t,e),n=t,r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){var e=this,t=!0;return Object.keys(this.refs).forEach((function(n){var r=e.refs[n].validate();t=t&&r})),!1===this.props.required||!0===this.props.required&&this.hasContent()&&t}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"getContentForms",value:function(){var e=this,t=[];return Object.keys(this.refs).forEach((function(n){t.push(e.refs[n].getContentForm())})),t}},{key:"getExtraInfo",value:function(){var e=this,t=[],n=[];return Object.keys(this.refs).forEach((function(r){t=t.concat(e.refs[r].getTags()),n=n.concat(e.refs[r].getProducts())})),{tags:vn.arrayUnique(t),products:vn.arrayUnique(n)}}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onAcceptContent",value:function(e,t){var n=this;e.forEach((function(e){n._content.push(e);var t={id:vn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n._nodes.push(t)})),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);if("Content"==n[0].type){var r=n[0].data;Ev(this._content,r),this.props.onDelete&&this.props.onDelete(r)}this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"getContentForm",value:function(e){for(var t=0;t<this._contentForms.length;t++)if(this._contentForms[t].id==e)return this._contentForms[t];return null}},{key:"onContentChange",value:function(e){var t=wv(this._content,e.id);null!=t&&(this._content[t]=e)}},{key:"render",value:function(){var e="tfnode-editor";!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid||(e+=" has-error");var t=[];return this.state.nodes.forEach((function(e,n){if("Content"===e.type){var r=gv(this._content,e.data),o=this.getContentForm(e.data);t.push(u().createElement(ZI,{ref:e.id,key:"c:"+e.id,content:r,contentForm:o,onContentChange:this.onContentChange},u().createElement(IM,{index:n,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,n),onMoveUp:this.onMoveUpNode.bind(null,n),onMoveDown:this.onMoveDownNode.bind(null,n)})))}t.push(u().createElement("div",{key:"p:"+n,className:"tfnode placeholder-node",style:{marginBottom:"20px"}},u().createElement("hr",null)))}),this),u().createElement("div",{className:e},t,u().createElement(ym,{groupsAllowed:["Asset"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid?null:u().createElement(sa,{message:"At least one content item (image/video) is required"}))}}],r&&tA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);sA.propTypes={fileSizeLimit:d().number,contentNodes:d().array,contentData:d().array,contentForms:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func,onDelete:d().func},sA.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const cA=sA;function lA(e){return lA="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},lA(e)}function uA(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,pA(r.key),r)}}function pA(e){var t=function(e,t){if("object"!=lA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lA(t)?t:t+""}function fA(e,t,n){return t=dA(t),function(e,t){if(t&&("object"===lA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hA()?Reflect.construct(t,n||[],dA(e).constructor):t.apply(e,n))}function hA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(hA=function(){return!!e})()}function dA(e){return dA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dA(e)}function yA(e,t){return yA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yA(e,t)}var mA=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=fA(this,t,[e])).changeStage=n.changeStage.bind(n),n.processLastStage=n.processLastStage.bind(n),n.updateSupportContent=n.updateSupportContent.bind(n),n.editCancel=n.editCancel.bind(n),n.onContentDelete=n.onContentDelete.bind(n),n.onPublishToProfileChange=n.onPublishToProfileChange.bind(n),n.onSubmit=n.onSubmit.bind(n),n.stages=["Upload Asset","Upload Example Gallery","Add Info","Publish"],n.form=n.props.form,n.projectTagsAndProducts=null,n.state={currentStage:1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yA(e,t)}(t,e),n=t,(r=[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.contentForms=this.refs.contentEditor.getContentForms();var r=this.refs.contentEditor.getContent();this.form.supportContentData=this.updateSupportContent(r),this.projectTagsAndProducts=this.refs.contentEditor.getExtraInfo(),(null==this.form.title||""==this.form.title)&&null!=r&&r.length>0&&(this.form.title=r[0].title),t=this.refs.contentEditor.validate();break;case 2:this.form.supportContentData=this.refs.supportContentEditor.getContent().content,this.form.supportContentNodes=this.refs.supportContentEditor.getNodes(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==wv(this.form.supportContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=!0;break;case 3:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),t=this.refs.title.validate()&&this.refs.description.validate();break;case 4:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue()}},{key:"updateSupportContent",value:function(e){for(var t=this.form.supportContentData,n=[],r=0;r<e.length;r++){for(var o=!1,i=0;i<t.length;i++)t[i].id==e[r].id&&(t[i]=e[r],t[i].isStatic=!0,o=!0);o||(e[r].isStatic=!0,n.push(e[r]))}return n.length>0&&(t=t.concat(n)),t}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){Ev(this.form.supportContentData,e)}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onSubmit",value:function(){4==this.state.currentStage&&this.processLastStage();var e={deliverablesContentNodes:this.form.deliverablesContentNodes,contentForms:this.form.contentForms.map((function(e){return Sv(e)})),supportContentNodes:this.form.supportContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,commentsStatus:this.form.commentsStatusOptions.selectedValue,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()},t=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit-asset"),data:e}).done((function(e,n,r){alerts.success("Project Saved"),window.location.replace(t.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:e=u().createElement(cA,{ref:"contentEditor",contentNodes:this.form.deliverablesContentNodes,contentData:this.form.deliverablesContentData,contentForms:this.form.contentForms,onDelete:this.onContentDelete,required:!0});break;case 2:e=u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Example Gallery"),u().createElement("p",null,"Add images and video examples to show off the shared asset.  Drag thumbnails to change the order."),u().createElement(Lg,{ref:"supportContentEditor",content:this.form.supportContentData}));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Bw,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(hI,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.supportContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-12 project-info"},u().createElement(Ok,{list:this.projectTagsAndProducts.tags,label:"Project Tags"}),u().createElement(Ok,{list:this.projectTagsAndProducts.products.map((function(e){return e.text})),label:"Project Products"})));break;case 4:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(nE,{ref:"status",name:"status",label:"Project Status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue})),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($w,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,"Share Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(uN,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])&&uA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);mA.propTypes={form:d().object.isRequired};const bA=mA;function vA(e){return vA="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},vA(e)}function gA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wA(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,SA(r.key),r)}}function EA(e,t,n){return t&&wA(e.prototype,t),n&&wA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SA(e){var t=function(e,t){if("object"!=vA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=vA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vA(t)?t:t+""}function OA(e,t,n){return t=PA(t),function(e,t){if(t&&("object"===vA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_A()?Reflect.construct(t,n||[],PA(e).constructor):t.apply(e,n))}function _A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_A=function(){return!!e})()}function PA(e){return PA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},PA(e)}function kA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jA(e,t)}function jA(e,t){return jA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jA(e,t)}var CA=function(e){function t(e){var n;return gA(this,t),(n=OA(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getSelectedOptions=n.getSelectedOptions.bind(n),n.handleProductChange=n.handleProductChange.bind(n),n.handleChange=n.handleChange.bind(n),n.getRelease=n.getRelease.bind(n),n.getSelectedReleaseIndex=n.getSelectedReleaseIndex.bind(n),n.onDelete=n.onDelete.bind(n),n.onUpdateOrder=n.onUpdateOrder.bind(n),n.onBiasUpdate=n.onBiasUpdate.bind(n),n.handleGroupFocus=n.handleGroupFocus.bind(n),n.handleGroupBlur=n.handleGroupBlur.bind(n),n.releasePlaceholderValue=null!=n.props.releasePlaceholderOption?n.props.releasePlaceholderOption.value:null,n.state={visibleReleases:n.props.releases.filter((function(e){return e.productID==n.props.productOptions[0].value})),selectedReleases:n.props.selectedReleases?n.props.selectedReleases:[],validate:!1,isValid:!0===n.props.required&&null!=n.props.selectedReleases&&n.props.selectedReleases.length>0,showValidation:!1,hasFocus:!1},n}return kA(t,e),EA(t,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){null!=e.selectedReleases&&e.selectedReleases!==this.state.selectedReleases&&this.setState({selectedReleases:e.selectedReleases?e.selectedReleases:[]})}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.selectedReleases&&this.state.selectedReleases.length>0}},{key:"getSelectedOptions",value:function(){return this.state.selectedReleases}},{key:"handleProductChange",value:function(){var e=this;this.setState({visibleReleases:this.props.releases.filter((function(t){return t.productID==e.refs.product.value}))})}},{key:"handleChange",value:function(){var e=this.refs.select.value,t=this.getRelease(e);if(e!=this.releasePlaceholderValue&&null==this.getSelectedReleaseIndex(e)){var n=this.state.selectedReleases;n.push(t),this.setState({selectedReleases:n,isValid:this.valid()}),this.releasePlaceholderValue&&(this.refs.select.value,this.releasePlaceholderValue)}}},{key:"getRelease",value:function(e){for(var t=0;t<this.props.releases.length;t++)if(this.props.releases[t].id==e)return this.props.releases[t];return null}},{key:"getSelectedReleaseIndex",value:function(e){for(var t=0;t<this.state.selectedReleases.length;t++)if(this.state.selectedReleases[t].id==e)return t;return null}},{key:"onDelete",value:function(e){var t=this.state.selectedReleases;t.splice(e,1),this.setState({selectedReleases:t,isValid:this.valid()})}},{key:"onUpdateOrder",value:function(e,t){var n=this.state.selectedReleases;n.splice(t,0,n.splice(e,1)[0]),this.setState({selectedReleases:n})}},{key:"onBiasUpdate",value:function(e,t){var n=this.state.selectedReleases;n[e].bias=t,this.setState({selectedReleases:n})}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.state.visibleReleases.map((function(t,n){var r=!1;return null!==e.getSelectedReleaseIndex(t.id)&&(r=!0),u().createElement("option",{key:t.id,value:t.id,disabled:r},t.versionName," ",t.releaseName)})),n="form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(n+=" has-focus"):n+=" has-error";var r="static";!0===this.props.required&&(r+=" required");var o=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(o=u().createElement(sa,{message:this.props.helpMessage})):o=u().createElement(sa,{message:this.props.requiredErrorMessage}),u().createElement("div",{className:n,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&u().createElement("label",{className:r},this.props.label),u().createElement("div",{className:"multiselect-editor product-release"},u().createElement("select",{ref:"product",onChange:this.handleProductChange},null!=this.props.productPlaceholderOption&&u().createElement("option",{key:this.props.productPlaceholderOption.value,value:this.props.productPlaceholderOption.value,disabled:!1},this.props.productPlaceholderOption.text),this.props.productOptions.map((function(e,t){return u().createElement("option",{key:e.value,value:e.value},e.text)}))),u().createElement("select",{ref:"select",value:this.releasePlaceholderValue,onChange:this.handleChange},null!=this.props.releasePlaceholderOption&&u().createElement("option",{key:this.props.releasePlaceholderOption.value,value:this.props.releasePlaceholderOption.value,disabled:!1},this.props.releasePlaceholderOption.text),t),u().createElement(TA,{data:this.state.selectedReleases,onBiasUpdate:this.onBiasUpdate,onUpdateOrder:this.onUpdateOrder,onDelete:this.onDelete})),o)}}])}(u().Component);CA.propTypes={productOptions:d().array.isRequired,productPlaceholderOption:d().object,releasePlaceholderOption:d().object,releases:d().array.isRequired,selectedReleases:d().array,label:d().string,helpMessage:d().string,required:d().bool,requiredErrorMessage:d().string},CA.defaultProps={productPlaceholderOption:{text:"Select product *",value:""},releasePlaceholderOption:{text:"Select software release *",value:""},required:!1,requiredErrorMessage:"At least one item is required"};var TA=function(e){function t(e){var n;return gA(this,t),(n=OA(this,t,[e])).dragStart=n.dragStart.bind(n),n.dragOver=n.dragOver.bind(n),n.dragEnter=n.dragEnter.bind(n),n.dragEnd=n.dragEnd.bind(n),n.onBiasUpdate=n.onBiasUpdate.bind(n),n.placeholder=document.createElement("li"),n.placeholder.className="placeholder",n.dragged=null,n}return kA(t,e),EA(t,[{key:"dragStart",value:function(e){this.dragged=e.currentTarget,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("Text",e.currentTarget.id)}},{key:"dragOver",value:function(e){if(e.preventDefault(),this.dragged.style.display="none","placeholder"!=e.target.className&&"LI"==e.target.nodeName){this.over=e.target;var t=e.pageY-$(this.over).offset().top,n=this.over.offsetHeight/2,r=e.target.parentNode;"OL"==r.nodeName&&(t>n?(this.nodePlacement="after",r.insertBefore(this.placeholder,e.target.nextElementSibling)):(this.nodePlacement="before",r.insertBefore(this.placeholder,e.target)))}}},{key:"dragEnter",value:function(e){e.preventDefault()}},{key:"dragEnd",value:function(e){this.dragged.style.display="block",this.dragged.parentNode.removeChild(this.placeholder);var t=Number(this.dragged.dataset.id),n=Number(this.over.dataset.id);t<n&&n--,"after"==this.nodePlacement&&n++,this.props.onUpdateOrder(t,n)}},{key:"onBiasUpdate",value:function(e,t){this.props.onBiasUpdate(e,t.target.value)}},{key:"render",value:function(){var e=this;if(null===this.props.data&&0===this.props.data.length)return null;var t=this;return u().createElement("ol",{onDragOver:this.dragOver,onDragEnter:this.dragEnter},this.props.data.map((function(n,r){return u().createElement("li",{"data-id":r,key:r,draggable:!0,onDragEnd:t.dragEnd,onDragStart:t.dragStart},u().createElement("span",{className:"drag-handle glyphicon glyphicon-option-vertical"}),n.versionName," ",n.releaseName,u().createElement("select",{ref:"bias",value:null==n.bias?"":n.bias,onChange:e.onBiasUpdate.bind(e,r)},u().createElement("option",{key:0,value:"None"},"no modifier"),u().createElement("option",{key:10,value:"AndEarlier"},"and earlier"),u().createElement("option",{key:20,value:"AndLater"},"and later")),u().createElement("button",{type:"button",className:"close",onClick:t.props.onDelete.bind(null,r)},u().createElement("span",null,"×")))})))}}])}(u().Component);const xA=CA;function DA(e){return DA="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},DA(e)}function NA(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,RA(r.key),r)}}function RA(e){var t=function(e,t){if("object"!=DA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=DA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DA(t)?t:t+""}function MA(e,t,n){return t=AA(t),function(e,t){if(t&&("object"===DA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,IA()?Reflect.construct(t,n||[],AA(e).constructor):t.apply(e,n))}function IA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(IA=function(){return!!e})()}function AA(e){return AA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},AA(e)}function LA(e,t){return LA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},LA(e,t)}var BA=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=MA(this,t,[e])).validate=n.validate.bind(n),n.getContentForm=n.getContentForm.bind(n),n.getTags=n.getTags.bind(n),n.getProducts=n.getProducts.bind(n),n.getProductReleases=n.getProductReleases.bind(n),n.onContentChange=n.onContentChange.bind(n),n.state={content:n.props.content,contentForm:null!=n.props.contentForm?n.props.contentForm:null},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&LA(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){if(null==this.state.contentForm){var e=this;$.ajax({type:"GET",url:"/staging/extension",data:{itemID:this.state.content.id},context:this}).done((function(t){var n=t;null!=n.categoryData&&0!=n.categoryData.length||null!=n.productData&&0!=n.productData.length||null!=n.tagData&&0!=n.tagData.length||null==n.defaultProductData||!(n.defaultProductData.length>0)||(n.productData=n.defaultProductData),e.setState({contentForm:n})}))}}},{key:"validate",value:function(){var e=this.refs.productReleases.validate(),t=this.refs.category.validate();return e&&t}},{key:"getContentForm",value:function(){var e=Co()(this.state.contentForm);return e.productReleaseData=this.getProductReleases(),e.productData=e.productReleaseData.map((function(t){return e.productOptions.find((function(e){return e.value==t.productID}))})),e}},{key:"getTags",value:function(){return this.refs.tags.getTags()}},{key:"getProducts",value:function(){return this.refs.productReleases.getSelectedOptions().map((function(e){return this.state.contentForm.productOptions.find((function(t){return t.value==e.productID}))}))}},{key:"getProductReleases",value:function(){return this.refs.productReleases.getSelectedOptions()}},{key:"onContentChange",value:function(e){var t=this;this.setState({content:e},(function(){t.props.onContentChange&&t.props.onContentChange(e)}))}},{key:"render",value:function(){return u().createElement("div",{className:"tfnode asset-node"},u().createElement("div",{style:{textAlign:"right"}},this.props.children),u().createElement("div",{className:"details"},u().createElement("h4",null,u().createElement("span",{className:"content-type"},this.state.content.type)," ",this.state.content.title)),u().createElement("div",{className:"editors"},u().createElement(zI,{content:this.state.content,id:this.state.content.id,src:this.state.content.thumbUrl,onChange:this.onContentChange}),u().createElement("div",{className:"data-editors"},null!=this.state.contentForm&&u().createElement(xA,{ref:"productReleases",name:"productReleases",required:!0,requiredErrorMessage:"At least one software release is required.",productOptions:this.state.contentForm.productOptions,releases:this.state.contentForm.productReleaseList,selectedReleases:this.state.contentForm.productReleaseData}),null!=this.state.contentForm&&u().createElement(wa,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.state.contentForm.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.contentForm.categoryData}),null!=this.state.contentForm&&u().createElement(vj,{ref:"tags",label:"Content Tags",placeholder:"Add Tag...",tags:this.state.contentForm.tagData}))))}}])&&NA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);BA.propTypes={content:d().object.isRequired,contentForm:d().object,onContentChange:d().func};const FA=BA;function UA(e){return UA="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},UA(e)}function qA(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,KA(r.key),r)}}function KA(e){var t=function(e,t){if("object"!=UA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=UA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UA(t)?t:t+""}function VA(e,t,n){return t=WA(t),function(e,t){if(t&&("object"===UA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zA()?Reflect.construct(t,n||[],WA(e).constructor):t.apply(e,n))}function zA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zA=function(){return!!e})()}function WA(e){return WA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WA(e)}function HA(e,t){return HA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HA(e,t)}var $A=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=VA(this,t,[e])).validate=n.validate.bind(n),n.valid=n.valid.bind(n),n.getNodes=n.getNodes.bind(n),n.getContent=n.getContent.bind(n),n.getContentForms=n.getContentForms.bind(n),n.getExtraInfo=n.getExtraInfo.bind(n),n.hasContent=n.hasContent.bind(n),n.onAcceptContent=n.onAcceptContent.bind(n),n.onDeleteNode=n.onDeleteNode.bind(n),n.onMoveUpNode=n.onMoveUpNode.bind(n),n.onMoveDownNode=n.onMoveDownNode.bind(n),n.updateNodeOrder=n.updateNodeOrder.bind(n),n.getContentForm=n.getContentForm.bind(n),n.onContentChange=n.onContentChange.bind(n),n._content=n.props.contentData?n.props.contentData:[],n._contentForms=n.props.contentForms?n.props.contentForms:[],n._nodes=n.props.contentNodes?n.props.contentNodes:[],n.state={nodes:n._nodes,isValid:n.valid(),showValidation:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HA(e,t)}(t,e),n=t,r=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){var e=this,t=!0;return Object.keys(this.refs).forEach((function(n){var r=e.refs[n].validate();t=t&&r})),!1===this.props.required||!0===this.props.required&&this.hasContent()&&t}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"getContentForms",value:function(){var e=this,t=[];return Object.keys(this.refs).forEach((function(n){t.push(e.refs[n].getContentForm())})),t}},{key:"getExtraInfo",value:function(){var e=this,t=[],n=[];return Object.keys(this.refs).forEach((function(r){t=t.concat(e.refs[r].getTags()),n=n.concat(e.refs[r].getProducts())})),{tags:vn.arrayUnique(t),products:vn.arrayUnique(n)}}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onAcceptContent",value:function(e,t){var n=this;e.forEach((function(e){n._content.push(e);var t={id:vn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n._nodes.push(t)})),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);if("Content"==n[0].type){var r=n[0].data;Ev(this._content,r),this.props.onDelete&&this.props.onDelete(r)}this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"getContentForm",value:function(e){for(var t=0;t<this._contentForms.length;t++)if(this._contentForms[t].id==e)return this._contentForms[t];return null}},{key:"onContentChange",value:function(e){var t=wv(this._content,e.id);null!=t&&(this._content[t]=e)}},{key:"render",value:function(){var e="tfnode-editor";!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid||(e+=" has-error");var t=[];return this.state.nodes.forEach((function(e,n){if("Content"===e.type){var r=gv(this._content,e.data),o=this.getContentForm(e.data);t.push(u().createElement(FA,{ref:e.id,key:"c:"+e.id,content:r,contentForm:o,onContentChange:this.onContentChange},u().createElement(IM,{index:n,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,n),onMoveUp:this.onMoveUpNode.bind(null,n),onMoveDown:this.onMoveDownNode.bind(null,n)})))}t.push(u().createElement("div",{key:"p:"+n,className:"tfnode placeholder-node",style:{marginBottom:"20px"}},u().createElement("hr",null)))}),this),u().createElement("div",{className:e},t,u().createElement(ym,{closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.onAcceptContent,onCancel:this.onHideStaging},u().createElement("h4",null,u().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),u().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid?null:u().createElement(sa,{message:"At least one content item (image/video) is required"}))}}],r&&qA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);$A.propTypes={fileSizeLimit:d().number,contentNodes:d().array,contentData:d().array,contentForms:d().array,required:d().bool,requiredErrorMessage:d().string,onChange:d().func,onDelete:d().func},$A.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const GA=$A;function JA(e){return JA="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},JA(e)}function QA(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,YA(r.key),r)}}function YA(e){var t=function(e,t){if("object"!=JA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=JA(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==JA(t)?t:t+""}function XA(e,t,n){return t=eL(t),function(e,t){if(t&&("object"===JA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ZA()?Reflect.construct(t,n||[],eL(e).constructor):t.apply(e,n))}function ZA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ZA=function(){return!!e})()}function eL(e){return eL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},eL(e)}function tL(e,t){return tL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tL(e,t)}var nL=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=XA(this,t,[e])).changeStage=n.changeStage.bind(n),n.processLastStage=n.processLastStage.bind(n),n.updateSupportContent=n.updateSupportContent.bind(n),n.editCancel=n.editCancel.bind(n),n.onContentDelete=n.onContentDelete.bind(n),n.onPublishToProfileChange=n.onPublishToProfileChange.bind(n),n.onSubmit=n.onSubmit.bind(n),n.getExtraInfo=n.getExtraInfo.bind(n),n.stages=["Upload Content","Upload Example Gallery","Add Info","Publish"],n.form=n.props.form,n.projectTagsAndProducts=null,n.state={currentStage:1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tL(e,t)}(t,e),n=t,(r=[{key:"getExtraInfo",value:function(e){for(var t=[],n=[],r=0;r<e.length;r++)t=t.concat(e[r].tagData),n=n.concat(e[r].productData);return{tags:vn.arrayUnique(t),products:vn.arrayUnique(n)}}},{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.contentForms=this.refs.contentEditor.getContentForms();var r=this.refs.contentEditor.getContent();this.form.supportContentData=this.updateSupportContent(r),this.projectTagsAndProducts=this.getExtraInfo(this.form.contentForms),(null==this.form.title||""==this.form.title)&&null!=r&&r.length>0&&(this.form.title=r[0].title),t=this.refs.contentEditor.validate();break;case 2:this.form.supportContentData=this.refs.supportContentEditor.getContent().content,this.form.supportContentNodes=this.refs.supportContentEditor.getNodes(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==wv(this.form.supportContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=!0;break;case 3:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.shortDescription=this.refs.shortDescription.getValue(),this.form.description=this.refs.description.getValue(),this.form.installation=this.refs.installation.getValue(),this.form.usage=this.refs.usage.getValue(),this.form.license=this.refs.license.getValue(),t=this.refs.title.validate()&&this.refs.shortDescription.validate()&&this.refs.description.validate();break;case 4:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue()}},{key:"updateSupportContent",value:function(e){for(var t=this.form.supportContentData,n=[],r=0;r<e.length;r++){for(var o=!1,i=0;i<t.length;i++)t[i].id==e[r].id&&(t[i]=e[r],t[i].isStatic=!0,o=!0);o||(e[r].isStatic=!0,n.push(e[r]))}return n.length>0&&(t=t.concat(n)),t}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){Ev(this.form.supportContentData,e)}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onSubmit",value:function(){4==this.state.currentStage&&this.processLastStage();var e={deliverablesContentNodes:this.form.deliverablesContentNodes,contentForms:this.form.contentForms.map((function(e){return Ov(e)})),supportContentNodes:this.form.supportContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,shortDescription:this.form.shortDescription,description:this.form.description,installation:this.form.installation,usage:this.form.usage,license:this.form.license,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,commentsStatus:this.form.commentsStatusOptions.selectedValue,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()},t=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit-extension"),data:e}).done((function(e,n,r){alerts.success("Project Saved"),window.location.replace(t.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:e=u().createElement(GA,{ref:"contentEditor",contentNodes:this.form.deliverablesContentNodes,contentData:this.form.deliverablesContentData,contentForms:this.form.contentForms,onDelete:this.onContentDelete,required:!0});break;case 2:e=u().createElement("div",{className:"container subsection gallery-editor"},u().createElement("label",null,"Example Gallery"),u().createElement("p",null,"Add images and video examples to show off the shared asset.  Drag thumbnails to change the order."),u().createElement(Lg,{ref:"supportContentEditor",content:this.form.supportContentData}));break;case 3:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(Bw,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),u().createElement("div",{className:"col-md-12"},u().createElement(hI,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.supportContentData,label:"Project Cover Image"})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"shortDescription",label:"Short Description *",placeholder:"Short project description to be shown in the gallery...",value:this.form.shortDescription,rows:3,required:!0,requiredErrorMessage:"Short description required."})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"description",label:"Description *",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"license",label:"License Information",placeholder:"license...",value:this.form.license,rows:10,required:!1})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"installation",label:"Install Instructions",placeholder:"How to install...",value:this.form.installation,rows:10,required:!1})),u().createElement("div",{className:"col-md-12"},u().createElement(SI,{ref:"usage",label:"How To Use",placeholder:"Describe how to use...",value:this.form.usage,rows:10,required:!1})),u().createElement("div",{className:"col-md-12 project-info"},u().createElement(Ok,{list:this.projectTagsAndProducts.tags,label:"Project Tags"}),u().createElement(Ok,{list:this.projectTagsAndProducts.products.map((function(e){return e.text})),label:"Project Products"})));break;case 4:e=u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-12"},u().createElement(nE,{ref:"status",name:"status",label:"Project Status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue})),u().createElement("div",{className:"col-md-12"},u().createElement("fieldset",{className:"project-publish"},u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement("legend",null,"Publishing status"))),u().createElement("div",{className:"row"},u().createElement("div",{className:"col-md-6"},u().createElement($w,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))))),u().createElement("div",{style:{textAlign:"center"}},u().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return u().createElement("div",null,u().createElement("section",{id:"heroBanner",className:"default"},u().createElement("div",{className:"hero-content"},u().createElement("h2",null,this.form.projectType," Project Edit"))),u().createElement("div",{className:"container subsection",id:"projectEdit"},u().createElement(uN,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])&&QA(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);nL.propTypes={form:d().object.isRequired};const rL=nL;function oL(e){return oL="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},oL(e)}function iL(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,aL(r.key),r)}}function aL(e){var t=function(e,t){if("object"!=oL(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=oL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oL(t)?t:t+""}function sL(e,t,n){return t=lL(t),function(e,t){if(t&&("object"===oL(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,cL()?Reflect.construct(t,n||[],lL(e).constructor):t.apply(e,n))}function cL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(cL=function(){return!!e})()}function lL(e){return lL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lL(e)}function uL(e,t){return uL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uL(e,t)}var pL=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=sL(this,t,[e])).validate=n.validate.bind(n),n.onChange=n.onChange.bind(n),n.doQuery=n.doQuery.bind(n),n.startRename=n.startRename.bind(n),n.cancelRename=n.cancelRename.bind(n),n.getValue=n.getValue.bind(n),n.state={doRename:!1,value:n.props.value,status:null,helpMessage:n.props.helpMessage},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uL(e,t)}(t,e),n=t,(r=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=f()(this.doQuery,500)}},{key:"validate",value:function(e){return/^[\u00C0-\u1FFF\u2C00-\uD7FF\w\. -]{3,50}$/gi.exec(e)}},{key:"onChange",value:function(){var e=this.refs.name.value;e.trim()!=this.props.value?this.validate(e.trim())?this.doQuery(e):this.setState({value:e,status:"Error",helpMessage:"Profile name must be between 3 to 50 characters in length and only contain alphanumeric characters."}):this.setState({value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"doQuery",value:function(e){var t=this,n="Error",r="Name Not Available";$.ajax({url:"/api/profile/checkrename",type:"POST",data:{name:e.trim()}}).done((function(e){!0===e.available&&(n="Success",r="Name Available.  Profile will be renamed to <strong>"+e.name+"</strong> after save.")})).fail((function(e){alerts.error(e.error)})).always((function(){t.setState({value:e,status:n,helpMessage:r})}))}},{key:"startRename",value:function(){this.setState({doRename:!0})}},{key:"cancelRename",value:function(){this.setState({doRename:!1,value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"getValue",value:function(){return!0===this.state.doRename&&"Success"===this.state.status&&this.validate(this.state.value)&&this.state.value!=this.props.value?this.state.value:null}},{key:"render",value:function(){if(this.state.doRename){var e="profile-name-editor form-group";if(null!=this.state.status)switch(this.state.status){case"Success":e+=" has-success";break;case"Error":e+=" has-error"}return u().createElement("div",{className:e},u().createElement("label",{className:"static"},"Profile Name"),u().createElement("div",{className:"input-group"},u().createElement("input",{type:"text",ref:"name",className:"form-control",defaultValue:this.props.value,onChange:this.onChange,style:{width:"100%"}}),u().createElement("div",{className:"input-group-btn"},u().createElement("button",{type:"button",className:"btn btn-primary",onClick:this.cancelRename},"Cancel Rename"))),u().createElement("span",{className:"help-block",dangerouslySetInnerHTML:{__html:this.state.helpMessage}}))}return u().createElement("div",{className:"profile-name-editor form-group"},u().createElement("label",{className:"static"},"Profile Name"),u().createElement("div",{className:"static-input"},this.props.value," ",u().createElement("button",{type:"button",className:"btn-link icon icon-after icon-refresh",onClick:this.startRename},"Rename Profile")))}}])&&iL(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);pL.propTypes={helpMessage:d().string},pL.defaultProps={helpMessage:"Rename will only occur after save if the above input is valid."};const fL=pL;function hL(e){return hL="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},hL(e)}function dL(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,yL(r.key),r)}}function yL(e){var t=function(e,t){if("object"!=hL(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hL(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hL(t)?t:t+""}function mL(e,t,n){return t=vL(t),function(e,t){if(t&&("object"===hL(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bL()?Reflect.construct(t,n||[],vL(e).constructor):t.apply(e,n))}function bL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bL=function(){return!!e})()}function vL(e){return vL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vL(e)}function gL(e,t){return gL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gL(e,t)}var wL=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=mL(this,t,[e])).getValue=n.getValue.bind(n),n.open=n.open.bind(n),n.change=n.change.bind(n),n.state={hasAvatar:n.props.hasAvatar,avatarUrl:n.props.avatarUrl},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gL(e,t)}(t,e),n=t,(r=[{key:"getValue",value:function(){}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"change",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/profile/"+this.props.profileRouteName+"/avatar",contentType:!1,processData:!1,data:n}).done((function(e,t,n){r.setState({hasAvatar:e.hasAvatar,avatarUrl:e.avatarUrl})})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"render",value:function(){var e=this,t=this.state.hasAvatar?"Replace Image":"Add Image",n={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.change};return u().createElement("div",{className:"profile-avatar-editor form-group"},u().createElement("label",{className:"static"},"Avatar"),u().createElement("img",{className:"circle",src:this.state.avatarUrl}),u().createElement("button",{type:"button",onClick:this.open,className:"btn-link icon icon-after icon-refresh"},t),u().createElement("input",n))}}])&&dL(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(u().Component);wL.propTypes={hasAvatar:d().bool.isRequired,avatarUrl:d().string};const EL=wL})(),i})()));
