(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[613],{92955:function(e,t,n){var r=n(34155),o=n(48764).Buffer;(()=>{var e={804:(e,t,n)=>{function r(){"use strict";r=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},s=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",u=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function f(t,n,r,o){var i,l,s=Object.create((n&&n.prototype instanceof g?n:g).prototype);return a(s,"_invoke",{value:(i=new P(o||[]),l=p,function(n,o){if(l===y)throw Error("Generator is already running");if(l===h){if("throw"===n)throw o;return{value:e,done:!0}}for(i.method=n,i.arg=o;;){var a=i.delegate;if(a){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),v;var a=m(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,v)}(a,i);if(s){if(s===v)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(l===p)throw l=h,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);l=y;var c=m(t,r,i);if("normal"===c.type){if(l=i.done?h:"suspendedYield",c.arg===v)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(l=h,i.method="throw",i.arg=c.arg)}})}),s}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var p="suspendedStart",y="executing",h="completed",v={};function g(){}function b(){}function j(){}var _={};d(_,s,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&o.call(x,s)&&(_=x);var S=j.prototype=g.prototype=Object.create(_);function O(e){["next","throw","return"].forEach(function(t){d(e,t,function(e){return this._invoke(t,e)})})}function k(e,t){var n;a(this,"_invoke",{value:function(r,a){function l(){return new t(function(n,l){!function n(r,a,l,s){var c=m(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&o.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,l,s)},function(e){n("throw",e,l,s)}):t.resolve(d).then(function(e){u.value=e,l(u)},function(e){return n("throw",e,l,s)})}s(c.arg)}(r,a,n,l)})}return n=n?n.then(l,l):l()}})}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r<t.length;)if(o.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw TypeError(i(t)+" is not iterable")}return b.prototype=j,a(S,"constructor",{value:j,configurable:!0}),a(j,"constructor",{value:b,configurable:!0}),b.displayName=d(j,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,d(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(k.prototype),d(k.prototype,c,function(){return this}),t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(f(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},O(S),d(S,u,"Generator"),d(S,s,function(){return this}),d(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function o(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}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})(e)}var a=n(353);function l(e,t,n){var r=t;this.code=e,void 0!==n&&void 0!==n.message&&(r+=' Original "'.concat(n.name,'" Message: "').concat(n.message,'"')),this.message=r,this.json={error:r,code:this.code}}function s(e){return"object"!==i(e)||"string"!=typeof e.message?"":e.message}function c(e){return Array.isArray(e)?e.map(function(e){return s(e)}).filter(function(e){return""!=e}).join(", "):""}function u(e){if(!Array.isArray(e))return"";var t=e.map(function(e){return c(e.messages)}).filter(function(e){return""!=e}).join(", ");return""===t?"":"Messages: "+t}function d(){var e;return e=r().mark(function e(t,n){var o,s,c;return r().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!("object"!==i(t)||t.status<400||t.status>600)){e.next=2;break}return e.abrupt("return");case 2:if(o="",e.prev=3,s={},"application/json"!==t.headers["content-type"]){e.next=11;break}return e.next=8,t.json();case 8:s=e.sent,e.next=15;break;case 11:return e.next=13,t.text();case 13:c=e.sent;try{s=JSON.parse(c)}catch(e){s.error=c}case 15:"string"==typeof s.error&&(o=s.error),Array.isArray(s.message)&&(o=u(s.message)),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(3),o="Unknown error";case 23:if(void 0===n){e.next=25;break}return e.abrupt("return",n);case 25:throw a.notifyError("A remote request to ".concat(t.url," failed"),o),new l(t.status,o);case 27:case"end":return e.stop()}},e,null,[[3,19]])}),(d=function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function l(e){o(a,r,i,l,s,"next",e)}function s(e){o(a,r,i,l,s,"throw",e)}l(void 0)})}).apply(this,arguments)}e.exports={apiError:l,resError:function(e,t){var n=500,r={};t instanceof l?(n=t.code,r={error:"API error: "+t.message,errorType:t.constructor.name}):r=t instanceof Error?{error:"Unexpected Error: "+t,errorType:t.constructor.name}:{error:"Unexpected error: "+JSON.stringify(t),errorType:i(t)},e.statusCode=n,e.json(r)},reqError:function(e,t){return d.apply(this,arguments)},apiErrorMessageText:s,apiErrorMessageList:c,apiErrorMessage:u}},290:(e,t,n)=>{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})(e)}function a(){"use strict";a=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},s=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",u=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function f(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof g?n:g).prototype);return o(s,"_invoke",{value:(a=new P(i||[]),l=p,function(n,o){if(l===y)throw Error("Generator is already running");if(l===h){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),v;var a=m(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,v)}(i,a);if(s){if(s===v)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===p)throw l=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=y;var c=m(t,r,a);if("normal"===c.type){if(l=a.done?h:"suspendedYield",c.arg===v)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=h,a.method="throw",a.arg=c.arg)}})}),s}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var p="suspendedStart",y="executing",h="completed",v={};function g(){}function b(){}function j(){}var _={};d(_,s,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&r.call(x,s)&&(_=x);var S=j.prototype=g.prototype=Object.create(_);function O(e){["next","throw","return"].forEach(function(t){d(e,t,function(e){return this._invoke(t,e)})})}function k(e,t){var n;o(this,"_invoke",{value:function(o,a){function l(){return new t(function(n,l){!function n(o,a,l,s){var c=m(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==i(d)&&r.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,l,s)},function(e){n("throw",e,l,s)}):t.resolve(d).then(function(e){u.value=e,l(u)},function(e){return n("throw",e,l,s)})}s(c.arg)}(o,a,n,l)})}return n=n?n.then(l,l):l()}})}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw TypeError(i(t)+" is not iterable")}return b.prototype=j,o(S,"constructor",{value:j,configurable:!0}),o(j,"constructor",{value:b,configurable:!0}),b.displayName=d(j,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,j):(e.__proto__=j,d(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(k.prototype),d(k.prototype,c,function(){return this}),t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(f(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},O(S),d(S,u,"Generator"),d(S,s,function(){return this}),d(S,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;M(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function l(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){l(i,r,o,a,s,"next",e)}function s(e){l(i,r,o,a,s,"throw",e)}a(void 0)})}}var c=n(397).sha256sum,u=n(701),d=n(286),f=n(804).reqError,m=!!r.env.DEBUG_REMOTE_API&&30;function p(){return(p=s(a().mark(function e(t){var n,r;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return m&&console.log("deleteAPI",t),e.next=3,fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json;charset=utf-8"}});case 3:return n=e.sent,m&&console.log("deleteAPI",n.status),e.next=7,f(n);case 7:return e.next=9,n.json();case 9:return r=e.sent,e.abrupt("return",r);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function y(){return(y=s(a().mark(function e(t,n){var r,l,s,d,p,y,h,v;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return m&&console.log("getAPI",t,n),l=(r=n||{cached:!1,fallback:void 0,buffer:!1,headers:{},asResponse:!1}).cached,s=r.fallback,d=r.buffer,p=r.headers,y=r.asResponse,e.next=4,u.get(c(t+JSON.stringify(n)));case 4:if(h=e.sent,m&&console.log("cached",l,i(h),h),!l||!h){e.next=9;break}return m&&console.log("resolve cached:",t),e.abrupt("return",h);case 9:return m&&console.log("getAPI fetch",t),e.next=12,fetch(t,{method:"GET",headers:p});case 12:return v=e.sent,m&&console.log("getAPI",v.status),e.next=16,f(v,s);case 16:if(void 0===(h=e.sent)){e.next=19;break}return e.abrupt("return",h);case 19:if(!y){e.next=21;break}return e.abrupt("return",v);case 21:if(!d){e.next=27;break}return e.t0=o,e.next=25,v.arrayBuffer();case 25:return e.t1=e.sent,e.abrupt("return",e.t0.from.call(e.t0,e.t1));case 27:return e.next=29,v.json();case 29:if(h=e.sent,!l){e.next=34;break}return m&&console.log("cache store",t),e.next=34,u.put(c(t+JSON.stringify(n)),h,36e5);case 34:return e.abrupt("return",h);case 35:case"end":return e.stop()}},e)}))).apply(this,arguments)}function h(){return(h=s(a().mark(function e(t,n,r){var o,i,l,s,c,u;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return m&&console.log("postAPI",t),i=(o=r||{headers:{"Content-Type":"application/json;charset=utf-8"},asResponse:!1,redirect:"follow"}).headers,l=o.asResponse,s=o.redirect,e.next=4,fetch(t,{method:"POST",body:"string"==typeof n?n:JSON.stringify(n),headers:i,redirect:s});case 4:return c=e.sent,m&&console.log("postAPI",c.status),e.next=8,f(c);case 8:if(!l){e.next=10;break}return e.abrupt("return",c);case 10:return e.next=12,c.json();case 12:return u=e.sent,e.abrupt("return",u);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}function v(){return(v=s(a().mark(function e(t,n){var r,o;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return m&&console.log("putAPI",t),e.next=3,fetch(t,{method:"PUT",body:JSON.stringify(n),headers:{"Content-Type":"application/json;charset=utf-8"}});case 3:return r=e.sent,m&&console.log("putAPI",r.status),e.next=7,f(r);case 7:return e.next=9,r.json();case 9:return o=e.sent,e.abrupt("return",o);case 11:case"end":return e.stop()}},e)}))).apply(this,arguments)}function g(){return(g=s(a().mark(function e(t,n){var r,o,i,l;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return m&&console.log("putAPIMultipart"),r=new d,n.forEach(function(e){r.append(e.name,e.data,e.filename)}),o=r.getBuffer().toString("utf-8"),e.next=6,fetch(t,{method:"PUT",body:o,headers:r.getHeaders()});case 6:return i=e.sent,m&&console.log("putAPIMultipart",i.status),e.next=10,f(i);case 10:return e.next=12,i.text();case 12:return l=e.sent,e.abrupt("return",l);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}e.exports={deleteAPI:function(e){return p.apply(this,arguments)},getAPI:function(e,t){return y.apply(this,arguments)},postAPI:function(e,t,n){return h.apply(this,arguments)},putAPI:function(e,t){return v.apply(this,arguments)},putAPIMultipart:function(e,t){return g.apply(this,arguments)}}},967:function(e){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})(e)}var n,r,o=(n=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.selector=t,this.elements=[],this.version="1.3.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:n.wrap||!1,wrapWith:n.wrapWith||"<span></span>",marginTop:n.marginTop||0,marginBottom:n.marginBottom||0,stickyFor:n.stickyFor||0,stickyClass:n.stickyClass||null,stickyContainer:n.stickyContainer||"body",onChange:n.onChange||null},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()},r=[{key:"run",value:function(){var e=this;this.onPageLoad=setInterval(function(){if("complete"===document.readyState){clearInterval(e.onPageLoad);var t=document.querySelectorAll(e.selector);e.forEach(t,function(t){return e.renderElement(t)})}},10)}},{key:"renderElement",value:function(e){var t=this;e.sticky={},e.sticky.active=!1,e.sticky.marginTop=parseInt(e.getAttribute("data-margin-top"))||this.options.marginTop,e.sticky.marginBottom=parseInt(e.getAttribute("data-margin-bottom"))||this.options.marginBottom,e.sticky.stickyFor=parseInt(e.getAttribute("data-sticky-for"))||this.options.stickyFor,e.sticky.stickyClass=e.getAttribute("data-sticky-class")||this.options.stickyClass,e.sticky.onChange=e.getAttribute("data-sticky-on-change")||this.options.onChange,e.sticky.wrap=!!e.hasAttribute("data-sticky-wrap")||this.options.wrap,e.sticky.stickyContainer=this.options.stickyContainer,e.sticky.container=this.getStickyContainer(e),e.sticky.container.rect=this.getRectangle(e.sticky.container),e.sticky.rect=this.getRectangle(e),"img"===e.tagName.toLowerCase()&&(e.onload=function(){return e.sticky.rect=t.getRectangle(e)}),e.sticky.wrap&&this.wrapElement(e),this.activate(e)}},{key:"wrapElement",value:function(e){e.insertAdjacentHTML("beforebegin",e.getAttribute("data-sticky-wrapWith")||this.options.wrapWith),e.previousSibling.appendChild(e)}},{key:"unwrapElement",value:function(e){var t=e.parentElement;t.insertAdjacentElement("beforebegin",e),t.remove()}},{key:"activate",value:function(e){e.sticky.rect.top+e.sticky.rect.height<e.sticky.container.rect.top+e.sticky.container.rect.height&&e.sticky.stickyFor<this.vp.width&&!e.sticky.active&&(e.sticky.active=!0),0>this.elements.indexOf(e)&&this.elements.push(e),e.sticky.resizeEvent||(this.initResizeEvents(e),e.sticky.resizeEvent=!0),e.sticky.scrollEvent||(this.initScrollEvents(e),e.sticky.scrollEvent=!0),this.setPosition(e)}},{key:"initResizeEvents",value:function(e){var t=this;e.sticky.resizeListener=function(){return t.onResizeEvents(e)},window.addEventListener("resize",e.sticky.resizeListener)}},{key:"destroyResizeEvents",value:function(e){window.removeEventListener("resize",e.sticky.resizeListener)}},{key:"onResizeEvents",value:function(e){try{this.vp=this.getViewportSize(),e.sticky.rect=this.getRectangle(e),e.sticky.container.rect=this.getRectangle(e.sticky.container),e.sticky.rect.top+e.sticky.rect.height<e.sticky.container.rect.top+e.sticky.container.rect.height&&e.sticky.stickyFor<this.vp.width&&!e.sticky.active?e.sticky.active=!0:(e.sticky.rect.top+e.sticky.rect.height>=e.sticky.container.rect.top+e.sticky.container.rect.height||e.sticky.stickyFor>=this.vp.width&&e.sticky.active)&&(e.sticky.active=!1),this.setPosition(e)}catch(t){e.sticky&&console.error(t)}}},{key:"initScrollEvents",value:function(e){var t=this;e.sticky.scrollListener=function(){return t.onScrollEvents(e)},window.addEventListener("scroll",e.sticky.scrollListener)}},{key:"destroyScrollEvents",value:function(e){window.removeEventListener("scroll",e.sticky.scrollListener)}},{key:"onScrollEvents",value:function(e){e.sticky&&e.sticky.active&&this.setPosition(e)}},{key:"setPosition",value:function(e){try{if(this.css(e,{position:"",width:"",top:"",left:""}),this.vp.height<e.sticky.rect.height||!e.sticky.active)return;e.sticky.rect.width||(e.sticky.rect=this.getRectangle(e)),e.sticky.wrap&&this.css(e.parentNode,{display:"block",width:e.sticky.rect.width+"px",height:e.sticky.rect.height+"px"}),0===e.sticky.rect.top&&e.sticky.container===this.body?(this.css(e,{position:"fixed",top:e.sticky.rect.top+"px",left:e.sticky.rect.left+"px",width:e.sticky.rect.width+"px"}),e.sticky.stickyClass&&e.classList.add(e.sticky.stickyClass),e.sticky.onChange&&!e.sticky.on&&(e.sticky.on=!0,e.sticky.onChange({sticky:!0,bottom:!1}))):this.scrollTop>e.sticky.rect.top-e.sticky.marginTop?(this.css(e,{position:"fixed",width:e.sticky.rect.width+"px",left:e.sticky.rect.left+"px"}),this.scrollTop+e.sticky.rect.height+e.sticky.marginTop>e.sticky.container.rect.top+e.sticky.container.offsetHeight-e.sticky.marginBottom?(e.sticky.stickyClass&&e.classList.remove(e.sticky.stickyClass),e.sticky.onChange&&e.sticky.on&&(e.sticky.on=!1,e.sticky.onChange({sticky:!1,bottom:!0})),this.css(e,{top:e.sticky.container.rect.top+e.sticky.container.offsetHeight-(this.scrollTop+e.sticky.rect.height+e.sticky.marginBottom)+"px"})):(e.sticky.stickyClass&&e.classList.add(e.sticky.stickyClass),e.sticky.onChange&&!e.sticky.on&&(e.sticky.on=!0,e.sticky.onChange({sticky:!0,bottom:!1})),this.css(e,{top:e.sticky.marginTop+"px"}))):(e.sticky.stickyClass&&e.classList.remove(e.sticky.stickyClass),this.css(e,{position:"",width:"",top:"",left:""}),e.sticky.wrap&&this.css(e.parentNode,{display:"",width:"",height:""}),e.sticky.onChange&&e.sticky.on&&(e.sticky.on=!1,e.sticky.onChange({sticky:!1,bottom:!1})))}catch(t){e.sticky&&console.error(t)}}},{key:"update",value:function(){var e=this;this.forEach(this.elements,function(t){try{t.sticky.rect=e.getRectangle(t),t.sticky.container.rect=e.getRectangle(t.sticky.container),e.activate(t),e.setPosition(t)}catch(e){t.sticky&&console.error(e)}})}},{key:"destroy",value:function(){var e=this;clearInterval(this.onPageLoad),window.removeEventListener("load",this.updateScrollTopPosition),window.removeEventListener("scroll",this.updateScrollTopPosition),this.forEach(this.elements,function(t){e.destroyResizeEvents(t),e.destroyScrollEvents(t),t.sticky.wrap&&e.unwrapElement(t),t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),e.css(t,{position:"",top:"",left:"",width:""}),delete t.sticky}),this.elements=[]}},{key:"getStickyContainer",value:function(e){for(var t=e.parentNode;!t.hasAttribute("data-sticky-container")&&!t.parentNode.querySelector(e.sticky.stickyContainer)&&t!==this.body;)t=t.parentNode;return t}},{key:"getRectangle",value:function(e){this.css(e,{position:"",width:"",top:"",left:""});var t=Math.max(e.offsetWidth,e.clientWidth,e.scrollWidth),n=Math.max(e.offsetHeight,e.clientHeight,e.scrollHeight),r=0,o=0;do r+=e.offsetTop||0,o+=e.offsetLeft||0,e=e.offsetParent;while(e);return{top:r,left:o,width:t,height:n}}},{key:"getViewportSize",value:function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}},{key:"updateScrollTopPosition",value:function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0}},{key:"forEach",value:function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n])}},{key:"css",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e.style[n]=t[n])}}],function(e,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,function(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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(n)?n:n+""}(o.key),o)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n);e.exports=o},704:e=>{var t,n,o,i,a,l,s,c,u,d,f,m,p,y,h,v,g,b,j={baseUrl:null===(t=r)||void 0===r||null===(t=t.env)||void 0===t?void 0:t.CMS_API_BASE_URL,loginIdentifier:null===(n=r)||void 0===r||null===(n=n.env)||void 0===n?void 0:n.CMS_API_LOGIN_IDENTIFER,loginPassword:null===(o=r)||void 0===r||null===(o=o.env)||void 0===o?void 0:o.CMS_API_LOGIN_PASSWORD},_="string"==typeof(null===(i=r)||void 0===r||null===(i=i.env)||void 0===i?void 0:"https://storybird.io:443")?null===(a=r)||void 0===r||null===(a=a.env)||void 0===a?void 0:"https://storybird.io:443":"https://storybird.io",w={brandName:"Producers Market",defaultMetaDescription:"Producers Market empowers farmers and brings transparency to supply chains by facilitating direct market linkage that incentivizes regenerative agriculture.",location:"string"==typeof(null===(l=r)||void 0===r||null===(l=l.env)||void 0===l?void 0:"https://storybird.io:443")?null===(s=r)||void 0===r||null===(s=s.env)||void 0===s?void 0:"https://storybird.io:443":"https://producersmarket.com",apiBase:"https://storybird.io:443/api",tradeFacilitationEmail:"tradefacilitation@producersmarket.com"},x={intercomAppId:null===(c=r)||void 0===r||null===(c=c.env)||void 0===c?void 0:"unj7sw4s",consumerUrl:_,ptcHost:null!==(u=null===(d=r)||void 0===r||null===(d=d.env)||void 0===d?void 0:d.NEXT_PUBLIC_PTC_HOST)&&void 0!==u?u:"https://console.producerstrust.com",isProduction:"production"===(null===(f=r)||void 0===r||null===(f=f.env)||void 0===f?void 0:"production"),isDevelopment:"development"===(null===(m=r)||void 0===r||null===(m=m.env)||void 0===m?void 0:"production"),isTest:"test"===(null===(p=r)||void 0===r||null===(p=p.env)||void 0===p?void 0:"production"),isDeveloperHost:0===(null!==(y=r)&&void 0!==r&&null!==(y=y.env)&&void 0!==y&&(y="https://storybird.io:443",1)&&void 0!==y?y.indexOf("http://localhost"):void 0),isStagingHost:0===(null!==(h=r)&&void 0!==r&&null!==(h=h.env)&&void 0!==h&&(h="https://storybird.io:443",1)&&void 0!==h?h.indexOf("https://staging."):void 0),isDevelopmentHost:0===(null!==(v=r)&&void 0!==r&&null!==(v=v.env)&&void 0!==v&&(v="https://storybird.io:443",1)&&void 0!==v?v.indexOf("https://development."):void 0),isProductionHost:0===(null!==(g=r)&&void 0!==r&&null!==(g=g.env)&&void 0!==g&&(g="https://storybird.io:443",1)&&void 0!==g?g.indexOf("https://storybird.io"):void 0)||0===(null!==(b=r)&&void 0!==r&&null!==(b=b.env)&&void 0!==b&&(b="https://storybird.io:443",1)&&void 0!==b?b.indexOf("https://storybird.co"):void 0),cms:j,marketplace:w};e.exports=x},629:e=>{e.exports={fallbackLocale:"en"}},619:e=>{var t="https://29e56114bb010438c335355b6d05734c@o230522.ingest.us.sentry.io/4507826912296960",n="https://storybird.io:443",r=n.indexOf("http://localhost")>=0,o=n.indexOf("https://staging.storybird.io")>=0||n.indexOf("https://staging.producersmarket.com")>=0,i=n.indexOf("https://storybird.io")>=0||n.indexOf("https://producersmarket.com")>=0||n.indexOf("https://beta.producersmarket.com")>=0,a={staging:o,production:i,development:r},l={dsn:t,isDevelopment:r,isStaging:o,isProduction:i,sentry:{enabled:i||o||!1,autoSessionTracking:!1,environment:Object.keys(a).filter(function(e){return a[e]}).join(","),dsn:t,ignoreErrors:["Invalid LngLat object: (NaN, NaN)","ResizeObserver loop limit exceeded"]},debug:!1};e.exports=l},353:(e,t,n)=>{var r={notifyError:n(524),config:n(619)};e.exports=r},524:(e,t,n)=>{var r=n(964);e.exports=function(e,t){try{var n=Error(e);n.cause=t,r.captureException(n)}catch(t){console.error(e)}}},397:e=>{"use strict";e.exports=n(75239)},964:e=>{"use strict";e.exports=n(92748)},286:e=>{"use strict";e.exports=n(6230)},701:e=>{"use strict";e.exports=n(7113)}},i={};function a(t){var n=i[t];if(void 0!==n)return n.exports;var r=i[t]={exports:{}};return e[t].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.p="";var l={};(()=>{"use strict";let e;a.r(l),a.d(l,{BlockChainLogo:()=>h,BlockchainProofDetail:()=>ej,BuyAction:()=>eJ,CookieWarning:()=>tt,CustomError:()=>tq,EnumContextProvider:()=>ni,ExternLink:()=>eZ,FacilityModalContent:()=>r1,FillViewData:()=>h0,FooterSection:()=>tm,FormattedDateSpan:()=>r2,FormattedText:()=>oe,HeaderSection:()=>t_,InfoWindowContent:()=>oo,IntercomContextProvider:()=>tA,IntlLink:()=>ou,JourneySummary:()=>oC,Loader:()=>nj,Location:()=>rm,MetaTags:()=>tP,NavModals:()=>iW,NewsletterForm:()=>iG,OrganizationCard:()=>a_,OrganizationStoriesCarousel:()=>sz,OriginNavSlider:()=>aP,OriginSteps:()=>a1,OriginsMap:()=>sx,ProductCard:()=>sF,ProductSteps:()=>a$,ReadMoreReadLess:()=>aq,SmallFarmerCard:()=>sB,SocialProfiles:()=>hE,StoryBird:()=>dI,StoryClaim:()=>rV,StoryClaimModalContent:()=>iI,StoryHeaderSection:()=>dv,StyleOrder:()=>hA,SupplyStep:()=>aJ,ThemeContext:()=>er,Themeable:()=>ea,ValidatedLink:()=>hF,ViewPage:()=>hT,apiMBWithClusters:()=>s,createIntlUrl:()=>oc,defaultBreakpointFunctions:()=>eQ,enableTracking:()=>eM,enumsClientInstance:()=>_,eventGA:()=>eC,getThemeNames:()=>en,initGoogleAnalytics:()=>eP,isTrackingEnabled:()=>eF,loadMapBoxStyles:()=>lV,noFormatting:()=>r9,pageviewGA:()=>ek,sentry:()=>sU,setBasePath:()=>I,setMapboxFiles:()=>lG,setTheme:()=>ee,setThemeFiles:()=>X,stepDurationTracker:()=>eD,trackPageView:()=>eW,trackingEvent:()=>eU,useIntercomContext:()=>tF,windowSizeCondition:()=>i,withWindowSize:()=>e4});var t,o,i={};a.r(i),a.d(i,{OnlyAtSize:()=>cK,OnlyFromSize:()=>cX,OnlyUntilSize:()=>c0,default:()=>cV,throttle:()=>cR,useCurrentSize:()=>c4,useIsAboveSize:()=>c5,useIsInSize:()=>c2,useIsUpToSize:()=>c8,useWindowSize:()=>c1});var s={};a.r(s),a.d(s,{cleanSelectedMarker:()=>pa,extendLatLngBounds:()=>pC,focusMarker:()=>py,initializeGeneralSpiderLeg:()=>pg,loadImages:()=>pb,mapIndexTypes:()=>m3,markerImages:()=>pe,newLatLngBounds:()=>pk,onSpiderLegClick:()=>pc,setLocale:()=>pw,setMapData:()=>pS,setZoomEventHandler:()=>pj});let c=n(67294);var u=a.n(c);let d=n(25675);var f=a.n(d),m=a(397);let p="blockChainLogo_poweredBy__mravk",y=n(85893),h=function(e){var t=e.blockchainType,n=e.poweredBy,r=void 0!==n&&n,o=!0,i="",a="",l="",s=0;if(void 0===m.supportedBlockChains[t])o=!1;else switch(i=m.supportedBlockChains[t].logo,a=m.supportedBlockChains[t].name,t){case m.supportedBlockchainType.becredible:l="".concat("blockChainLogo_becredibleLogo__mravk"," ").concat(r?p:""),s=147;break;case m.supportedBlockchainType.foodtrust:l="".concat("blockChainLogo_foodtrustLogo__mravk"," ").concat(r?p:""),s=137;break;case m.supportedBlockchainType.vechain:l="".concat("blockChainLogo_vechainLogo__mravk"," ").concat(r?p:""),s=93;break;default:console.warn("unsupported blockchainType:",t),o=!1}return o?(0,y.jsx)(f(),{src:i,alt:a,height:25,width:s,className:l}):null},v=n(83443),g=n(30381);var b=a.n(g);let j=n(31013),_=new m.enumClass,w=n(41664);var x=a.n(w);let S=n(11163);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})(e)}function k(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 C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==O(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function M(){return(M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var P={};function I(e){var t=e.filePath,n=e.asPath;(t!==P.filePath||n!==P.asPath)&&(P={filePath:t,asPath:n})}function N(e){return(N="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)}function T(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?T(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=N(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=N(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==N(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function E(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||z(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){if(e){if("string"==typeof e)return A(e,t);var n=({}).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)?A(e,t):void 0}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let F=(i9=function(e){var t,n,r=e.path,o=e.children,i=e.basePath,a=void 0===i?null:i,l=e.onTop,s=void 0!==l&&l,u=(0,v.useIntl)(),d=(0,S.useRouter)(),f=function(e){if(Array.isArray(e))return e}(n=(0,c.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,0)||z(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=f[0],p=f[1];(0,c.useEffect)(function(){var e,t,n,o;if(d.isReady){var i=(r?r.replace(/\/{2,}/,"/"):"").split("/").filter(function(e){return e}),l=null==a||null===(e=a.filePath)||void 0===e?void 0:e.includes("/preview/"),c=Array.isArray(null==d||null===(t=d.query)||void 0===t?void 0:t.params)?[d.query.params[0]]:[];p([].concat(E(s?null!==(n=null==d||null===(o=d.query)||void 0===o?void 0:o.params)&&void 0!==n?n:[]:l?c:[]),E(i)))}},[d.isReady,d.query,r,s]);var h=(t=null==d?void 0:d.asPath,new RegExp(/\/(customCertification|organization|facility|ingredient|certification|value|recipe|blockchain-info)\/[^/?#]*(?!.*(customCertification|organization|facility|ingredient|certification|value|recipe|blockchain-info))/).test(t)),g=window.location.hash;return r&&m&&m.length?(0,y.jsx)(x(),{href:{pathname:null!=a&&a.filePath?a.filePath:"/p/[productHyphenatedName]/[[...params]]",query:L(L({},null==d?void 0:d.query),{},{params:m.slice()}),hash:g},scroll:!1,shallow:!0,replace:h,legacyBehavior:!0,children:o}):(0,y.jsx)(y.Fragment,{children:(0,y.jsx)("span",{onClick:function(){return j.message.error(u.formatMessage({id:"nav-modal-link-error",defaultMessage:"Sorry, this link is not working at the moment."}),5)},children:o})})},function(e){var t=M({},(function(e){if(null==e)throw TypeError("Cannot destructure "+e)}(e),e));return(0,y.jsx)(i9,C(C({},t),{},{basePath:P}))}),D=a.p+"static/cpg.css",B=a.p+"static/forever-oceans.css",W=a.p+"static/ks.css",R=a.p+"static/neutral.css",U=a.p+"static/ps.css",H=a.p+"static/ps-farmersselect.css",q=a.p+"static/test.css",G=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#95a3c3"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),V=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#a1d0a8"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#a1d0a8"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#92b4f2"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),Z=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#6eafdc"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),Y=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#cfe1E5"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),J=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#2e6194"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),$=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#2e6194"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]'),Q=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#4da8b2"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]');var K={cpg:{file:D,map:G,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/themes/cpg/icon-mapmarker-shadowed--gold--white.svg","mapMarkerPath":"/images/themes/cpg/icon-mapmarker-circle--black--white.svg","selectColor":"#C4A029","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttrn0hf0lqq17pgccdwdpg2"}')},"forever-oceans":{file:B,map:V,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/themes/forever-oceans/icon-mapmarker-shadowed.svg","mapMarkerPath":"/images/themes/forever-oceans/icon-mapmarker-circle.svg","selectColor":"#ff9000","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/cl2jbywb0008w14o6sg6bp6xz"}')},ks:{file:W,map:Z,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/themes/ks/icon-mapmarker-shadowed--orange--white.svg","mapMarkerPath":"/images/themes/ks/icon-mapmarker-circle--black--white.svg","selectColor":"#EE5A31","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttrgvwv0ltx17kf4mephpsa"}')},neutral:{file:R,map:Y,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/icon-mapmarker-shadowed.svg","mapMarkerPath":"/images/icon-mapmarker-circle.svg","selectColor":"#2D88AE","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttqs76z0kxw18pm8w426x68"}')},ps:{file:U,map:J,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/themes/ps/icon-mapmarker-shadowed--007bff--white.svg","mapMarkerPath":"/images/themes/ps/icon-mapmarker-circle--black--white.svg","selectColor":"#007BFF","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttrogi10m2618pj3xkwd557"}')},"ps-farmersselect":{file:H,map:$,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/themes/ps-farmersselect/icon-mapmarker-shadowed--228000--white.svg","mapMarkerPath":"/images/themes/ps-farmersselect/icon-mapmarker-circle--black--white.svg","selectColor":"#228000","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttrogi10m2618pj3xkwd557"}')},test:{file:q,map:Q,mapOptions:JSON.parse('{"mapMarkerSelectedPath":"/images/icon-mapmarker-shadowed--gold--white.svg","mapMarkerPath":"/images/icon-mapmarker-circle--black--white.svg","selectColor":"#007BFF","lineColor":"#201F22","lineWidth":4,"mapboxStyleUrl":"mapbox://styles/producersmarket/ckttqs76z0kxw18pm8w426x68"}')},none:void 0};function X(e){for(var t in e)K[t].file=e[t]}function ee(e){if(!(0>Object.keys(K).indexOf(e))&&"undefined"!=typeof document){var t=K[e].file,n=document.querySelector('link[href$="'.concat(t,'"]'));n||((n=document.createElement("link")).href=t,n.rel="stylesheet",n.type="text/css",document.getElementsByTagName("head")[0].appendChild(n))}}function et(e){var t=e;return 0>Object.keys(K).indexOf(e)&&(t="neutral"),K[t].mapOptions}function en(){return Object.keys(K)}var er=(0,c.createContext)(K.none);function eo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}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})(e)}function ea(e){var t=e.styles,n=e.children,r=e.owner,o=void 0===r?null:r,i=(0,c.useContext)(er);return c.Children.map(n,function(e){var n=o||(null!==(l=null==e||null===(s=e._owner)||void 0===s||null===(s=s.type)||void 0===s?void 0:s.name)&&void 0!==l?l:"unknownOwner"),r=null!==(u=null==e||null===(d=e.props)||void 0===d?void 0:d.className)&&void 0!==u?u:"",a=[];if(null===i||"string"==typeof e)return e;if(r.split(" ").forEach(function(e){if(""!==e.trim()){if(a.push(e),"object"===ei(t)){var r=!1;if(Object.keys(t).forEach(function(o){if(e===t[o]){var i="theme-".concat(n,"-").concat(o);a.push(i),r=!0}}),!r){var o="theme-".concat(n,"-").concat(""!=e?e:"undefined");a.push(o)}}else{var i="theme-".concat(n,"-").concat(e);a.push(i)}}}),!e)return null;var l,s,u,d,f,m=function(e){if(Array.isArray(e))return eo(e)}(f=new Set(a))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e,t){if(e){if("string"==typeof e)return eo(e,void 0);var n=({}).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)?eo(e,void 0):void 0}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return(0,c.cloneElement)(e,{className:m.join(" ")})})}let el={blockchainProofDetail:"blockChainProofDetail_blockchainProofDetail__us85x",descriptionsTable:"blockChainProofDetail_descriptionsTable__us85x",label:"blockChainProofDetail_label__us85x",value:"blockChainProofDetail_value__us85x",valueLink:"blockChainProofDetail_valueLink__us85x",imageLinkContainer:"blockChainProofDetail_imageLinkContainer__us85x",proofDetailImage:"blockChainProofDetail_proofDetailImage__us85x"};function es(e){return(es="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)}var ec=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-blockchain",defaultMessage:"blockchain"}),eu=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-blockchain-unknown",defaultMessage:"Unknown"}),ed=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-certificate",defaultMessage:"Certificate"}),ef=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-gps-location",defaultMessage:"GPS Location"}),em=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-location",defaultMessage:"Location"}),ep=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-facility-name",defaultMessage:"Facility Name"}),ey=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-facility-media",defaultMessage:"Facility Media"}),eh=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-ground-temperature",defaultMessage:"Ground Temperature"}),ev=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-media",defaultMessage:"Media"}),eg=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-object",defaultMessage:"Object"}),eb=function(e){var t=e.blockchainType,n=e.fields;return(0,y.jsx)(ea,{styles:el,owner:"BlockChainProofDetail",children:(0,y.jsx)(j.Descriptions,{bordered:!0,column:1,size:"small",className:el.descriptionsTable,children:n.map(function(e,n){return e.order<0?null:(0,y.jsx)(j.Descriptions.Item,{label:(0,y.jsx)(ea,{styles:el,owner:"BlockChainProofDetail",children:(0,y.jsx)("span",{className:el.label,children:e.name})}),children:(0,y.jsx)(ea,{styles:el,owner:"BlockChainProofDetail",children:(0,y.jsx)("span",{className:el.value,children:e.valueUrl?e.valueImage?(0,y.jsxs)("span",{className:el.imageLinkContainer,children:[(0,y.jsx)(F,{path:"/blockchain-info/".concat(t),children:(0,y.jsx)(f(),{src:e.valueImage,className:el.proofDetailImage,fill:!0,layout:"fill",style:{objectFit:"contain"},alt:"blockchain proof detail"})}),"\xa0"]}):(0,y.jsx)(ea,{styles:el,owner:"BlockChainProofDetail",children:(0,y.jsxs)("a",{className:el.valueLink,href:e.valueUrl,target:"_blank",rel:"noopener noreferrer",children:[e.value," \xbb"]})}):e.value})})},n)})})})};let ej=function(e){var t,n=e.locale,r=e.event,o=(0,v.useIntl)(),i=r.blockchainType,a=[{id:"blockchain",name:ec,value:i,valueImage:m.supportedBlockChains[i].logo,valueUrl:m.supportedBlockChains[i].homepage,order:0}],l=eu;return r.blockchainFields.forEach(function(e){"blockchainTxId"===e.name&&(l=e.value)}),r.blockchainFields.forEach(function(e){var t,s={id:e.name,name:e.name,order:10};if("object"===es(e.value)?s.value=eg:s.value=e.value,"string"==typeof e.value&&e.value.length>50&&"blockchainLink"!==e.name&&(s.value=e.value.substr(0,50),s.value=s.value.substr(0,Math.min(s.value.length,s.value.lastIndexOf(" "))),s.value+="..."),0===s.name.indexOf("timestamp")&&(s.name=s.name.indexOf("Start")>0?_.eventTypes.labelAsBeginning(r):_.eventTypes.labelAsEnd(r),b().locale(n),null===e.value&&(s.order=-1),s.value=b().utc(s.value).format("MM/DD/YY hh:mm")),"string"==typeof s.name&&s.name.indexOf("Detail")>0&&Array.isArray(e.value)&&(s.value=e.value.join(", ")),"facility"===s.name&&(s.name=[],s.value=[],"object"===es(e.value)&&("string"==typeof e.value.name&&(s.name.push(ep),s.value.push(e.value.name)),"object"===es(e.value.location)&&(s.name.push(em),s.value.push(ef)),Array.isArray(e.value.media)&&(s.name.push(ey),s.value.push((t=e.value.media.length,(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-facility-media-label",defaultMessage:"{count, plural, one {# Media-item} other {# Media-items}}",values:{count:t}}))))),s.order=20),"certificates"===s.name&&(s.name=[],s.value=[],s.valueUrl=[],"object"===es(e.value)&&Array.isArray(e.value)&&e.value.forEach(function(e){s.name.push(ed),s.value.push(e.name),s.valueUrl.push(e.url)}),s.order=20),"media"===s.name&&(s.name=[],s.value=[],s.valueUrl=[],"object"===es(e.value)&&Array.isArray(e.value)&&e.value.forEach(function(e){s.name.push(ev),s.value.push(e.caption),s.valueUrl.push(e.url)}),s.order=20),"blockchainLink"===s.id&&(s.name=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-label-blockchain-link",defaultMessage:"{blockchainType} block record number",values:{blockchainType:i}}),s.valueUrl=s.value,s.value=l,s.order=99),"string"==typeof s.name&&s.name.endsWith("Distance")>0&&(s.value=o.formatNumber(s.value,{style:"unit",unit:"kilometer",unitDisplay:"narrow"})),"crewWages"===s.name&&(s.value=o.formatNumber(s.value,{style:"currency",currency:"USD"})),"fuelConsumption"===s.name&&(s.value=o.formatNumber(s.value,{style:"unit",unit:"liter",unitDisplay:"narrow"})),"humidity"===s.name&&(s.value=o.formatNumber(s.value,{style:"unit",unit:"percent",unitDisplay:"narrow"})),"machineHours"===s.name&&(s.value=o.formatNumber(s.value,{style:"unit",unit:"hour",unitDisplay:"narrow"})),"temperatureGround"===s.name&&(s.value=o.formatNumber(s.value,{style:"unit",unit:"degree",unitDisplay:"narrow"})+"C"),"temperatureGround"===s.name&&(s.name=eh),"blockchainTxId"!==s.id&&"blockchainId"!==s.id&&"blockchainHomepage"!==s.id){if(Array.isArray(s.name)&&Array.isArray(s.value)&&s.name.length===s.value.length)for(var c=0;c<s.name.length;c++){var u={id:s.name[c]+c,name:s.name[c],order:s.order[c],value:s.value[c]};Array.isArray(s.valueUrl)&&s.valueUrl.length===s.name.length&&(u.valueUrl=s.valueUrl[c]),a.push(u)}else a.push(s)}}),a.forEach(function(e){"timestampStart"===e.id&&(t=e.value),"timestampEnd"===e.id&&e.value===t&&(e.order=-1)}),a.sort(function(e,t){return e.order-t.order}),(0,y.jsx)("div",{className:el.blockchainProofDetail,children:(0,y.jsx)(eb,{fields:a,blockchainType:i})})},e_=n(97218);var ew=a.n(e_),ex="G-08S5LV39CQ",eS=["function gtag(){","  window.dataLayer.push(arguments);","};","window.dataLayer = window.dataLayer||[];",'gtag("js",new Date);','if(location.href.indexOf("/embed/")>=0){','  gtag("config", "'.concat(ex,'")'),"} else {",'  gtag("config", "'.concat(ex,'", {send_page_view:false})'),"}"].join(""),eO=['window["ga-disable-'.concat(ex,'"] = true;'),"var _gaq = _gaq || [];",'_gaq.push(["_setAccount", "'.concat(ex,'"]);'),'_gaq.push(["_trackPageview"]);'].join(""),ek=function(e,t){ex&&window.gtag("config",ex,{page_path:e,referrer:null==t?void 0:t.referrer})},eC=function(e,t,n,r){ex&&window.gtag("event",e,{event_category:t||void 0,event_label:n||void 0,value:r||void 0})},eM=function(){window["ga-disable-".concat(ex)]=!1,Array.isArray(window._gaq)||(window._gaq=[]),window._gaq.push(["_trackPageview"])},eP=function(){return ex?(0,y.jsxs)(c.Fragment,{children:[(0,y.jsx)("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=".concat(ex)}),(0,y.jsx)("script",{dangerouslySetInnerHTML:{__html:"".concat(eS,";").concat(eO)}})]}):null};let eI=n(36808);function eN(e){return(eN="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)}var eT="feedbackGiven",eL="cookiesAllowed";let eE=new(i8=function e(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e)},i4=[{key:"setFeedbackGiven",value:function(e,t){this.hasCookiesAllowed()&&eI.set(eT,e,{path:t})}},{key:"setCookiesAllowed",value:function(){eI.set(eL,"true",{expires:365})}},{key:"hasFeedbackGiven",value:function(){return"true"===eI.get(eT)}},{key:"hasCookiesAllowed",value:function(){return"true"===eI.get(eL)}}],function(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,function(e){var t=function(e,t){if("object"!=eN(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eN(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eN(t)?t:t+""}(r.key),r)}}(i8.prototype,i4),Object.defineProperty(i8,"prototype",{writable:!1}),i8);function ez(e){return(ez="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)}function eA(){return"object"===("undefined"==typeof location?"undefined":ez(location))&&"string"==typeof location.href&&location.href.indexOf("/embed/")>=0||eE.hasCookiesAllowed()}function eF(){return true}function eD(e,t){if((arguments.length>2&&void 0!==arguments[2]&&arguments[2]||void 0===eD.steps)&&(eD.steps=Array(e).fill(null),eD.isComplete=!1),!eD.isComplete&&null!==t&&!eD.steps[t]){if(eD.steps[t]=Date.now(),t>0){var n=eD.steps[t]-eD.steps[t-1];eB("Completed Product Origin Step",{category:"Engagement",label:"Product Origin Step ".concat(t," / ").concat(e),value:n})}e-1===t&&(eD.isComplete=!0,eB("Completed All Product Origin Steps",{category:"Engagement",label:"Time to complete all steps",value:Date.now()-eD.steps[0]}))}}function eB(e,t){eA()&&(eC(e,t.category,t.label,"number"==typeof t.value?t.value:void 0),eR(e,t))}function eW(e,t){var n=t.value,r=t.referrer;eA()&&(ek(n,r?{referrer:r}:null),eR(e,t))}function eR(e,t){eA()&&ew().post("/api/analytics/track",{event:e,metadata:t}).catch(function(e){console.warn(e)})}let eU=eB;function eH(e){return(eH="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)}var eq=["children"];function eG(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 eV(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eG(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=eH(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eH(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==eH(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let eZ=function(e){var t=e.children,n=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,eq);return(0,y.jsx)("a",eV(eV({target:"_blank",rel:"noopener noreferrer"},n),{},{children:t}))},eY={buyAction:"buyAction_buyAction__66p8e",buyAction__inner:"buyAction_buyAction__inner__66p8e",buyAction__outer:"buyAction_buyAction__outer__66p8e",buttonRow:"buyAction_buttonRow__66p8e",buttonBuy:"buyAction_buttonBuy__66p8e"},eJ=function(e){var t=e.buyActionLink,n=e.buyActionLabel,r=(0,c.useMemo)(function(){return(0,y.jsx)(j.Button,{className:"".concat(eY.buttonBuy),children:(0,y.jsx)(eZ,{href:t,onClick:function(){eU("Clicked buyActionLink",{category:"Engagement",label:"StoryBird Buy Action"})},children:"string"==typeof n&&n.length?n:(0,y.jsx)(v.FormattedMessage,{id:"misc.buyaction.buy",defaultMessage:"Buy Product"})})})},[n,t]);return(0,y.jsx)(ea,{styles:eY,owner:"BuyAction",children:(0,y.jsx)("div",{className:eY.buyAction,children:(0,y.jsx)("div",{className:eY.buyAction__outer,children:(0,y.jsx)("div",{className:eY.buyAction__inner,children:(0,y.jsx)("div",{className:"container ".concat(eY.buttonRow),children:r})})})})})};var e$=[{key:"belowMobile",upperLimit:480},{key:"mobile",upperLimit:576},{key:"mobileLandscape",upperLimit:768},{key:"tablet",upperLimit:992},{key:"desktop",upperLimit:1200},{key:"wide",upperLimit:1600}];let eQ=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e$,t={};return e.forEach(function(n,r){var o="".concat(n.key.charAt(0).toUpperCase()).concat(n.key.slice(1));t["is".concat(o)]=function(t){var o,i,a=t.width;return a>(null!==(o=null===(i=e[r-1])||void 0===i?void 0:i.upperLimit)&&void 0!==o?o:0)&&a<=n.upperLimit},t["from".concat(o)]=function(t){var n,o;return t.width>(null!==(n=null===(o=e[r-1])||void 0===o?void 0:o.upperLimit)&&void 0!==n?n:0)},t["until".concat(o)]=function(e){return e<=n.upperLimit}}),t.fromTabletWithoutMobileLandscape=function(e){var t=e.width,n=e.height,r=e.portrait;return t>=768&&r||t>=809&&!r&&n>=415&&!r},t.fromTablet=function(e){var t=e.width,n=e.height,r=e.portrait;return r&&t>=768&&n>=992||!r&&t>=809&&n>=768},t.fromMediumSizeEmbed=function(e){var t=e.width,n=e.height;return e.portrait,t>824&&n>540},t.fromSmallSizeEmbed=function(e){var t=e.width,n=e.height;return e.portrait,t>=660&&n>320},t}();function eK(e){return(eK="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)}function eX(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 e0(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=e1(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function e1(e){var t=function(e,t){if("object"!=eK(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=eK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eK(t)?t:t+""}function e2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(e2=function(){return!!e})()}function e5(e){return(e5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e8(e,t){return(e8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}let e4=function(e){return function(t){var n;function r(e){var t,n,o;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),(n=r,o=[e],n=e5(n),t=function(e,t){if(t&&("object"==eK(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e2()?Reflect.construct(n,o||[],e5(this).constructor):n.apply(this,o))).state={windowWidth:500,windowHeight:500,ssrSize:!0},t.setWindowSizes=t.setWindowSizes.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&e8(e,t)}(r,t),n=[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.setWindowSizes,{passive:!0}),this.setWindowSizes()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.setWindowSizes)}},{key:"setWindowSizes",value:function(){this.setState({windowWidth:window.innerWidth,windowHeight:window.innerHeight,ssrSize:!1})}},{key:"render",value:function(){var t=this.state,n=t.windowWidth,r=t.windowHeight,o=t.ssrSize;return(0,y.jsx)(e,e0(e0({},this.props),{},{ssrSize:o,windowWidth:n,windowHeight:r,landscape:n>=r,portrait:n<r}))}}],function(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,e1(r.key),r)}}(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(c.Component)},e3={container:"cookieWarning_container__4nw2y",cookieWarning:"cookieWarning_cookieWarning__4nw2y",cookieWarning__inner:"cookieWarning_cookieWarning__inner__4nw2y",cookieWarning__innerMessage:"cookieWarning_cookieWarning__innerMessage__4nw2y",cookieWarning__outer:"cookieWarning_cookieWarning__outer__4nw2y",buttonRow:"cookieWarning_buttonRow__4nw2y",messageRow:"cookieWarning_messageRow__4nw2y",buttonAccept:"cookieWarning_buttonAccept__4nw2y",buttonReject:"cookieWarning_buttonReject__4nw2y"};function e6(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var e9=eQ.fromDesktop,e7=function(e){return(0,y.jsx)(j.Button,{className:e3.buttonAccept,onClick:function(){var t,n;t=e.appName,n=e.state,eE.setCookiesAllowed(),eM(),eU("Clicked Accept Cookies",{category:"Engagement",label:"".concat(t," Cookie Warning")}),n.setCookieWarning(!1)},children:(0,y.jsx)(v.FormattedMessage,{id:"misc.phrases.accept_cookies",defaultMessage:"Accept Cookies"})})},te=function(e){return(0,y.jsx)(j.Button,{className:e3.buttonReject,onClick:function(){var t,n;t=e.appName,n=e.state,eU("Clicked Reject Cookies",{category:"Engagement",label:"".concat(t," Cookie Warning")}),n.setCookieWarning(!1)},children:(0,y.jsx)(v.FormattedMessage,{id:"misc.phrases.reject_cookies",defaultMessage:"Reject Cookies"})})};let tt=e4(function(e){var t,n=e.appName,r=void 0===n?"StoryBird":n,o=e.windowWidth,i=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return e6(e,2);var n=({}).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)?e6(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],s={setCookieWarning:l},u=(0,S.useRouter)(),d=e9({width:o}),f=(0,c.useMemo)(function(){return(0,y.jsx)("span",{className:e3.cookieWarning__innerMessage,children:(0,y.jsx)(v.FormattedMessage,{id:"misc.phrases.cookie_warning",description:"Cookie warning visible on all pages",defaultMessage:"To provide you with a great user experience, this site uses cookies. By using {appName} you accept our <cookie_link>Cookie Policy</cookie_link>.",values:{appName:r,cookie_link:function(e){return(0,y.jsx)(x(),{href:"/privacy#cookie-policy",onClick:function(){eU("Clicked Cookie policy",{category:"Engagement",label:"".concat(r," Cookie Warning")})},scroll:!1,legacyBehavior:!0,children:(0,y.jsx)("a",{target:"",children:e})})}}})})},[r]);return(0,c.useEffect)(function(){eE.hasCookiesAllowed()||u.pathname.includes("/embed/")||u.pathname.includes("/preview")?eM():u.pathname.includes("/admin")||l(!0)},[]),a?(0,y.jsx)(ea,{styles:e3,owner:"CookieWarning",children:(0,y.jsx)("div",{className:e3.cookieWarning,children:(0,y.jsx)("div",{className:e3.cookieWarning__outer,children:(0,y.jsx)("div",{className:e3.cookieWarning__inner,children:d?(0,y.jsxs)(j.Row,{className:"".concat(e3.messageRow," ").concat(e3.container),children:[(0,y.jsx)(j.Col,{span:14,children:f}),(0,y.jsx)(j.Col,{span:10,children:(0,y.jsx)(j.Row,{className:e3.buttonRow,children:(0,y.jsxs)(j.Col,{span:24,children:[e7({appName:r,state:s}),te({appName:r,state:s})]})})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(j.Row,{className:e3.messageRow,children:(0,y.jsx)(j.Col,{span:24,children:f})}),(0,y.jsx)(j.Row,{className:e3.buttonRow,children:(0,y.jsxs)(j.Col,{span:24,children:[e7({appName:r,state:s}),te({appName:r,state:s})]})})]})})})})}):null}),tn=n(12918);var tr=a.n(tn);let to=n(80129);var ti=a.n(to),ta=a(629);let tl="languageSwitcher_iconEarth__rrsnb";function ts(e){return function(e){if(Array.isArray(e))return tu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||tc(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tc(e,t){if(e){if("string"==typeof e)return tu(e,t);var n=({}).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)?tu(e,t):void 0}}function tu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var td=function(e,t){var n=location.href.split("?"),r=n[0],o={};try{o=ti().parse(n[1])}catch(e){}o.lang=t;var i=r+"?"+ti().stringify(o);e.push(i)};let tf=function(e){var t,n=e.availableLanguages,r=(0,v.useIntl)(),o=(0,S.useRouter)(),i=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(null))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||tc(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],s=(0,c.useMemo)(function(){return Array.isArray(n)?function(e,t){var n=[];if(!Array.isArray(e)||0===e.length||"function"!=typeof(null==t?void 0:t.formatDisplayName))return n;for(var r in e)(function(){var o=e[r];if("string"==typeof o){var i=o.split(/-/)[0],a=e.filter(function(e){return 0===e.indexOf(i)}).length>1,l=t.formatDisplayName(o,{type:"language",style:"short"});if("string"==typeof l&&""!==l||(l=o),a||(l=l.replace(/ \([^)]+\)/,"")),o===t.locale)return n.push({value:o,label:l});try{var s=new Intl.DisplayNames([o],{type:"language",style:"short"}).of(o);a||(s=s.replace(/ \([^)]+\)/,"")),n.push({value:o,label:"".concat(l," (").concat(s,")")})}catch(e){return n.push({value:o,label:"".concat(l," (").concat(o,")")}),0}}})();return n.sort(function(e,t){return e.label>t.label?1:-1}),n}(ts(new Set(ts(n))),r):[]},[n,r.locale]),u=(0,c.useMemo)(function(){return s.map(function(e,t){return(0,y.jsx)(j.Select.Option,{value:e.value,children:e.label},t)})},[s]),d=(0,c.useMemo)(function(){return s.map(function(e,t){return(0,y.jsx)(j.Menu.Item,{onClick:function(){return td(o,e.value)},children:e.label},e.value)})},[s]),f=(0,c.useMemo)(function(){return Array.isArray(n)&&0!==n.length?n.includes(r.locale)?r.locale:n[0]:ta.fallbackLocale},[n]);return!Array.isArray(n)||n.length<2?null:(0,y.jsxs)("div",{className:"languageSwitcher_languageSwitcher__rrsnb",children:[(0,y.jsx)(j.Dropdown,{className:"languageSwitcher_dropdown__rrsnb",overlay:(0,y.jsx)(j.Menu,{children:d}),children:(0,y.jsx)("i",{className:tl})},"list-view"),(0,y.jsxs)("div",{className:"languageSwitcher_selectWrapper__rrsnb",children:[(0,y.jsx)("i",{className:tl}),(0,y.jsx)(j.Select,{className:"languageSwitcher_select__rrsnb",popupClassName:"languageSwitcher_selectMenu__rrsnb",defaultValue:f,value:null!=a?a:f,onChange:function(e){l(e),td(o,e)},dropdownMatchSelectWidth:!1,bordered:!1,dropdownAlign:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:0}},children:u})]})]})},tm=function(e){var t=e.withBuyAction,n=e.availableLanguages,r=e.termsLinkDisabled,o=e.privacyLinkDisabled,i=(0,v.useIntl)();return(0,y.jsx)("footer",{className:"footer ".concat("footerSection_footer__bazzz"," ").concat(void 0!==t&&t?"footerSection_withBuyAction__bazzz":""),children:(0,y.jsx)("div",{className:"containerWrapper footerSection_containerWrapper__bazzz",children:(0,y.jsx)("div",{className:"container footerSection_container__bazzz",children:(0,y.jsxs)("div",{className:"footerSection_footerLinkRow__bazzz",children:[(0,y.jsx)("div",{className:"footerSection_languageSwitcher__bazzz",children:(0,y.jsx)(tf,{availableLanguages:n})}),(0,y.jsxs)("div",{className:"footerSection_legalContainer__bazzz",children:[(0,y.jsxs)("div",{className:"footerSection_copyright__bazzz",children:[(0,y.jsx)(v.FormattedMessage,{id:"footer-copyright-year",defaultMessage:"\xa9 {year}",values:{year:(new Date).getFullYear()}})," ",(0,y.jsx)("a",{className:"footerSection_footerLink__bazzz",href:"https://producerstrust.com",rel:"roopener noreferrer",title:"",target:"_blank",children:(0,y.jsx)(v.FormattedMessage,{id:"footer-company-producers-trust",defaultMessage:"Producers Trust"})})]}),(0,y.jsxs)("div",{className:"footerSection_termsAndPolicy__bazzz",children:[(0,y.jsx)("span",{className:"footerSection_terms__bazzz",children:r?(0,y.jsx)(v.FormattedMessage,{id:"footer-terms-of-service",defaultMessage:"Terms of Use"}):(0,y.jsx)(x(),{href:"/terms",rel:"roopener noreferrer",target:"",children:i.formatMessage({id:"footer-terms-of-service",defaultMessage:"Terms of Use"})})}),(0,y.jsx)("span",{className:"footerSection_termsAndPolicySeperator__bazzz",children:" | "}),(0,y.jsx)("span",{className:"footerSection_policy__bazzz",children:o?i.formatMessage({id:"footer-privacy-policy",defaultMessage:"Privacy Policy"}):(0,y.jsx)(x(),{href:"/privacy",rel:"roopener noreferrer",target:"",children:i.formatMessage({id:"footer-privacy-policy",defaultMessage:"Privacy Policy"})})})]})]})]})})})})},tp={header:"headerSection_header__nsxbk",containerWrapper:"headerSection_containerWrapper__nsxbk",pageScrolled:"headerSection_pageScrolled__nsxbk",content:"headerSection_content__nsxbk",logo:"headerSection_logo__nsxbk",storyNavLinksListWrapper:"headerSection_storyNavLinksListWrapper__nsxbk",storyNavLinksList:"headerSection_storyNavLinksList__nsxbk",storyNavLinksListItem:"headerSection_storyNavLinksListItem__nsxbk",storyNavLink:"headerSection_storyNavLink__nsxbk",current:"headerSection_current__nsxbk",navbarShow:"headerSection_navbarShow__nsxbk",navbarToggler:"headerSection_navbarToggler__nsxbk",line:"headerSection_line__nsxbk"};function ty(e){return(ty="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)}function th(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 tv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?th(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=ty(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ty(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ty(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):th(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let tg=function(e){var t=e.name,n=e.href,r=e.title,o=e.target,i=(0,S.useRouter)();return(0,y.jsx)(x(),{href:n,legacyBehavior:!0,children:(0,y.jsx)("a",tv(tv({className:"".concat(tp.storyNavLink," ").concat(i.pathname===n.slice(1)?tp.current:""),title:r,target:o},"_blank"==o?'rel="noopener noreferrer"':null),{},{children:t}))})};function tb(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tj(e,t);var n=({}).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)?tj(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let t_=function(e){var t=(0,S.useRouter)(),n=tb((0,c.useState)(!1),2),r=n[0],o=n[1];(0,c.useEffect)(function(){window.addEventListener("scroll",function(){o(window.scrollY>50)})},[]);var i=tb((0,c.useState)(!1),2),a=i[0],l=i[1];return(0,y.jsx)("header",{className:"".concat(tp.header," ").concat(r?tp.pageScrolled:""," ").concat(a?tp.navbarShow:""),children:(0,y.jsx)("div",{className:"containerWrapper "+tp.containerWrapper,children:(0,y.jsx)("div",{className:"container "+tp.container,children:(0,y.jsxs)("div",{className:tp.content,children:[e.linkToHome?(0,y.jsx)(x(),{href:"/",legacyBehavior:!0,children:(0,y.jsx)("a",{children:(0,y.jsx)("div",{className:tp.logo})})}):(0,y.jsx)("div",{className:tp.logo}),(0,y.jsx)("div",{className:tp.storyNavLinksListWrapper,children:(0,y.jsxs)("ul",{className:tp.storyNavLinksList,children:[(0,y.jsx)("li",{className:tp.storyNavLinksListItem,children:(0,y.jsx)(tg,{target:"",name:"Packages",href:"/packages",title:""})}),(0,y.jsx)("li",{className:tp.storyNavLinksListItem,children:(0,y.jsx)("a",{onClick:function(){var e;return e=document.getElementById("contact"),void(eU("Header clicked contact us",{category:"Navigation",label:"Main menu"}),e?e.scrollIntoView({behavior:"smooth"}):t.push("/#contact"))},className:tp.storyNavLink,title:"Contact Us",children:"contact us"})}),(0,y.jsx)("li",{className:tp.storyNavLinksListItem,children:(0,y.jsx)("a",{href:"https://producersmarket.com",className:tp.storyNavLink,title:"Producers Market",target:"_blank",rel:"noopener noreferrer",onClick:function(){eU("Clicked producers link",{category:"Navigation",label:"Main menu"})},children:"producers"})})]})}),(0,y.jsx)("div",{className:tp.navbarTogglerWrapper,children:(0,y.jsxs)("button",{className:tp.navbarToggler,type:"button",onClick:function(){l(function(e){return!e})},children:[(0,y.jsx)("span",{className:tp.line}),(0,y.jsx)("span",{className:tp.line}),(0,y.jsx)("span",{className:tp.line})]})})]})})})})},tw=n(9008);var tx=a.n(tw);let tS=n(2962);var tO=a(704),tk=a.n(tO);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})(e)}function tM(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}let tP=function(e){var t,n,r,o,i,a,l,s,c,u,d,f;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(tx(),{children:(0,y.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"})}),(0,y.jsx)(tS.NextSeo,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tM(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==tC(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},(t=e.description,n=e.imageUrl,r=e.title,a=(i=void 0===(o=e.isMarketplace)||o?tO.marketplace:{}).brandName,l=i.defaultMetaDescription,s=i.location,c={openGraph:{}},u=r?"".concat(r," - ").concat(a):a,d=l,f=s+"/images/common/default-thumbnail.png",t&&(d=t.length>300?t.substring(0,300)+"...":t),n&&(f=n.startsWith("https")?n:s+n),c.title=u,c.openGraph.title=u,c.description=d,c.openGraph.description=d,c.openGraph.images=[{url:f}],c)))]})};function tI(e){var t=e.handleClose,n=void 0===t?function(){}:t,r=e.modalContext,o=e.showModal,i=(0,v.useIntl)(),a=(0,c.useMemo)(function(){var e,t,n,o,a=!!(null==r||null===(e=r.organization)||void 0===e?void 0:e.name),l=!!(null==r||null===(t=r.product)||void 0===t?void 0:t.name),s=a||l?i.formatMessage({id:"intercom-fallback-modal-email-subject",defaultMessage:"Trade Facilitation"}):"",c=i.formatMessage({id:"intercom-fallback-modal-email-content-organization",defaultMessage:"I would like to inquire about purchasing products from {organizationName}"},{organizationName:null==r||null===(n=r.organization)||void 0===n?void 0:n.name}),u=i.formatMessage({id:"intercom-fallback-modal-email-content-product",defaultMessage:"I would like to inquire about purchasing {productName}"},{productName:null==r||null===(o=r.product)||void 0===o?void 0:o.name});return"mailto:".concat(tO.marketplace.tradeFacilitationEmail,"?subject=").concat(s,"&body=").concat(a?c:l?u:"")},[i,r]);return(0,y.jsxs)(j.Modal,{open:void 0!==o&&o,centered:!0,footer:null,closable:!1,onCancel:n,width:"100%",height:"50%",className:"intercomFallbackModal_modal__1fv3z",children:[(0,y.jsx)("i",{className:"intercomFallbackModal_modalClose__1fv3z",onClick:n}),(0,y.jsxs)("div",{className:"intercomFallbackModal_modalContent__1fv3z",children:[(0,y.jsx)("h3",{children:(0,y.jsx)(v.FormattedMessage,{id:"intercom-fallback-modal-title",defaultMessage:"Oops! It looks like our live chat is unavailable."})}),(0,y.jsx)("p",{children:(0,y.jsx)(v.FormattedMessage,{id:"intercom-fallback-modal-content",defaultMessage:"We're sorry for the inconvenience. It seems our live chat feature is currently unavailable on this page. Please reach out to us directly for assistance with your request."})}),(0,y.jsx)("div",{className:"intercomFallbackModal_buttonWrapper__1fv3z",children:(0,y.jsx)(j.Button,{className:"intercomFallbackModal_button__1fv3z",children:(0,y.jsxs)("a",{id:"mailtoLink",href:a,children:[(0,y.jsx)(v.FormattedMessage,{id:"intercom-fallback-modal-link",defaultMessage:"Contact Us"}),(0,y.jsx)("i",{className:"intercomFallbackModal_icon__1fv3z"})]})})})]})]})}function tN(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tT(e,t);var n=({}).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)?tT(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var tL=function(e){var t=tO.intercomAppId;window.intercomSettings={app_id:t},e&&(window.intercomSettings.viewUuid=e),function(){var e=window,n=e.Intercom;if("function"==typeof n)n("reattach_activator"),n("update",e.intercomSettings);else{var r=document,o=function e(){e.c(arguments)};o.q=[],o.c=function(e){o.q.push(e)},e.Intercom=o;var i=function(){var e=r.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/"+t;var n=r.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};"complete"===document.readyState?i():e.attachEvent?e.attachEvent("onload",i):e.addEventListener("load",i,!1)}}()},tE=function(e){var t,n,r,o,i,a,l,s,c,u=e.intl,d=e.organization,f=e.product,m=(c={organization:d,product:f}).organization||c.product?"wholesale-inquiry":"",p=(n=(t={intl:u,organization:d,product:f}).intl,r=t.organization,o=t.product,r?n.formatMessage({id:"intercom-inquire-organization",defaultMessage:"I would like to inquire about purchasing products from {organizationName}"},{organizationName:r.name}):o?n.formatMessage({id:"intercom-inquire-product",defaultMessage:"I would like to inquire about purchasing {productName}"},{productName:o.name}):""),y=(l=(i={organization:d,product:f}).organization,{product:null!==(a=null==(s=i.product)?void 0:s.name)&&void 0!==a?a:"No name available",link:window.location.href,orgLink:l?window.location.href:void 0,orgName:null==l?void 0:l.name,orgUuid:null==l?void 0:l.id,productLink:s?window.location.href:void 0,productName:null==s?void 0:s.name,productUuid:null==s?void 0:s.id});window.Intercom("trackEvent",m,y),window.Intercom("showNewMessage",p)},tz=(0,c.createContext)({});function tA(e){var t=e.children,n=e.enableIntercom,r=void 0!==n&&n,o=e.viewUuid,i=(0,v.useIntl)(),a=tN((0,c.useState)(!1),2),l=a[0],s=a[1],u=tN((0,c.useState)(!1),2),d=u[0],f=u[1],m=tN((0,c.useState)(null),2),p=m[0],h=m[1];(0,c.useEffect)(function(){r&&tO.intercomAppId?(tL(o),"function"==typeof window.Intercom&&window.Intercom("onUnreadCountChange",function(){s(!0)})):console.warn("Intercom disabled, not loaded")},[o]);var g=(0,c.useCallback)(function(e){var t,n=e.organization,o=e.product;if(!r||!tO.intercomAppId||"function"!=typeof window.Intercom||!l)return console.warn("Intercom disabled, show fallback modal"),f(!0),void h({organization:n,product:o});null!==(t=document)&&void 0!==t&&t.getElementById("requestTradeFacilitation")||tE({intl:i,organization:n,product:o})},[r,l,i]),b=(0,c.useMemo)(function(){return{handle:g,enabled:r}},[g,r]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(tz.Provider,{value:b,children:t}),(0,y.jsx)(tI,{handleClose:function(){return f(!1)},modalContext:p,showModal:d})]})}var tF=function(){return(0,c.useContext)(tz)};let tD=n(81903);function tB(e){return(tB="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)}function tW(){tW=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==tB(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(tB(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function tR(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var tU=function(e){var t=e.children;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(t_,{linkToHome:!0}),t,(0,y.jsx)(tm,{})]})},tH=function(e){var t=e.appName,n=void 0===t?"Marketplace":t,r=e.statusCode,o=e.hasGetInitialPropsRun,i=e.err,a=e.customPanelStyle,l=e.appWrapper,s=void 0===l?tU:l,u=tF(),d=(0,c.useCallback)(function(){u.handle({})},[u]),m=(0,v.useIntl)(),p=(0,c.useMemo)(function(){return"Marketplace"===n},[n]),h=(0,c.useMemo)(function(){var e,t;return t=(e={intl:m,isMarketplace:p,statusCode:r}).statusCode,e.isMarketplace?e.intl.formatMessage({id:"pages-404-marketplace-title",description:"404 page title",defaultMessage:"Oops! Page not found"}):404!==t?"StoryBird - Error ".concat(t):"StoryBird - 404 Page not found."},[m,p,r]);return!o&&i&&404!==(null==i?void 0:i.code)&&tD.captureException(i),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(tP,{isMarketplace:p,title:h}),(0,y.jsx)(s,{children:(0,y.jsx)("div",{className:"_error_errorWrapper__se8ak",children:404!==r?(0,y.jsx)("section",{className:"_error_error__se8ak",children:(0,y.jsx)(j.Result,{icon:(0,y.jsx)("img",{src:"/images/icon-error--gold--white.svg",alt:"Error"}),status:"error",title:m.formatMessage({id:"pages.error.thats_an_error",defaultMessage:"Whoops That's an error."}),children:null!=i&&i.message?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(j.Collapse,{bordered:!1,defaultActiveKey:[1],expandIcon:function(e){return e.isActive?(0,y.jsx)("img",{src:"/images/icon-minus-button--square.svg",alt:"Hide log",style:{width:"16px"}}):(0,y.jsx)("img",{src:"/images/icon-plus-button--square.svg",alt:"Show log",style:{width:"16px"}})},children:(0,y.jsx)(j.Collapse.Panel,{header:m.formatMessage({id:"pages.error.show_log_btn",defaultMessage:"See what our logs say"}),style:a,children:(0,y.jsx)("code",{children:i.message})},"1")}),(0,y.jsx)("p",{children:m.formatMessage({id:"pages.error.support_us_by_feedback",defaultMessage:"You can help us make our app better by reporting what you were doing when this error occurred below."})}),(0,y.jsx)("button",{className:"pmt pmt__btn pmt__btn--gold",onClick:d,children:m.formatMessage({id:"pages.error.feedback_btn",defaultMessage:"Send us feedback"})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("p",{children:(0,y.jsx)("em",{children:m.formatMessage({id:"pages.error.default_error",defaultMessage:"Something went wrong"})})}),(0,y.jsx)("p",{children:m.formatMessage({id:"pages.error.fallback_error_msg",defaultMessage:"Please try again or contact support on info@producersmarket.com"})})]})})}):(0,y.jsxs)("section",{className:"_error_notFound__se8ak",children:[(0,y.jsx)(f(),{alt:"404",className:"_error_notFoundImage__se8ak",height:289,width:737,src:"/images/image-404.png",style:{objectFit:"contain"}}),(0,y.jsx)("h1",{className:"_error_title__se8ak",children:(0,y.jsx)(v.FormattedMessage,{id:"page-404--title",description:"404 page title",defaultMessage:"Oops! Page not found."})}),(0,y.jsx)("p",{className:"_error_body__se8ak",children:(0,y.jsx)(v.FormattedMessage,{id:"page-404--body",description:"404 page body",defaultMessage:"The page you are looking for might have been temporarily removed or had its name changed."})})]})})})]})};tH.getInitialProps=(i3=tW().mark(function e(t){var n,r,o,i;return tW().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.res,r=t.err,o=t.asPath,e.next=3,tr().getInitialProps({res:n,err:r});case 3:if((i=e.sent).hasGetInitialPropsRun=!0,404!==(null==n?void 0:n.statusCode)){e.next=7;break}return e.abrupt("return",{statusCode:404});case 7:if(!r){e.next=13;break}return i.err,tD.captureException(r),e.next=12,tD.flush(2e3);case 12:case 23:return e.abrupt("return",i);case 13:e.t0=n.statusCode,e.next=400===e.t0?16:405===e.t0?17:412===e.t0?18:19;break;case 16:return e.abrupt("return",{statusCode:404});case 17:return e.abrupt("return",{statusCode:405});case 18:return e.abrupt("return",{statusCode:412});case 19:return e.abrupt("break",20);case 20:return tD.captureException(Error("_error.js getInitialProps missing data at path: ".concat(o))),e.next=23,tD.flush(2e3);case 24:case"end":return e.stop()}},e)}),i6=function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i3.apply(e,t);function i(e){tR(o,n,r,i,a,"next",e)}function a(e){tR(o,n,r,i,a,"throw",e)}i(void 0)})},function(e){return i6.apply(this,arguments)}),tH.defaultProps={customPanelStyle:{background:"none",border:0,overflow:"hidden"}};let tq=tH,tG={accordionWrapper:"accordion_accordionWrapper__ve4b1",carret:"accordion_carret__ve4b1",carretOpen:"accordion_carretOpen__ve4b1",carretClose:"accordion_carretClose__ve4b1"};var tV=j.Collapse.Panel,tZ=function(e){var t=e.isActive;return(0,y.jsx)(ea,{styles:tG,owner:"Accordion",children:(0,y.jsx)("i",{className:"".concat(tG.carret," ").concat(t?tG.carretOpen:tG.carretClose," ant-collapse-arrow")})})};let tY=function(e){var t=e.children,n=void 0===t?(0,y.jsx)(tV,{title:"Example title",children:(0,y.jsx)("p",{children:"Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum"})},"1"):t,r=e.defaultOpenPanels,o=e.onChange;return(0,y.jsx)(ea,{styles:tG,owner:"Accordion",children:(0,y.jsx)("div",{className:tG.accordionWrapper,children:(0,y.jsx)(j.Collapse,{defaultActiveKey:void 0===r?[1]:r,onChange:function(e){return"function"==typeof o?o(e):void 0},expandIcon:function(e){var t=e.isActive;return(0,y.jsx)(tZ,{isActive:t})},expandIconPosition:"end",children:n})})})};var tJ=a(290);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})(e)}function tQ(){tQ=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==t$(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(t$(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function tK(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function tX(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){tK(i,r,o,a,l,"next",e)}function l(e){tK(i,r,o,a,l,"throw",e)}a(void 0)})}}var t0="https://storybird.io:443/api",t1="".concat(t0,"/view"),t2="".concat(t0,"/enums");function t5(){return(t5=tX(tQ().mark(function e(t,n){var r,o;return tQ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r="".concat(t1,"/").concat(t),e.next=3,(0,tJ.getAPI)(r,n);case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function t8(){return(t8=tX(tQ().mark(function e(t){var n;return tQ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(t2),e.abrupt("return",(0,tJ.getAPI)(n,t));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function t4(e){return t3.apply(this,arguments)}function t3(){return(t3=tX(tQ().mark(function e(t){var n;return tQ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat("https://storybird.io:443/api","/enums/messages/").concat(t),e.abrupt("return",(0,tJ.getAPI)(n,{cached:!0}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}let t6={loaderContainer:"enumContext_loaderContainer__dbgs8"};function t9(e){return(t9="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)}function t7(){t7=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==t9(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(t9(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function ne(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nt(e,t);var n=({}).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)?nt(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nn(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var nr=(0,c.createContext)({});function no(){var e;return e=t7().mark(function e(t){var n,r,o,i,a,l;return t7().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.locale,r=t.setEnumsLoading,o=t.setEnumsError,i=t.setComplete,e.prev=1,a={},!tk().isDeveloperHost){e.next=8;break}return l={headers:{"x-enums-locale":n}},e.next=7,function(e){return t8.apply(this,arguments)}(l);case 7:a=e.sent;case 8:m.enumClientSingleton.load({enums:a}),_.load({enums:a}),i(!0),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),o(!0);case 16:r(!1);case 17:case"end":return e.stop()}},e,null,[[1,13]])}),(no=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nn(i,r,o,a,l,"next",e)}function l(e){nn(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}function ni(e){var t=e.children,n=e.locale,r=void 0===n?ta.fallbackLocale:n,o=ne((0,c.useState)(!1),2),i=o[0],a=o[1],l=ne((0,c.useState)(!1),2),s=l[0],u=l[1],d=ne((0,c.useState)(null),2),f=d[0],p=d[1],h=(0,c.useRef)(!1);(0,c.useEffect)(function(){_.loaded||m.enumClientSingleton.loaded?a(!0):(u(!0),function(e){no.apply(this,arguments)}({locale:r,setEnumsLoading:u,setEnumsError:p,setComplete:a}))},[]),(0,c.useEffect)(function(){return h.current=!0,function(){return h.current=!1}});var g=(0,c.useMemo)(function(){return i?_.loaded?_:m.enumClientSingleton.loaded?m.enumClientSingleton:null:null},[i]);return(0,y.jsxs)(nr.Provider,{value:g,children:[i?t:null,s?(0,y.jsx)("div",{className:t6.loaderContainer,children:(0,y.jsx)(j.Spin,{size:"large"})}):null,f?(0,y.jsx)("div",{className:t6.loaderContainer,children:(0,y.jsx)(v.FormattedMessage,{id:"component-enums-loading-error",defaultMessage:"Error Loading Data"})}):null]})}var na=function(){return(0,c.useContext)(nr)};let nl={certification:"certification_certification__s9dck",icon__certification:"certification_icon__certification__s9dck",certText:"certification_certText__s9dck",certTextInner:"certification_certTextInner__s9dck",noClickable:"certification_noClickable__s9dck"},ns=function(e){var t=e.certification,n=e.clickEnabled,r=void 0===n||n,o=e.hideLabel,i=na(),a=(0,c.useMemo)(function(){var e;return"function"!=typeof(null==i||null===(e=i.certificationTypes)||void 0===e?void 0:e.getByRefId)?null:i.certificationTypes.getByRefId(t)},[null==i?void 0:i.certificationTypes,t]),l=(0,c.useMemo)(function(){return a&&i.certificationTypes.icon(a.id)||"/images/icon-certification-value-placeholder.svg"},[null==i?void 0:i.certificationTypes,a]),s=(0,c.useMemo)(function(){return"".concat(nl.certification," ").concat(r?"":nl.noClickable)},[r]),u=(0,c.useMemo)(function(){return"string"==typeof(null==a?void 0:a.name)&&a.name.trim().length?a.name:(0,y.jsxs)("span",{children:["\xa0",(0,y.jsx)("br",{}),"\xa0"]})},[a]),d=(0,c.useMemo)(function(){return"string"==typeof(null==a?void 0:a.hyphenatedName)&&a.hyphenatedName.trim().length?"/certification/".concat(a.hyphenatedName):"/certification/need-to-add"},[a]);return void 0!==t&&a?(0,y.jsx)("div",{className:s,onClick:function(){eU("Opened ".concat(d," certification popup"),{category:"Engagement",label:"Product profile"})},children:(0,y.jsx)(F,{path:d,onTop:!0,children:(0,y.jsxs)("a",{children:[(0,y.jsx)("i",{className:"".concat(nl.icon," ").concat(nl.icon__certification),style:{backgroundImage:"url(".concat(l,")")}}),!(void 0!==o&&o)&&(0,y.jsx)("div",{className:nl.certText,children:(0,y.jsx)("span",{className:nl.certTextInner,children:u})})]})})}):(console.warn("Invalid certification. Check the certifications in the story",{certification:t,certificationData:a}),null)};function nc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nu=void 0,nd=void 0;let nf=function(e){var t,n=e.minimumElementsShown,r=e.numberOfElements,o=e.button,i=e.hideClass,a=e.children,l=e.forceShow,s=e.afterChange,u=e.embedded,d=e.buttonContainer,f=(0,c.createRef)(null),m=r-(void 0===n?3:n),p=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return nc(e,2);var n=({}).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)?nc(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=p[0],v=p[1];return(0,c.useEffect)(function(){"boolean"==typeof l&&v(l)},[l]),(0,c.useEffect)(function(){s&&s(h),function(){if(void 0!==nu&&void 0!==nd){var e=f.current.getBoundingClientRect().height,t=window.scrollY;t=e<=nd?nu-(nd-e):nu,window.requestAnimationFrame(function(){window.scrollTo(0,t)})}}()},[h]),u?(0,y.jsx)("div",{children:a}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"".concat(h?"":i),ref:f,children:a}),(0,y.jsx)(void 0===d?function(e){return e.children}:d,{children:m>0&&(0,y.jsx)(o,{showAll:h,numberOfHiddenElements:m,onClick:function(){nu=window.scrollY,nd=f.current.getBoundingClientRect().height,v(!h),eU(h?"Clicked hide elements":"Clicked show elements",{category:"Engagement",label:"Product profile"})}})})]})},nm={toggleShowAllWrapper:"hideShowLink_toggleShowAllWrapper__pcb37",toggleShowAll:"hideShowLink_toggleShowAll__pcb37"};function np(e){return(np="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)}let ny=function(e){var t=e.subject,n=e.showAll,r=e.numberOfHiddenElements,o=e.onClick,i=e.showAllLink,a=void 0===i?(0,y.jsx)(v.FormattedMessage,{id:"component-certifications--showMoreLink",defaultMessage:"+{number} more",values:{number:r}}):i;return n&&"object"===np(t)&&eU("Clicked more ".concat(t.name),{category:"Engagement",label:"".concat(t.label)}),(0,y.jsx)(ea,{styles:nm,owner:"HideShowLink",children:(0,y.jsx)("div",{className:nm.toggleShowAllWrapper,children:(0,y.jsx)(ea,{styles:nm,owner:"HideShowLink",children:(0,y.jsx)("a",{className:nm.toggleShowAll,onClick:o,children:!n&&r>0?a:null})})})})},nh={show2Certifications:"certifications_show2Certifications__62df7",show10Certifications:"certifications_show10Certifications__62df7",certificationWrapper:"certifications_certificationWrapper__62df7"},nv=function(e){var t=e.certifications,n=e.certificationsSorted,r=void 0===n?[]:n,o=e.clickEnabled,i=void 0===o||o,a=e.minimumCertificationsShown,l=void 0===a?2:a,s=(0,v.useIntl)(),u=((0,c.useMemo)(function(){return _.certificationTypes.list(["id","refId"])},[s]),(0,c.useMemo)(function(){return t.map(function(e){return e})},[t])),d=(0,c.useMemo)(function(){return r.map(function(e){return e})},[r]),f=(0,c.useMemo)(function(){return Array.isArray(d)&&d.length?d:Array.isArray(u)&&u.length?u:[]},[d,u]);return f.length?(0,y.jsx)(nf,{minimumElementsShown:l,numberOfElements:f.length,showAllClass:nh.showAllCertifications,hideClass:nh["show".concat(l,"Certifications")],button:ny,children:(0,y.jsx)("div",{className:nh.certificationWrapper,children:f.map(function(e,t){return(0,y.jsx)(ns,{certification:e,clickEnabled:i},t)})})}):null};var ng="/images/loader.gif",nb={mediaImage:"mediaImage",mediaVideo:"mediaVideo"};let nj=function(e){var t=e.loaderMessage,n=e.thumbnail,r=e.type,o=void 0===r?nb.default:r,i=(0,c.useMemo)(function(){return o===nb.mediaImage?(0,y.jsx)(f(),{src:ng,height:64,width:64,alt:"Loader"}):o===nb.mediaVideo?(0,y.jsx)(f(),{src:"/images/icon-video-play-button-loader.svg",height:64,width:64,alt:"Loader"}):(0,y.jsx)(f(),{src:ng,height:64,width:64,alt:"Loader"})},[o]);return(0,y.jsxs)("div",{className:"".concat("loader_container__54khc"," ").concat(void 0!==n&&n?"loader_thumbnail__54khc":""),children:[i,(0,y.jsx)("span",{className:"loader_loaderMessage__54khc",children:(void 0===t?null:t)||null})]})},n_=n(95491);var nw=a.n(n_),nx="fancy";let nS=function(e){var t=e.children,n=e.type,r=e.className,o=void 0===r?"":r;switch(void 0===n?nx:n){case"plain":return(0,y.jsx)("div",{className:"scrollbar_plainWrapper__ba16z",children:t});case nx:return(0,y.jsx)("div",{className:"".concat(null!=o?o:""," ").concat("scrollbar_perfectScrollbarWrapper__ba16z"),children:(0,y.jsx)(nw(),{children:(0,y.jsx)("div",{className:"scrollbar_childrenWrapper__ba16z",children:t})})})}return t},nO=n(22004);var nk=a.n(nO);function nC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nM=[{maxWidth:120,fileName:"default.jpg"},{maxWidth:320,fileName:"mqdefault.jpg"},{maxWidth:480,fileName:"sddefault.jpg"},{minWidth:480,fileName:"maxresdefault.jpg"}],nP={withCredentials:!1};function nI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var nN={youtube:{urlIdentifiers:["youtube.com/.*v=([^&^#]*)","youtu.be/([^&^#]*)"],getThumbnail:function(e,t){return e?new Promise(function(n){var r=function(e,t){for(var n=[],r="",o=0;o<nM.length;o++){var i=nM[o].maxWidth,a=nM[o].minWidth,l=nM[o].fileName,s="".concat("https://img.youtube.com/vi","/").concat(e,"/").concat(l);if(n.push(s),t<=i||t>a){r=s;break}}return[n,r]}(e,t),o=function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(r,0)||function(e,t){if(e){if("string"==typeof e)return nC(e,2);var n=({}).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)?nC(e,2):void 0}}(r,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();(function e(t){var n=t.checkList,r=t.preferred,o=t.resolve;if(0===n.length)return o(r);var i=n.pop();new Promise(function(e,t){var n=document.createElement("IMG");n.onload=function(){return 90===n.naturalHeight?t():e(i)},n.onerror=function(){t()},n.src=i,n.style.display="none"}).then(o).catch(function(t){e({checkList:n,preferred:r,resolve:o})})})({checkList:o[0],preferred:o[1],resolve:n})}):Promise.reject("No youtube video id found.")}},vimeo:{urlIdentifiers:[".*vimeo.com/video/?([^/^&^#]*)/?$",".*vimeo.com/([^/^&^#]*)$"],getThumbnail:function(e,t){return e?new Promise(function(n,r){ew().get("".concat("https://vimeo.com/api/v2/video","/").concat(e,".json"),nP).then(function(e){var o=e.data,i="thumbnail_small";t>100&&t<=200?i="thumbnail_medium":t>200&&(i="thumbnail_large"),o&&o[0]&&o[0][i]?n(o[0][i]):r("No thumbnail found in json response.")}).catch(function(e){r(e)})}):Promise.reject("No Vimeo video id found.")}}},nT=function(e,t){return new Promise(function(n,r){for(var o=!1,i=0,a=Object.entries(nN);i<a.length;i++)(function(){var l,s=function(e){if(Array.isArray(e))return e}(l=a[i])||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(l,0)||function(e,t){if(e){if("string"==typeof e)return nI(e,2);var n=({}).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)?nI(e,2):void 0}}(l,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],u=s[1],d=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=0;r<t.length;r++){var o=new RegExp(t[r]).exec(e);if(o&&o[n])return o[n]}return null}(e,u.urlIdentifiers);d&&(u.getThumbnail(d,t).then(function(e){return n({thumbnail:e,provider:c})}).catch(function(e){return r(e)}),o=!0)})();if(!o)return r()})};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})(e)}function nE(){nE=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==nL(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(nL(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function nz(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function nA(){var e;return e=nE().mark(function e(t){return nE().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){var r=document.createElement("IMG"),o=document.getElementsByTagName("body")[0];r.onload=function(){return o.removeChild(r),e(t)},r.onerror=function(e){return o.removeChild(r),n(e)},r.src=t,r.style.position="fixed",r.style.top="-9999px",o.append(r)}));case 1:case"end":return e.stop()}},e)}),(nA=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){nz(i,r,o,a,l,"next",e)}function l(e){nz(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}let nF={embedContainer:"mediaItem_embedContainer__va1sy",container:"mediaItem_container__va1sy",imageLoaded:"mediaItem_imageLoaded__va1sy",mediaSectionBtn:"mediaItem_mediaSectionBtn__va1sy",playIcon:"mediaItem_playIcon__va1sy",playIconOverlay:"mediaItem_playIconOverlay__va1sy",videoOverlay:"mediaItem_videoOverlay__va1sy",fromMediaSection:"mediaItem_fromMediaSection__va1sy",fromSupplyStep:"mediaItem_fromSupplyStep__va1sy",fromEmbeddedSupplyStep:"mediaItem_fromEmbeddedSupplyStep__va1sy",fromEmbeddedInfoWindow:"mediaItem_fromEmbeddedInfoWindow__va1sy",fromCertificationModalContent:"mediaItem_fromCertificationModalContent__va1sy",fromValueModalContent:"mediaItem_fromValueModalContent__va1sy",fromFacilityModalContent:"mediaItem_fromFacilityModalContent__va1sy",fromOrganizationModalContent:"mediaItem_fromOrganizationModalContent__va1sy",fromIngredientDescriptionModalContentMedia:"mediaItem_fromIngredientDescriptionModalContentMedia__va1sy",fromIngredientDescriptionModalContentRegion:"mediaItem_fromIngredientDescriptionModalContentRegion__va1sy",fromFullscreenMediaCarousel:"mediaItem_fromFullscreenMediaCarousel__va1sy",fromProductSection:"mediaItem_fromProductSection__va1sy",fromOrganizationSection:"mediaItem_fromOrganizationSection__va1sy",desktopMediaCount:"mediaItem_desktopMediaCount__va1sy",mobileMediaCount:"mediaItem_mobileMediaCount__va1sy",imageIcon:"mediaItem_imageIcon__va1sy",mediaItem:"mediaItem_mediaItem__va1sy",closeIconContainer:"mediaItem_closeIconContainer__va1sy",closeIcon:"mediaItem_closeIcon__va1sy",mediaModal:"mediaItem_mediaModal__va1sy",videoItem:"mediaItem_videoItem__va1sy",imageItem:"mediaItem_imageItem__va1sy"};function nD(e){return(nD="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)}function nB(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||nW(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nW(e,t){if(e){if("string"==typeof e)return nR(e,t);var n=({}).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)?nR(e,t):void 0}}function nR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nU(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 nH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nU(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=nD(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=nD(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==nD(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var nq="linear-gradient(rgba(0, 0, 0, 0.70) 0%,transparent 30%,transparent 100%,rgba(0, 0, 0, 0.80) 100%)",nG=function(e){var t=e.mediaType,n=e.url,r=e.isVisible,o=e.children,i=e.mediaCarouselClass,a=e.mediaItemClass;return t===m.mediaTypes.video?(0,y.jsx)("div",{className:"".concat(nF.videoItem," ").concat(i?nF["".concat(i)]:""," ").concat(a?nF["".concat(a)]:""),children:r&&(0,y.jsx)("div",{className:"player-wrapper",children:(0,y.jsx)(nk(),{className:"react-player",url:n,controls:!0,light:!1,width:"100%",playing:r,onPlay:function(){return eU("Clicked play video",{category:"Engagement",label:"Product profile"})}})})}):t===m.mediaTypes.image?(0,y.jsx)("div",{className:"".concat(nF.imageItem," ").concat(i?nF["".concat(i)]:""," ").concat(a?nF["".concat(a)]:""),style:{backgroundImage:"url(".concat(n,")")},children:o}):void 0};let nV=e4(function(e){var t,n=e.url,r=e.mediaType,o=e.caption,i=e.className,a=e.mediaSectionBtn,l=e.thumbnailWidth,s=e.windowWidth,u=e.ssrSize,d=e.onSetThumbnail,p=e.onlyMedia,h=e.modalContent,g=e.isButtonWrapper,b=void 0!==g&&g,_=e.isVisible,w=void 0===_||_,x=e.children,O=e.mediaCarouselClass,k=e.mediaItemClass,C=e.carouselCount,M=e.slug,P=e.embedded,I=e.embeddedFull,N=e.videoOverlay,T=e.onToggleFullScreenCarousel,L=e.storybookModalVisible,E=e.modalProps,z=void 0===E?{}:E,A=r===m.mediaTypes.image,F=r===m.mediaTypes.video,D=nB((0,c.useState)(!1),2),B=D[0],W=D[1],R=nB((0,c.useState)(!1),2),U=R[0],H=R[1],q=nB((0,c.useState)(""),2),G=q[0],V=q[1],Z=l||s;(0,c.useEffect)(function(){V("")},[n]),(0,c.useEffect)(function(){if(""===G&&!U){var e=function(e){V(e),H(!1)},t=function(t){console.error(t),e(A?"/images/image-placeholder--grey.svg":"/images/image-placeholder-video.svg"),W(t)};if(b)e(A?"/images/image-placeholder--grey.svg":"/images/image-placeholder-video.svg");else if(A&&(H(!0),(function(e){return nA.apply(this,arguments)})(n).then(e).catch(t)),F){if(u)return;H(!0),nT(n,Z).then(function(t){var n=t.thumbnail;e(n),"function"==typeof d&&d(n)}).catch(t)}}},[G,s,Z]);var Y=(0,S.useRouter)(),J=Y.query.params,$=void 0!==L&&L||void 0!==M&&(null==J?void 0:J.length)&&J[J.length-1]==="media-".concat(M),Q=function(){var e=Y.pathname,t=Y.query,n=window.location.hash;Y.push({pathname:e,query:nH(nH({},t),{},{params:J.slice(0,-1)}),hash:n},void 0,{shallow:!0,scroll:!1}),"function"==typeof T&&T(!1)};if(p)return(0,y.jsx)("div",{className:null!=i?i:nF.container,children:(0,y.jsx)(nG,{mediaCarouselClass:O,mediaItemClass:k,mediaType:r,url:n,isVisible:w&&($||p),caption:o,embedded:P,embeddedFull:I,children:x})});var K={},X="";return void 0===k&&console.error("[dev] always provide a mediaItemClass"),k.indexOf("ModalContent")>0&&(X=nq,C>1&&(X="linear-gradient(rgba(0, 0, 0, 0.80) 0%,transparent 25%,transparent 84%,rgba(0, 0, 0, 0.80) 100%)")),"fromSupplyStep"===k&&C>1&&(X="linear-gradient(rgba(0, 0, 0, 0.80) 0%,transparent 0%,transparent 73%,rgba(0, 0, 0, 0.80) 100%)"),"fromEmbeddedInfoWindow"===k&&(X=nq),K={backgroundImage:(X?X+",":"")+"url(".concat(G,")")},"fromProductSection"!==k&&"fromOrganizationSection"!==k||(K={}),(0,y.jsx)("div",{className:"".concat(nF.mediaItem," ").concat(null!=i?i:nF.container,"  ").concat(P?nF.embedContainer:""),children:U?(0,y.jsx)(nj,{type:A?nb.mediaImage:nb.mediaVideo}):(0,y.jsxs)(ea,{styles:nF,owner:"mediaItem",children:[(0,y.jsxs)("button",{className:"".concat(null!=a?a:nF.mediaSectionBtn," ").concat(k?nF[k]:""),style:K,onClick:function(e){return function(e){var t,n=e.router,r=e.slug,o=e.onToggleFullScreenCarousel;if(e.embedded||e.embeddedFull)return null;var i,a=n.pathname,l=n.query,s=window.location.hash;n.push({pathname:a,query:nH(nH({},l),{},{params:[].concat(function(e){if(Array.isArray(e))return nR(e)}(i=null!==(t=null==l?void 0:l.params)&&void 0!==t?t:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||nW(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["media-".concat(r)])}),hash:s},void 0,{shallow:!0}),"function"==typeof o&&o(!0)}({event:e,router:Y,embedded:P,embeddedFull:I,slug:M,onToggleFullScreenCarousel:T})},children:[A||P||B?null:(0,y.jsx)("i",{className:"".concat(nF.playIcon," ").concat(nF.playIconOverlay)}),x,"fromProductSection"==k?G?(void 0===N?null:N)?(0,y.jsxs)("div",{className:nF.videoOverlay,children:[(0,y.jsx)(f(),{src:G,placeholder:"blur",blurDataURL:G,alt:"video overlay banner",fill:!0,layout:"fill",sizes:"(max-width: 768px) 99vw, 100vw",onLoad:function(e){e.target.parentNode.classList.add(nF.imageLoaded)}}),(0,y.jsx)("i",{className:"".concat(nF.playIcon," ").concat(nF.playIconOverlay)})]}):(0,y.jsx)(f(),{src:G,placeholder:"blur",blurDataURL:G,alt:"image banner",fill:!0,layout:"fill",sizes:"(max-width: 768px) 99vw, 100vw",onLoad:function(e){e.target.parentNode.classList.add(nF.imageLoaded)}}):(0,y.jsx)(j.Spin,{}):"fromOrganizationSection"==k?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{className:nF.mobileMediaCount,children:C}),(0,y.jsx)("i",{className:nF.imageIcon}),(0,y.jsx)("span",{className:nF.desktopMediaCount,children:(0,y.jsx)(v.FormattedMessage,{id:"component-mediaItem-orgSection-modal-button-text",defaultMessage:"See all ({carouselCount})",values:{carouselCount:C}})})]}):""]}),$&&w&&(0,y.jsxs)(j.Modal,{className:"".concat(nF.mediaModal),open:$&&w,centered:!0,footer:null,mask:!0,maskClosable:!0,closable:!1,onCancel:Q,bodyStyle:{padding:0},zIndex:null!==(t=null==z?void 0:z.zIndex)&&void 0!==t?t:1e3,children:[(0,y.jsx)("div",{className:nF.closeIconContainer,onClick:Q,children:(0,y.jsx)(ea,{styles:nF,owner:"MediaItem",children:(0,y.jsx)("i",{className:nF.closeIcon})})}),null!=h?h:(0,y.jsx)(nG,{pureMediaItemClass:O,mediaType:r,url:n,isVisible:$&&w,caption:o})]})]})})}),nZ={mediaCarousel:"mediaCarousel_mediaCarousel__xbtu4",carousel:"mediaCarousel_carousel__xbtu4",slideContainer:"mediaCarousel_slideContainer__xbtu4",slickDotsOverflow:"mediaCarousel_slickDotsOverflow__xbtu4",thumbnailDotList:"mediaCarousel_thumbnailDotList__xbtu4",thumbnailDotListCentered:"mediaCarousel_thumbnailDotListCentered__xbtu4",dotThumbnail:"mediaCarousel_dotThumbnail__xbtu4",activeDotThumbnail:"mediaCarousel_activeDotThumbnail__xbtu4",mobileDotsRounded:"mediaCarousel_mobileDotsRounded__xbtu4",videoThumbnail:"mediaCarousel_videoThumbnail__xbtu4",leftOfActiveDotThumbnail:"mediaCarousel_leftOfActiveDotThumbnail__xbtu4",rightOfActiveDotThumbnail:"mediaCarousel_rightOfActiveDotThumbnail__xbtu4",lightDot:"mediaCarousel_lightDot__xbtu4",fromProductSection:"mediaCarousel_fromProductSection__xbtu4",slide:"mediaCarousel_slide__xbtu4",dateContainer:"mediaCarousel_dateContainer__xbtu4",fromMediaSection:"mediaCarousel_fromMediaSection__xbtu4",mediaIndex:"mediaCarousel_mediaIndex__xbtu4",captionContainer:"mediaCarousel_captionContainer__xbtu4",asImageDot:"mediaCarousel_asImageDot__xbtu4"};function nY(e){return(nY="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)}function nJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(nJ=function(){return!!e})()}function n$(e){return(n$=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nQ(e,t){return(nQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function nK(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 nX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nK(Object(n),!0).forEach(function(t){n0(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n0(e,t,n){return(t=n1(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n1(e){var t=function(e,t){if("object"!=nY(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=nY(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nY(t)?t:t+""}var n2=(0,c.forwardRef)(function(e,t){return(0,y.jsx)("li",{ref:t,className:e.className,children:e.children})}),n5=eQ.fromTabletWithoutMobileLandscape,n8=eQ.fromSmallSizeEmbed,n4=function(e){var t=e.className,n=e.style,r=e.onClick,o=e.beforeClick;return(0,y.jsx)("div",{className:t,style:nX(nX({},n),{},{display:"block"}),onClick:function(e){"function"==typeof o&&o(e),"function"==typeof r&&r(e)}})},n3=(0,c.forwardRef)(function(e,t){var n,r=e.media,o=e.medium,i=e.onlyMedia,a=e.onSetThumbnail,l=e.withCaption,s=e.withDate,c=e.isVisible,u=void 0!==c&&c,d=e.clickOpensFullscreenCarousel,f=e.current,p=void 0===f?0:f,h=e.firstImageIndex,g=e.overlayVideoIndex,j=e.locale,_=e.withIndex,w=e.slideClass,x=e.slug,S=e.onToggleFullScreenCarousel,O=e.onChangeFullScreenCarousel,k=e.videoAsOverlay,C=e.embedded,M=e.embeddedFull;o.dateCreated&&(b().locale(j),n=b().utc(o.dateCreated).format("MMMM M,YYYY H:mm A"));var P=0,I=0,N=0;_&&null!=r&&r.length&&r.forEach(function(e){e.mediaType===m.mediaTypes.video?P++:e.mediaType===m.mediaTypes.image&&I++,o.url===e.url&&(N=o.mediaType===m.mediaTypes.video?P:I)});var T=null;if(null!=r&&r.length){var L=p===(void 0===h?0:h),E=r.filter(function(e){return e.mediaType===m.mediaTypes.video}).length>0;L&&E&&k&&(T=r.filter(function(e){return e.mediaType===m.mediaTypes.video})[0])}return(0,y.jsxs)("div",{ref:t,className:"".concat(nZ.slideContainer," ").concat(w?nZ[w]:""),children:[void 0!==d&&d?(0,y.jsx)(ro,{mediaItemsClass:null!=w?w:"fromFullscreenMediaCarousel",media:r,current:p,onSetThumbnail:a,className:nZ.slide,isVisible:u,showCounter:!1,videoOverlay:T,overlayVideoIndex:void 0===g?void 0:g,slug:x,onToggleFullScreenCarousel:S,onChange:O,embedded:C,embeddedFull:M}):(0,y.jsx)(nV,nX(nX({mediaItemClass:null!=w?w:"fromMediaCarousel"},o),{},{onlyMedia:void 0!==i&&i,onSetThumbnail:a,carouselCount:"1",className:nZ.slide,isVisible:u,slug:x,embedded:C,embeddedFull:M})),N&&_?(0,y.jsx)("div",{className:nZ.mediaIndex,children:o.mediaType===m.mediaTypes.video?(0,y.jsx)(v.FormattedMessage,{id:"component-mediaCarousel--index-video-of",defaultMessage:"Video {index} of {count}",values:{index:N,count:P}}):(0,y.jsx)(v.FormattedMessage,{id:"component-mediaCarousel--index-image-of",defaultMessage:"Image {index} of {count}",values:{index:N,count:I}})}):null,n&&void 0!==s&&s?(0,y.jsx)("div",{className:"".concat(nZ.dateContainer),children:n}):null,void 0!==l&&l?(0,y.jsx)("div",{className:nZ.captionContainer,children:o.caption}):null]})}),n6=function(e){var t;function n(e){var t,r,o,i,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),(i=n,a=[e],i=n$(i),o=function(e,t){if(t&&("object"==nY(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,nJ()?Reflect.construct(i,a||[],n$(this).constructor):i.apply(this,a))).createPage=o.createPage.bind(o),o.createDots=o.createDots.bind(o),o.videoFilter=o.videoFilter.bind(o),o.mediaSlide=o.mediaSlide.bind(o),o.state={fullscreenVisible:null,fullscreenCurrentSlide:0,currentSlide:null!==(t=o.props.current)&&void 0!==t?t:0,firstImageSlide:null,overlayVideoSlide:null!==(r=o.props.overlayVideoIndex)&&void 0!==r?r:void 0,carouselChangeCount:0},o.onToggleFullScreenCarousel=o.onToggleFullScreenCarousel.bind(o),o.onChangeFullScreenCarousel=o.onChangeFullScreenCarousel.bind(o),o.onAfterCarouselChange=o.onAfterCarouselChange.bind(o),o.onArrowNext=o.onArrowNext.bind(o),o.onArrowPrevious=o.onArrowPrevious.bind(o),o._containerRef=(0,c.createRef)(),o._carousel=(0,c.createRef)(),o._currentSlide=(0,c.createRef)(),o._activeDot=(0,c.createRef)(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&nQ(e,t)}(n,e),t=[{key:"componentDidMount",value:function(){var e=this._containerRef.current.getElementsByClassName("slick-dots")[0];e&&e.clientWidth<e.scrollWidth&&(e.className+=" ".concat(nZ.slickDotsOverflow)),this._carousel&&this._carousel.current.goTo(this.state.currentSlide,!0)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.media,r=t.fromMediaItems;null!==this.state.firstImageSlide&&n.length==e.media.length||(this.setState({firstImageSlide:0}),r||(this.setState({currentSlide:0}),this._carousel&&this._carousel.current.goTo(0,!0)))}},{key:"createDots",value:function(e){var t=this,n=e.dots,r="slick-active",o=function(e){return"object"===nY(e)&&"object"===nY(e.props)&&"string"==typeof e.props.className&&e.props.className===r},i=n.map(function(e,i){var a,l=i<n.length-1?n[i+1]:void 0,s=i>0?n[i-1]:void 0,c=[],u=o(e);return u?(c.push(r),c.push(nZ.activeDotThumbnail)):c.push(nZ.dotThumbnail),o(l)&&c.push(nZ.leftOfActiveDotThumbnail),o(s)&&c.push(nZ.rightOfActiveDotThumbnail),c.push(nZ.lightDot),(0,y.jsx)(ea,{styles:nZ,owner:"mediaCarousel",children:(0,y.jsx)(n2,{className:c.join(" "),ref:u?t._activeDot:null,children:null==e||null===(a=e.props)||void 0===a?void 0:a.children})},i)});return(0,y.jsx)("div",{children:(0,y.jsx)(nS,{children:(0,y.jsx)("ul",{className:"".concat(nZ.thumbnailDotList," ").concat(i.length<9?nZ.thumbnailDotListCentered:""),children:i})})})}},{key:"createPage",value:function(e){var t=e.index,n=e.thumbnail,r=this.props.media;if(!r[t])return(0,y.jsx)(y.Fragment,{});var o=(0,y.jsx)(f(),{className:nZ.asImageDot,src:r[t].url,placeholder:"blur",blurDataURL:r[t].url,alt:r[t].caption,height:100,width:100,style:{objectFit:"cover"}}),i=(0,y.jsx)("div",{className:nZ.videoThumbnail,style:{backgroundImage:"url(".concat(n,")")},children:(0,y.jsx)("i",{className:nZ.thumbnailPlayIcon})});return(0,y.jsx)("button",{className:"thumbnail-dot",children:r[t].mediaType===m.mediaTypes.video?n?i:(0,y.jsx)(nj,{thumbnail:!0,type:nb.mediaVideo}):o})}},{key:"onToggleFullScreenCarousel",value:function(e){var t=this,n=this.props,r=n.media,o=n.videoAsOverlay,i=this.state,a=i.currentSlide,l=i.firstImageSlide;if(e){if(this.setState({fullscreenVisible:e}),o&&(0===a||a===l)){var s=r.filter(this.videoFilter);if(!s.length)return;var c=r.indexOf(s[0]);this.setState({currentSlide:c,fullscreenCurrentSlide:c,overlayVideoSlide:c,carouselChangeCount:0},function(){t._carousel&&t._carousel.current.goTo(c,!1)})}}else setTimeout(function(){var n,i=t.state,a=(i.currentSlide,i.firstImageSlide),l=i.fullscreenCurrentSlide;return(null===(n=r[l])||void 0===n?void 0:n.mediaType)===m.mediaTypes.video&&o?t.setState({fullscreenVisible:e,currentSlide:a,fullscreenCurrentSlide:a,overlayVideoSlide:void 0,carouselChangeCount:0},function(){var e;null===(e=t._carousel)||void 0===e||e.current.goTo(a,!0)}):t.setState({fullscreenVisible:e,currentSlide:l,overlayVideoSlide:void 0,carouselChangeCount:0},function(){var e;null===(e=t._carousel)||void 0===e||e.current.goTo(l,!0)})},1)}},{key:"onChangeFullScreenCarousel",value:function(e){this.setState({fullscreenCurrentSlide:e})}},{key:"onAfterCarouselChange",value:function(e){var t=this,n=this.props,r=n.videoAsOverlay,o=n.onChange,i=this.state,a=i.overlayVideoSlide,l=i.firstImageSlide,s=i.carouselChangeCount;void 0!==a&&r&&e===l&&0===s||this.setState({currentSlide:e,fullscreenCurrentSlide:e,carouselChangeCount:s+1},function(){var n;o&&o(e),null!==(n=t._activeDot)&&void 0!==n&&n.current&&t._activeDot.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}),eU("Clicked media carousel change",{category:"Navigation",label:"Product profile",value:e})}},{key:"onArrowNext",value:function(){var e,t=this.props.media,n=this.state.currentSlide;Array.isArray(t)&&0!==t.length&&t.length-1===n&&(null===(e=this._carousel)||void 0===e||null===(e=e.current)||void 0===e||e.goTo(0))}},{key:"onArrowPrevious",value:function(){var e,t=this.props.media,n=this.state.currentSlide;Array.isArray(t)&&0!==t.length&&0===n&&(null===(e=this._carousel)||void 0===e||null===(e=e.current)||void 0===e||e.goTo(t.length-1))}},{key:"videoFilter",value:function(e){return e.mediaType===m.mediaTypes.video}},{key:"mediaSlide",value:function(e,t){var n=this,r=this.props,o=r.clickOpensFullscreenCarousel,i=r.media,a=r.mediaCarouselClass,l=r.slug,s=r.type,c=r.videoAsOverlay,u=r.embedded,d=r.embeddedFull,f=this.state,m=f.currentSlide,p=f.firstImageSlide,h=f.overlayVideoSlide,v="fullscreen"===s,g=m===t;return(0,y.jsx)(n3,{slideClass:a,className:nZ.slideContainer,onSetThumbnail:function(e){n.setState(n0({},t,e))},medium:e,onlyMedia:v,withCaption:v,withDate:v,withIndex:v,isVisible:g,ref:g?this._currentSlide:void 0,current:t,media:i,firstImageIndex:p,overlayVideoIndex:h,clickOpensFullscreenCarousel:o,onToggleFullScreenCarousel:this.onToggleFullScreenCarousel,onChangeFullScreenCarousel:this.onChangeFullScreenCarousel,videoAsOverlay:c,slug:l,embedded:u,embeddedFull:d},t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.media,o=t.type,i=t.mediaCarouselClass,a=t.dotsTypeStyle__mobile,l=t.windowWidth,s=t.windowHeight,c=t.portrait,u=t.embedded,d=this.state.fullscreenVisible,f="fullscreen"===o,m=f;return m&&(m=u?n8({width:l,height:s,portrait:c}):n5({width:l,height:s,portrait:c})),(0,y.jsx)(ea,{styles:nZ,owner:"mediaCarousel",children:(0,y.jsx)("div",{className:"".concat(n," ").concat(f?"":i?nZ["".concat(i)]:""," ").concat("rounded"==a?nZ.mobileDotsRounded:""),ref:this._containerRef,children:(0,y.jsx)(j.Carousel,{ref:this._carousel,focusOnSelect:!1===d||f,accessibility:!d,touchMove:!d,appendDots:function(t){return e.createDots({dots:t})},customPaging:function(t){return e.createPage({index:t,thumbnail:e.state[t]})},className:nZ.carousel,afterChange:this.onAfterCarouselChange,infinite:!1,arrows:m,nextArrow:(0,y.jsx)(n4,{beforeClick:this.onArrowNext}),prevArrow:(0,y.jsx)(n4,{beforeClick:this.onArrowPrevious}),children:r.map(this.mediaSlide)})})})}}],function(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,n1(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(c.Component);n6.defaultProps={className:"".concat(nZ.mediaCarousel),media:[],type:"embedded",onlyMedia:!1,fromMediaItems:!1};let n9=e4(n6),n7={mediaCounterContainer:"mediaItems_mediaCounterContainer__4ex52",imageIcon:"mediaItems_imageIcon__4ex52",mediaCount:"mediaItems_mediaCount__4ex52"};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})(e)}var rt=["media","current","showCounter","mediaItemsClass","placeholderImage","slug","embedded","embeddedFull","onChange","videoOverlay","overlayVideoIndex"];function rn(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 rr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==re(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let ro=function(e){var t,n=e.media,r=e.current,o=void 0===r?0:r,i=e.showCounter,a=e.mediaItemsClass,l=e.placeholderImage,s=e.slug,c=e.embedded,u=e.embeddedFull,d=e.onChange,f=e.videoOverlay,p=void 0===f?null:f,h=e.overlayVideoIndex,v=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,rt);if(null!=n&&n.url&&null!=n&&n.mediaType)t=[n];else if(n instanceof Array&&n.length>0)t=n;else{if(!l)return console.warn("No Media and no placeholderImage given."),(0,y.jsx)("div",{className:"noMedia"});t=[{url:l,mediaType:m.mediaTypes.image}]}return(0,y.jsx)(nV,rr(rr(rr({slug:s,index:o},t[o]),v),{},{mediaItemClass:null!=a?a:"fromMediaItems",carouselCount:t.length,embedded:c,embeddedFull:u,videoOverlay:p,modalContent:c||u?null:(0,y.jsx)(n9,{className:n7.mediaCarousel,mediaCarouselClass:a,slideClass:a,dotsTypeStyle__mobile:"",media:t,type:"fullscreen",slug:s,current:o,videoAsOverlay:void 0!==p,overlayVideoIndex:void 0===h?void 0:h,onChange:d,fromMediaItems:!0,embedded:c,embeddedFull:u}),children:t.length>1&&!c&&!u&&(void 0===i||i)?(0,y.jsxs)("div",{className:n7.mediaCounterContainer,children:[(0,y.jsx)("span",{className:n7.mediaCount,children:t.length}),(0,y.jsx)("i",{className:n7.imageIcon})]}):null}))};var ri={AL:{en:{name:"Alabama"},es:{name:"Alabama"}},AK:{en:{name:"Alaska"},es:{name:"Alaska"}},AS:{en:{name:"American Samoa"},es:{name:"Samoa Americana"}},AZ:{en:{name:"Arizona"},es:{name:"Arizona"}},AR:{en:{name:"Arkansas"},es:{name:"Arkansas"}},CA:{en:{name:"California"},es:{name:"California"}},CO:{en:{name:"Colorado"},es:{name:"Colorado"}},CT:{en:{name:"Connecticut"},es:{name:"Connecticut"}},DE:{en:{name:"Delaware"},es:{name:"Delaware"}},DC:{en:{name:"District Of Columbia"},es:{name:"Distrito de Columbia"}},FM:{en:{name:"Federated States Of Micronesia"},es:{name:"Estados Federados de Micronesia"}},FL:{en:{name:"Florida"},es:{name:"Florida"}},GA:{en:{name:"Georgia"},es:{name:"Georgia"}},GU:{en:{name:"Guam"},es:{name:"Guam"}},HI:{en:{name:"Hawaii"},es:{name:"Hawaii"}},ID:{en:{name:"Idaho"},es:{name:"Idaho"}},IL:{en:{name:"Illinois"},es:{name:"Illinois"}},IN:{en:{name:"Indiana"},es:{name:"Indiana"}},IA:{en:{name:"Iowa"},es:{name:"Iowa"}},KS:{en:{name:"Kansas"},es:{name:"Kansas"}},KY:{en:{name:"Kentucky"},es:{name:"Kentucky"}},LA:{en:{name:"Louisiana"},es:{name:"Louisiana"}},ME:{en:{name:"Maine"},es:{name:"Maine"}},MH:{en:{name:"Marshall Islands"},es:{name:"Islas Marshall"}},MD:{en:{name:"Maryland"},es:{name:"Maryland"}},MA:{en:{name:"Massachusetts"},es:{name:"Massachusetts"}},MI:{en:{name:"Michigan"},es:{name:"Michigan"}},MN:{en:{name:"Minnesota"},es:{name:"Minnesota"}},MS:{en:{name:"Mississippi"},es:{name:"Mississippi"}},MO:{en:{name:"Missouri"},es:{name:"Missouri"}},MT:{en:{name:"Montana"},es:{name:"Montana"}},NE:{en:{name:"Nebraska"},es:{name:"Nebraska"}},NV:{en:{name:"Nevada"},es:{name:"Nevada"}},NH:{en:{name:"New Hampshire"},es:{name:"New Hampshire"}},NJ:{en:{name:"New Jersey"},es:{name:"Nueva Jersey"}},NM:{en:{name:"New Mexico"},es:{name:"Nuevo M\xe9xico"}},NY:{en:{name:"New York"},es:{name:"Nueva York"}},NC:{en:{name:"North Carolina"},es:{name:"Carolina del Norte"}},ND:{en:{name:"North Dakota"},es:{name:"Dakota del Norte"}},MP:{en:{name:"Northern Mariana Islands"},es:{name:"Islas Marianas del Norte"}},OH:{en:{name:"Ohio"},es:{name:"Ohio"}},OK:{en:{name:"Oklahoma"},es:{name:"Oklahoma"}},OR:{en:{name:"Oregon"},es:{name:"Oregon"}},PW:{en:{name:"Palau"},es:{name:"Palau"}},PA:{en:{name:"Pennsylvania"},es:{name:"Pennsylvania"}},PR:{en:{name:"Puerto Rico"},es:{name:"Puerto Rico"}},RI:{en:{name:"Rhode Island"},es:{name:"Rhode Island"}},SC:{en:{name:"South Carolina"},es:{name:"Carolina del Sur"}},SD:{en:{name:"South Dakota"},es:{name:"Dakota del Sur"}},TN:{en:{name:"Tennessee"},es:{name:"Tennessee"}},TX:{en:{name:"Texas"},es:{name:"Texas"}},UT:{en:{name:"Utah"},es:{name:"Utah"}},VT:{en:{name:"Vermont"},es:{name:"Vermont"}},VI:{en:{name:"Virgin Islands"},es:{name:"Islas V\xedrgenes"}},VA:{en:{name:"Virginia"},es:{name:"Virginia"}},WA:{en:{name:"Washington"},es:{name:"Washington"}},WV:{en:{name:"West Virginia"},es:{name:"West Virginia"}},WI:{en:{name:"Wisconsin"},es:{name:"Wisconsin"}},WY:{en:{name:"Wyoming"},es:{name:"Wyoming"}}},ra={DIF:{en:{name:"Federal District"},es:{name:"Distrito Federal"}},AGU:{en:{name:"Aguascalientes"},es:{name:"Aguascalientes"}},BCN:{en:{name:"Baja California"},es:{name:"Baja California"}},BCS:{en:{name:"Baja California Sur"},es:{name:"Baja California Sur"}},CAM:{en:{name:"Campeche"},es:{name:"Campeche"}},CHP:{en:{name:"Chiapas"},es:{name:"Chiapas"}},CHH:{en:{name:"Chihuahua"},es:{name:"Chihuahua"}},COA:{en:{name:"Coahuila"},es:{name:"Coahuila"}},COL:{en:{name:"Colima"},es:{name:"Colima"}},DUR:{en:{name:"Durango"},es:{name:"Durango"}},GUA:{en:{name:"Guanajuato"},es:{name:"Guanajuato"}},GRO:{en:{name:"Guerrero"},es:{name:"Guerrero"}},HID:{en:{name:"Hidalgo"},es:{name:"Hidalgo"}},JAL:{en:{name:"Jalisco"},es:{name:"Jalisco"}},MIC:{en:{name:"Michoac\xe1n"},es:{name:"Michoac\xe1n"}},MOR:{en:{name:"Morelos"},es:{name:"Morelos"}},MEX:{en:{name:"M\xe9xico"},es:{name:"M\xe9xico"}},NAY:{en:{name:"Nayarit"},es:{name:"Nayarit"}},NLE:{en:{name:"Nuevo Le\xf3n"},es:{name:"Nuevo Le\xf3n"}},OAX:{en:{name:"Oaxaca"},es:{name:"Oaxaca"}},PUE:{en:{name:"Puebla"},es:{name:"Puebla"}},QUE:{en:{name:"Quer\xe9taro"},es:{name:"Quer\xe9taro"}},ROO:{en:{name:"Quintana Roo"},es:{name:"Quintana Roo"}},SLP:{en:{name:"San Luis Potos\xed"},es:{name:"San Luis Potos\xed"}},SIN:{en:{name:"Sinaloa"},es:{name:"Sinaloa"}},SON:{en:{name:"Sonora"},es:{name:"Sonora"}},TAB:{en:{name:"Tabasco"},es:{name:"Tabasco"}},TAM:{en:{name:"Tamaulipas"},es:{name:"Tamaulipas"}},TLA:{en:{name:"Tlaxcala"},es:{name:"Tlaxcala"}},VER:{en:{name:"Veracruz"},es:{name:"Veracruz"}},YUC:{en:{name:"Yucat\xe1n"},es:{name:"Yucat\xe1n"}},ZAC:{en:{name:"Zacatecas"},es:{name:"Zacatecas"}}},rl={AB:{en:{name:"Alberta"},es:{name:"Alberta"}},BC:{en:{name:"British Columbia"},es:{name:"Columbia Brit\xe1nica"}},MB:{en:{name:"Manitoba"},es:{name:"Manitoba"}},NB:{en:{name:"New Brunswick"},es:{name:"Nuevo Brunswick"}},NL:{en:{name:"Newfoundland and Labrador"},es:{name:"Terranova y Labrador"}},NT:{en:{name:"Northwest Territories"},es:{name:"Territorios del Noroeste"}},NS:{en:{name:"Nova Scotia"},es:{name:"Nueva Escocia"}},NU:{en:{name:"Nunavut"},es:{name:"Nunavut"}},ON:{en:{name:"Ontario"},es:{name:"Ontario"}},PE:{en:{name:"Prince Edward Island"},es:{name:"Isla del Pr\xedncipe Eduardo"}},QC:{en:{name:"Quebec"},es:{name:"Quebec"}},SK:{en:{name:"Saskatchewan"},es:{name:"Saskatchewan"}},YT:{en:{name:"Yukon Territory"},es:{name:"Territorio de Yukon"}}},rs=["BR","CA","CN","AU","IT","MX","MY","US"],rc=["AR","CO","EG","GT","HK","IN","ID","IE","JP","NZ","NG","PA","PE","PT","RO","RU","SA","KR","ES","CH","TH","UA"];function ru(e){var t=e.countryCode,n=e.countyStateProvince,r=e.locale,o=null;if(t&&n){if(-1===rs.indexOf(t)&&-1===rc.indexOf(t))return null;switch(t){case"US":o=ri[n]?ri[n][r].name:n;break;case"MX":o=ra[n]?ra[n][r].name:n;break;case"CA":o=rl[n]?rl[n][r].name:n;break;default:o=n}}return o}function rd(e){var t=e.address,n=e.zip,r=e.city,o=e.state,i=e.countryCode,a=e.intl,l=e.enableStateMapping,s=[],c=null;if(i&&"string"==typeof i&&2===i.length?c=a.formatDisplayName(i.toUpperCase(),{type:"region"}):console.warn("invalid country code for location, needs to be two letter iso-631",i),t&&s.push(t),r&&(n?s.push("".concat(n," ").concat(r)):s.push(r)),o){var u=l?ru({countryCode:null==i?void 0:i.toUpperCase(),countyStateProvince:o,locale:a.locale}):o;s.push(null!=u?u:o)}return c&&s.push(c),0===s.length&&console.warn("getLocationParts: No string information for location given, city, state or country required."),s}let rf={locationPlace:"location_locationPlace__brdb6",orgSectionPlace:"location_orgSectionPlace__brdb6",orgListItem:"location_orgListItem__brdb6",affiliatedOrganizationDetail:"location_affiliatedOrganizationDetail__brdb6",facilityName:"location_facilityName__brdb6",isLink:"location_isLink__brdb6",selected:"location_selected__brdb6"},rm=function(e){var t=e.name,n=e.city,r=e.state,o=e.countryCode,i=e.icon,a=e.customClass,l=void 0===a?null:a,s=e.hideCity,u=void 0!==s&&s,d=e.hideFacilityName,f=void 0!==d&&d,m=e.hideIcon,p=void 0!==m&&m,h=e.selected,g=e.isLink,b=void 0===g||g,j=e.enableStateMapping,_=void 0!==j&&j,w=(0,v.useIntl)(),x=(0,c.useMemo)(function(){return rd({city:u?null:n,state:r,countryCode:o,intl:w,enableStateMapping:_})},[n,u,r,o,w]),S=(0,c.useMemo)(function(){return!f&&("string"==typeof t&&""!==t||(console.warn("location with invalid or empty name provided"),!1))},[t,f]),O=(0,c.useMemo)(function(){var e=[];return S?(e.push((0,y.jsxs)(ea,{styles:rf,owner:"Location",children:[i||(0,y.jsx)("i",{className:rf.mapMarkerIcon}),(0,y.jsx)("span",{className:"".concat(rf.facilityName," ").concat(b?rf.isLink:""),children:t},e.length)]},"mapMarkerIcon")),x.length&&e.push((0,y.jsx)("span",{children:", "},e.length))):x.length&&!p&&e.push((0,y.jsx)(ea,{styles:rf,owner:"Location",children:i||(0,y.jsx)("i",{className:rf.mapMarkerIcon},e.length)},"mapMarkerIcon")),e.push((0,y.jsx)("span",{children:x.join(", ")},e.length)),e},[t,x,i,S]);return(0,y.jsx)(ea,{styles:rf,owner:"Location",children:(0,y.jsx)("div",{className:"".concat(rf.locationPlace," ").concat(l?rf[l]:""," ").concat(void 0!==h&&h?rf.selected:""),children:O})})},rp={facilityInformation:"facilityInformation_facilityInformation__n6ea7",supheadline:"facilityInformation_supheadline__n6ea7",headline:"facilityInformation_headline__n6ea7",organizationName:"facilityInformation_organizationName__n6ea7",location:"facilityInformation_location__n6ea7",mapMarkerIcon:"facilityInformation_mapMarkerIcon__n6ea7",description:"facilityInformation_description__n6ea7"};function ry(e){return(ry="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)}function rh(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}let rv=function(e){var t=e.organization,n=t.name,r=t.hyphenatedName,o=e.location,i=e.name,a=e.description,l=a instanceof Array?a.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):(0,y.jsx)("p",{children:a});return(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsxs)("div",{className:rp.facilityInformation,children:[(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsxs)("div",{className:rp.headlineWrapper,children:[(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsx)("p",{className:rp.supheadline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-facilityInformation-facility-header",defaultMessage:"Facility"})})}),i!==n?(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsx)("h2",{className:rp.headline,children:i})}):null]})}),(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsx)("div",{className:rp.organizationName,children:(0,y.jsx)(F,{path:"/organization/".concat(r),children:(0,y.jsx)("a",{children:n})})})}),(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsx)("div",{className:rp.location,children:o?(0,y.jsx)(rm,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=ry(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ry(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ry(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},o)):null})}),(0,y.jsx)(ea,{styles:rp,owner:"FacilityInformation",children:(0,y.jsx)("div",{className:rp.description,children:l})})]})})};var rg={facebook:["https://facebook.com/","https://www.facebook.com/"],instagram:["https://instagram.com/","https://www.instagram.com/"],linkedin:["https://linkedin.com/company/","https://www.linkedin.com/company/"],twitter:["https://x.com/","https://www.x.com/"],x:["https://x.com/","https://www.x.com/"]};let rb={icon:"socialIcon_icon__mvrxb",instagramIcon:"socialIcon_instagramIcon__mvrxb",facebookIcon:"socialIcon_facebookIcon__mvrxb",twitterIcon:"socialIcon_twitterIcon__mvrxb",linkedinIcon:"socialIcon_linkedinIcon__mvrxb",emailIcon:"socialIcon_emailIcon__mvrxb",copyIcon:"socialIcon_copyIcon__mvrxb",websiteIcon:"socialIcon_websiteIcon__mvrxb",defaultIcon:"socialIcon_defaultIcon__mvrxb",iconText:"socialIcon_iconText__mvrxb",iconTextDefault:"socialIcon_iconTextDefault__mvrxb",fromHeader:"socialIcon_fromHeader__mvrxb"},rj=function(e){var t=e.type,n=e.socialIconClass,r=function(e){switch(e){case"facebook":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-facebook",defaultMessage:"Facebook"});case"twitter":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-x",defaultMessage:"X"});case"instagram":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-instagram",defaultMessage:"Instagram"});case"copy":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-copy",defaultMessage:"Copy"});case"email":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-email",defaultMessage:"Email"});case"website":case"other":return(0,y.jsx)(v.FormattedMessage,{id:"social-icon-website",defaultMessage:"Website"});default:return"".concat(e[0].toUpperCase()).concat(e.slice(1))}}(t);return(0,y.jsxs)(ea,{styles:rb,owner:"SocialIcon",children:[(0,y.jsx)("i",{className:"".concat(rb.icon," ").concat("string"==typeof rb["".concat(t,"Icon")]?rb["".concat(t,"Icon")]:rb.defaultIcon," ").concat(n?rb["".concat(n)]:"")}),(0,y.jsx)("div",{className:"".concat(rb.iconText," ").concat("string"==typeof rb["".concat(t,"IconText")]?rb["".concat(t,"IconText")]:rb.defaultIconText," ").concat(n?rb["".concat(n)]:""),children:r})]})},r_={iconLinkContainer:"socialLink_iconLinkContainer__ubmkg"},rw=function(e){var t=e.type,n=e.url;return"string"!=typeof n||"string"!=typeof n?null:(0,y.jsx)(ea,{styles:r_,owner:"SocialLink",children:(0,y.jsx)("div",{className:r_.iconLinkContainer,children:(0,y.jsx)(eZ,{href:function(e){var t=e.type,n=e.url,r=rg[t];if(null==r||!r.length)return n;if(0!==n.indexOf("https://"))return r[0]+n;for(var o=0;o<r.length;o++){var i=r[o];if(0===n.indexOf(i))break;if(o===r.length-1)return n.replace("https://",i)}return n}({type:t,url:n}),onClick:function(){return eU("Clicked Social Link "+t,{category:"Engagement",label:"Product profile"})},children:(0,y.jsx)(rj,{type:t})})})})},rx={socialSection:"social_socialSection__y2fb6",iconLinkContainer:"social_iconLinkContainer__y2fb6",orgModalContent:"social_orgModalContent__y2fb6",facilityModalContent:"social_facilityModalContent__y2fb6",producerProfileModalContent:"social_producerProfileModalContent__y2fb6",icon:"social_icon__y2fb6",instagramIcon:"social_instagramIcon__y2fb6",facebookIcon:"social_facebookIcon__y2fb6",twitterIcon:"social_twitterIcon__y2fb6",emailIcon:"social_emailIcon__y2fb6",copyIcon:"social_copyIcon__y2fb6",linkedinIcon:"social_linkedinIcon__y2fb6",iconText:"social_iconText__y2fb6",fromHeader:"social_fromHeader__y2fb6"};function rS(e){return(rS="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)}function rO(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}let rk=function(e){var t=e.social,n=e.fromComponentClass,r=void 0===n?null:n;return Array.isArray(t)?(0,y.jsx)(ea,{styles:rx,owner:"Social",children:(0,y.jsx)("div",{className:"".concat(rx.socialSection," ").concat(r&&rx[r]),children:t.map(function(e,t){return(0,y.jsx)(rw,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rO(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=rS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rS(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==rS(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e),t)})})}):null},rC=n(54182);function rM(e){return(rM="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)}var rP=["value","claimTypeDetail"];function rI(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 rN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=rM(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rM(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==rM(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rT(e){var t=e.value,n=e.claimTypeDetail,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,rP),o=na(),i=(0,v.useIntl)(),a=(0,c.useMemo)(function(){return i.formatMessage({id:"story-claim-measurement-no-measurement",defaultMessage:"no measurement"})},[i]),l=(0,c.useMemo)(function(){var e;if("string"!=typeof(null==t||null===(e=t.measurementType)||void 0===e?void 0:e.refId)||!t.measurementType.refId.trim().length)return a;try{var r=o.mrvClaimTypeMeasurements.getByRefId(t.measurementType.refId);if("string"==typeof(null==r?void 0:r.title)&&r.title.trim().length)return r.title}catch(e){}try{var i=n.mrvClaimType.mrv_claim_type_measurements.find(function(e){return e.refId===t.measurementType.refId});if("string"==typeof(null==i?void 0:i.title)&&i.title.trim().length)return i.title}catch(e){}return a},[null==o?void 0:o.mrvClaimTypeMeasurements,t,n,a]);return(0,y.jsx)("span",rN(rN({},r),{},{children:l}))}function rL(e){return(rL="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)}var rE=["values","claimTypeDetail"];function rz(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 rA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rz(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=rL(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rL(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==rL(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rF(e){var t=e.values,n=e.claimTypeDetail,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,rE);return Array.isArray(t)&&t.length?(0,y.jsx)(rT,rA(rA({},r),{},{value:t[0],claimTypeDetail:n})):null}let rD={nowrap:"storyClaimValue_nowrap__59a92"};function rB(e){var t=e.value,n=e.ellipsis,r=e.claimTypeDetail,o=e.withIcon,i=void 0!==o&&o,a=e.nameOnly,l=e.valueOnly,s=na(),u=(0,v.useIntl)(),d=(0,c.useMemo)(function(){return u.formatMessage({id:"story-claim-value-no-unit",defaultMessage:"no unit"})},[u]),f=(0,c.useMemo)(function(){return u.formatMessage({id:"story-claim-value-no-subject",defaultMessage:"no subject"})},[u]),m=(0,c.useMemo)(function(){var e;if("string"!=typeof(null==t||null===(e=t.measurementUnit)||void 0===e?void 0:e.refId)||!t.measurementUnit.refId.length)return d;try{var n=s.mrvUnits.getByRefId(t.measurementUnit.refId);if("string"==typeof(null==n?void 0:n.unit)&&n.unit.trim().length)return n.unit}catch(e){}try{var o=r.mrvClaimType.mrv_claim_type_measurements.find(function(e){return e.refId===t.measurementType.refId}).mrv_measurement_subjects.find(function(e){return e.refId===t.measurementSubject.refId}).mrv_units.find(function(e){return e.refId===t.measurementUnit.refId});if("string"==typeof o.unit&&o.unit.trim().length)return o.unit}catch(e){}return d},[null==s?void 0:s.mrvUnits,t,r,d]),p=(0,c.useMemo)(function(){var e;if("string"!=typeof(null==t||null===(e=t.measurementSubject)||void 0===e?void 0:e.refId)||!t.measurementSubject.refId.length)return f;try{var n=s.mrvMeasurementSubjects.getByRefId(t.measurementSubject.refId);if("string"==typeof n.title&&n.title.trim().length)return n.title}catch(e){}try{var o=r.mrvClaimType.mrv_claim_type_measurements.find(function(e){return e.refId===t.measurementType.refId}).mrv_measurement_subjects.find(function(e){return e.refId===t.measurementSubject.refId});if("string"==typeof o.title&&o.title.trim().length)return o.title}catch(e){}return f},[s,t,f,r]),h=(0,c.useMemo)(function(){var e;if(!i||"string"!=typeof(null==t||null===(e=t.measurementSubject)||void 0===e?void 0:e.refId)||!t.measurementSubject.refId.length)return null;try{var n,o=s.mrvMeasurementSubjects.getByRefId(t.measurementSubject.refId);if("string"==typeof(null==o||null===(n=o.icon)||void 0===n?void 0:n.url)&&o.icon.url.length)return o.icon.url}catch(e){}try{var a,l=r.mrvClaimType.mrv_claim_type_measurements.find(function(e){return e.refId===t.measurementType.refId}).mrv_measurement_subjects.find(function(e){return e.refId===t.measurementSubject.refId});if("string"==typeof(null==l||null===(a=l.icon)||void 0===a?void 0:a.url)&&l.icon.url.length)return l.icon.url}catch(e){}return null},[i]);return void 0===(null==t?void 0:t.value)?null:void 0!==a&&a?(0,y.jsx)("span",{className:rD.measurementTitle,children:p}):void 0!==l&&l?(0,y.jsxs)("span",{className:rD.nowrap,children:[(0,y.jsxs)("span",{className:rD.measurementValue,children:["\xa0",t.value]}),(0,y.jsx)("span",{className:rD.measurementUnit,children:m})]}):(0,y.jsxs)("span",{className:rD.nowrap,children:[null!==h&&(0,y.jsx)(j.Avatar,{className:rD.storyClaimImage,shape:"circle",src:h}),(0,y.jsx)("span",{className:rD.measurementTitle,children:p}),(0,y.jsxs)("span",{className:rD.measurementValue,children:["\xa0",t.value]}),(0,y.jsx)("span",{className:rD.measurementUnit,children:m}),n&&(0,y.jsx)("span",{className:rD.moreMeasurements,children:"…"})]})}function rW(e){return(rW="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)}function rR(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).storyClaims,t=void 0===e?[]:e;return Array.isArray(t)?t.reduce(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.showAsFeatured&&e.push(t),e},[]):[]}function rU(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.storyClaim,o=n.enums,i=void 0===o?{}:o,a=n.overrideTitle,l=void 0===a?void 0:a,s=n.intl;if("string"==typeof l&&l.trim().length)return l;var c=(void 0===r?{}:r).claimTypeDetail;if("function"==typeof(null==i||null===(e=i.mrvClaimTypes)||void 0===e?void 0:e.getByRefId)){var u=i.mrvClaimTypes.getByRefId(c.mrvClaimType.refId);if("string"==typeof(null==u?void 0:u.name)&&u.name.trim().length)return u.name}return"string"!=typeof(null==c||null===(t=c.mrvClaimType)||void 0===t?void 0:t.name)||""===c.mrvClaimType.name.trim()?s.formatMessage({id:"component-story-claim-no-name",defaultMessage:"No Name"}):c.mrvClaimType.name}function rH(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.storyClaim,i=void 0===o?{}:o,a=r.enums,l=i.claimTypeDetail;if(Array.isArray(null==i?void 0:i.media)&&i.media.length&&"string"==typeof i.media[0].url&&i.media[0].url.trim().length)return i.media[0].url;if("function"==typeof(null==a||null===(e=a.mrvClaimTypes)||void 0===e?void 0:e.getByRefId)){var s=a.mrvClaimTypes.getByRefId(l.mrvClaimType.refId);if("object"===rW(null==s?void 0:s.icon)&&s.icon&&"string"==typeof s.icon.url&&s.icon.url.trim().length)return s.icon.url}return"object"!==rW(null==l||null===(t=l.mrvClaimType)||void 0===t?void 0:t.icon)||"string"!=typeof(null==l||null===(n=l.mrvClaimType)||void 0===n||null===(n=n.icon)||void 0===n?void 0:n.url)||""===l.mrvClaimType.icon.url.trim()?null:l.mrvClaimType.icon.url}function rq(e,t){if(e){if("string"==typeof e)return rG(e,t);var n=({}).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)?rG(e,t):void 0}}function rG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let rV=e4(function(e){var t,n=e.id,r=e.overrideTitle,o=e.overrideShortDescription,i=e.claimTypeDetail,a=e.showValues,l=e.values,s=e.media,u=e.windowWidth,d=e.withModal,f=na(),p=(0,v.useIntl)(),h=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)("/images/image-placeholder--grey.svg"))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||rq(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=h[0],b=h[1],_=(0,c.useMemo)(function(){return rU({storyClaim:{claimTypeDetail:i},overrideTitle:r,enums:f,intl:p})},[r,i,f,p]),w=(0,c.useMemo)(function(){var e,t;if("string"==typeof o&&o.trim().length)return o;if(a&&Array.isArray(l)&&l.length){var n,r=(0,y.jsx)(rF,{values:l,claimTypeDetail:i}),s=[],c=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=rq(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(l);try{for(c.s();!(n=c.n()).done;){var u=n.value,d=1===s.length&&2!==l.length;if(s.push((0,y.jsx)(rB,{value:u,ellipsis:d,claimTypeDetail:i},s.length)),s.length>=2)break}}catch(e){c.e(e)}finally{c.f()}return(0,y.jsxs)(y.Fragment,{children:[r,s]})}if("function"==typeof(null==f||null===(e=f.mrvClaimTypes)||void 0===e?void 0:e.getByRefId)){var m=f.mrvClaimTypes.getByRefId(i.mrvClaimType.refId);if("string"==typeof(null==m?void 0:m.description)&&m.description.trim().length)return m.description}return"string"!=typeof(null==i||null===(t=i.mrvClaimType)||void 0===t?void 0:t.description)||""===i.mrvClaimType.description.trim()?p.formatMessage({id:"component-story-claim-no-description",defaultMessage:"No Description"}):i.mrvClaimType.description},[o,i,f,a,l,p]),x=(0,c.useMemo)(function(){return n},[n]),S=(0,c.useMemo)(function(){return rH({storyClaim:{claimTypeDetail:i,media:s},enums:f})},[i,f,s]);(0,c.useEffect)(function(){S&&b(S)},[S]),(0,c.useEffect)(function(){Array.isArray(s)&&s.length&&s[0].mediaType===m.mediaTypes.video&&nT(s[0].url,u).then(function(e){b(e.thumbnail)}).catch(console.error)},[u,s]);var O=(0,c.useMemo)(function(){return(0,y.jsxs)("a",{children:[(0,y.jsx)(j.Avatar,{className:"storyClaim_storyClaimImage__5kk9t",shape:"circle",src:g}),(0,y.jsx)("span",{className:"storyClaim_title__5kk9t",children:_}),(0,y.jsx)("span",{className:"storyClaim_storyClaimShortDescription__5kk9t",children:w}),(0,y.jsx)(rC.ArrowRightOutlined,{})]})},[_,w,g]);return(0,y.jsx)(j.List.Item,{className:"storyClaim_storyClaim__5kk9t",onClick:function(){eU("Opened ".concat(x," story claim popup"),{category:"Engagement",label:"Product profile"})},children:void 0===d||d?(0,y.jsx)(F,{path:"/storyClaim/".concat(x),onTop:!0,children:O}):(0,y.jsx)("div",{className:"storyClaim_withoutLink__5kk9t",children:O})},n)});function rZ(e){return(rZ="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)}function rY(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return rJ(e,t);var n=({}).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)?rJ(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r$(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}var rQ=function(e){return(0,y.jsx)(rV,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r$(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=rZ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=rZ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==rZ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e))},rK=function(){return(0,y.jsx)(v.FormattedMessage,{id:"component-custom-certifications-showAllLink",defaultMessage:"Read More"})};let rX=function(e){var t=e.storyClaims,n=e.featured,r=void 0!==n&&n,o=rY((0,c.useState)([]),2),i=o[0],a=o[1],l=rY((0,c.useState)(!1),2),s=l[0],u=l[1],d=rY((0,c.useState)(0),2),f=d[0],m=d[1],p=(0,c.useMemo)(function(){return r?rR({storyClaims:t}):t},[r,t]);return(0,c.useEffect)(function(){(m(p.length-5),!s&&p.length>5)?a(Object.assign([],p).slice(0,5)):a(p)},[p,s]),(0,y.jsx)("div",{className:"storyClaims_storyClaimsWrapper__bfyg6",children:(0,y.jsx)(j.List,{itemLayout:"horizontal",dataSource:i,renderItem:rQ,loadMore:!s&&f>0&&(0,y.jsx)(ny,{showAll:s,numberOfHiddenElements:f,onClick:function(){u(!0)},showAllLink:(0,y.jsx)(rK,{})})})})},r0={modalContent:"facilityModalContent_modalContent__mpawh",modalMedia:"facilityModalContent_modalMedia__mpawh",modalContent__inner:"facilityModalContent_modalContent__inner__mpawh",socialMediaContainer:"facilityModalContent_socialMediaContainer__mpawh",headline:"facilityModalContent_headline__mpawh",panelHeader:"facilityModalContent_panelHeader__mpawh"},r1=function(e){var t=e.id,n=e.name,r=e.description,o=e.certifications,i=e.certificationsSorted,a=e.social,l=e.media,s=e.location,u=e.organization,d=e.storyClaims,f=(0,c.useMemo)(function(){return!(!Array.isArray(o)||!o.length)},[o]),m=(0,c.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.storyClaims,n=void 0===t?[]:t,r=e.facility,o=void 0===r?null:r;return Array.isArray(n)&&o&&"object"===rW(o)&&"string"==typeof o.id&&o.id.trim().length?n.reduce(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof t.facility||t.facility!==o.id||e.push(t),e},[]):[]}({storyClaims:d,facility:{id:t}})},[d,t]),p=(0,c.useMemo)(function(){return!(!Array.isArray(m)||!m.length)},[m]),h=(0,c.useMemo)(function(){return!(!Array.isArray(a)||!a.length)},[a]);return(0,y.jsxs)("div",{className:r0.modalContent,children:[(0,y.jsx)("div",{className:r0.modalMedia,children:(0,y.jsx)(ro,{mediaItemsClass:"fromFacilityModalContent",media:l,placeholderImage:"/images/image-placeholder--grey.svg",className:r0.banner,mediaSectionBtn:r0.bannerButtonClass,slug:"facility"})}),(0,y.jsxs)("div",{className:r0.modalContent__inner,children:[(0,y.jsx)(rv,{name:n,organization:u,location:s,description:r}),f&&(0,y.jsx)(tY,{children:(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:r0.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation--certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:r0,owner:"FacilityModalContent",children:(0,y.jsx)(nv,{certifications:o,certificationsSorted:i})})},"1")})," ",p&&(0,y.jsx)(tY,{children:(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:r0.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation--story-claims-title",defaultMessage:"MRV+ Claims"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:r0,owner:"FacilityModalContent",children:(0,y.jsx)(rX,{storyClaims:m,featured:!1})})},"1")}),h&&(0,y.jsxs)("div",{className:r0.socialMediaContainer,children:[(0,y.jsx)("div",{className:r0.headlineWrapper,children:(0,y.jsx)("h3",{className:r0.headline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation--connect-title",defaultMessage:"Connect"})})}),(0,y.jsx)(rk,{fromComponentClass:"facilityModalContent",social:a})]})]})]})},r2=function(e){var t=e.start,n=e.end,r=e.locale;void 0===r&&(r="en-us"),b().locale(r);var o=b().utc(t),i=b().utc(n),a=b()(),l={YYYYMMMD:"YYYY-MM-DD",DYYYY:"YYYY-MM-DD",MMMD:"YYYY-MM-DD",D:"YYYY-MM-DD"};return r.indexOf("en")>=0&&(l={YYYYMMMD:"MMM D, YYYY",MMMD:"MMM D",DYYYY:"D, YYYY",D:"D"}),o.year()!==i.year()?i.year()!==a.year()?"".concat(o.format(l.YYYYMMMD)," - ").concat(i.format(l.YYYYMMMD)):"".concat(o.format(l.YYYYMMMD)," - ").concat(i.format(l.MMMD)):o.month()!==i.month()?i.year()!==a.year()?"".concat(o.format(l.MMMD)," - ").concat(i.format(l.YYYYMMMD)):"".concat(o.format(l.MMMD)," - ").concat(i.format(l.MMMD)):o.date()!==i.date()?i.year()!==a.year()?"".concat(o.format(l.MMMD),"-").concat(i.format(l.DYYYY)):"".concat(o.format(l.MMMD),"-").concat(i.format(l.D)):i.year()!==a.year()?"".concat(i.format(l.YYYYMMMD)):"".concat(i.format(l.MMMD))},r5=n(38216);var r8=a.n(r5),r4=new RegExp(/^[a-z0-9:.,]*$/i);function r3(e){var t=Array.isArray(e)?e:[e],n=[];return t.forEach(function(e){e.indexOf("\n")>=0?e.split(/\n/).forEach(function(e){0!==e.length&&n.push(e)}):n.push(e)}),n}function r6(e,t){if(!t)return!1;for(var n=r3(e),r=0,o=0;o<n.length;o++){var i=n[o];if(r+i.length<t)r+=i.length;else for(var a=i.split(/ /),l=0;l<a.length;l++){var s=a[l];if(r+s.length>t)return!0;r+=s.length+1}}return!(r<=t)}var r9=function(e){var t=e.children;return(0,y.jsx)("span",{children:t})},r7={a:eZ,blockquote:r9,br:r9,code:r9,del:r9,em:r9,h1:r9,h2:r9,h3:r9,h4:r9,h5:r9,h6:r9,hr:r9,img:r9,input:r9,li:r9,ol:r9,pre:r9,strong:r9,sup:r9,tbody:r9,td:r9,th:r9,thead:r9,tr:r9,ul:r9};let oe=function(e){var t=e.content,n=e.limit,r=e.end,o=e.overrides,i=void 0===o?r7:o,a=(0,c.useMemo)(function(){return function(e,t){var n=r3(e);if(!t)return n;for(var r=[],o=0,i=0;i<n.length;i++){var a=n[i];if(!(o+a.length<=t)){for(var l=a.split(/ /),s=[],c=0;c<l.length;c++){var u=l[c];if(o+u.length>=t)break;s.push(u),o+=u.length+1}for(;!r4.test(s[s.length-1]);)s.pop();s.length&&r.push(s.join(" "));break}r.push(a),o+=a.length}return r}(t,n)},[t,n]),l=(0,c.useMemo)(function(){return r6(t,n)},[t,n]);return(0,c.useMemo)(function(){return a.map(function(e,t){return(0,y.jsxs)("p",{children:[(0,y.jsx)(r8(),{options:{disableParsingRawHTML:!0,overrides:i},children:e}),l&&t===a.length-1?r:null]},t)})},[a])},ot={"origin-map":"infoWindowContent_origin-map__hksep",content:"infoWindowContent_content__hksep",closeX:"infoWindowContent_closeX__hksep",closeXGrey:"infoWindowContent_closeXGrey__hksep",picture:"infoWindowContent_picture__hksep",content__inner:"infoWindowContent_content__inner__hksep",organizationName:"infoWindowContent_organizationName__hksep",descriptionFacilityTitle:"infoWindowContent_descriptionFacilityTitle__hksep",mapMarkerIcon:"infoWindowContent_mapMarkerIcon__hksep",distanceTraveled:"infoWindowContent_distanceTraveled__hksep"};function on(e){return(on="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)}function or(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}let oo=function(e){var t=e.media,n=e.organizationName,r=e.facility,o=e.distanceWithUnit,i=e.close;return(0,y.jsxs)("div",{className:ot.content,children:[(0,y.jsx)("div",{onClick:i,className:null!=t&&t.length?ot.closeX:ot.closeXGrey,children:(0,y.jsx)(f(),{src:null!=t&&t.length?"/images/icon-close-x--white.svg":"/images/icon-close-x.svg",height:26,width:26,alt:"close"})}),null!=t&&t.length?(0,y.jsx)("div",{className:ot.picture,children:(0,y.jsx)(ro,{mediaItemsClass:"fromEmbeddedInfoWindow",media:t[0],embedded:!0})}):null,(0,y.jsx)(ea,{styles:ot,owner:"InfoWindowContent",children:(0,y.jsxs)("div",{className:ot.content__inner,children:[(0,y.jsx)("div",{className:ot.organizationName,children:n}),r?(0,y.jsx)(ea,{styles:ot,owner:"InfoWindowContent",children:(0,y.jsx)("div",{className:ot.descriptionFacilityTitle,children:(0,y.jsx)("span",{className:ot.noLinkFacilityName,children:(0,y.jsx)(rm,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?or(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=on(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=on(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==on(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):or(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({iconClass:ot.mapMarkerIcon,name:r.name,hideFacilityName:!0},r.location))})})}):(0,y.jsx)(ea,{styles:ot,owner:"InfoWindowContent",children:(0,y.jsx)("div",{className:ot.distanceTraveled,children:o})})]})})]})};var oi=["to","locale","children","routerParam"];function oa(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 ol(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=os(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=os(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==os(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function os(e){return(os="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)}function oc(e){var t,n,r=e.to,o=e.locale,i=e.router,a=!0,l=r;if("object"===os(r)&&(a=!1,l=r.pathname),0!==(null===(t=l)||void 0===t?void 0:t.indexOf("/")))return r;var s=l;o&&o!==ta.fallbackLocale&&(s="/"+o+l);var c=!1;return("object"===os(null===(n=window)||void 0===n?void 0:n.location)&&window.location.pathname.startsWith("/preview")||"string"==typeof(null==i?void 0:i.pathname)&&i.pathname.startsWith("/preview"))&&(c=!0),c&&(s=s.replace(/^.*\/.*-([0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})$/,"/preview/$1")),a?s:ol(ol({},r),{},{pathname:s})}var ou=function(e){var t=e.to,n=e.locale,r=e.children,o=e.routerParam,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,oi),a=null!=o?o:(0,S.useRouter)(),l=(0,c.useMemo)(function(){return oc({to:t,locale:n,router:a})},[t,n,a]),s=(0,c.useMemo)(function(){var e=u().Children.map(r,function(e){return u().isValidElement(e)?"a"!==e.type?u().createElement("a",i,e):u().cloneElement(e,{onClick:function(e){"function"==typeof i.onClick&&i.onClick(e)},onMouseEnter:function(e){"function"==typeof i.onMouseEnter&&i.onMouseEnter(e)}}):e});return e.length>1&&console.warn("multiple children for IntlLink",{modifiedChildren:e}),e[0]},[r,i]),d=(0,c.useMemo)(function(){return ol(ol({},i),{},{onClick:void 0,onMouseEnter:void 0})},[i]);return(0,y.jsx)(x(),ol(ol({href:l},d),{},{legacyBehavior:!0,children:s}))};let od=JSON.parse('{"AF":{"name":"Afghanistan","article":false},"AL":{"name":"Albania","article":false},"DZ":{"name":"Algeria","article":false},"AS":{"name":"American Samoa","article":false},"AD":{"name":"Andorra","article":false},"AO":{"name":"Angola","article":false},"AI":{"name":"Anguilla","article":false},"AQ":{"name":"Antarctica","article":false},"AG":{"name":"Antigua and Barbuda","article":false},"AR":{"name":"Argentina","article":false},"AM":{"name":"Armenia","article":false},"AW":{"name":"Aruba","article":false},"AU":{"name":"Australia","article":false},"AT":{"name":"Austria","article":false},"AZ":{"name":"Azerbaijan","article":false},"BS":{"name":"Bahamas","article":false},"BH":{"name":"Bahrain","article":false},"BD":{"name":"Bangladesh","article":false},"BB":{"name":"Barbados","article":false},"BY":{"name":"Belarus","article":false},"BE":{"name":"Belgium","article":false},"BZ":{"name":"Belize","article":false},"BJ":{"name":"Benin","article":false},"BM":{"name":"Bermuda","article":false},"BT":{"name":"Bhutan","article":false},"BO":{"name":"Bolivia (Plurinational State of)","article":false},"BQ":{"name":"Bonaire, Sint Eustatius and Saba","article":false},"BA":{"name":"Bosnia and Herzegovina","article":false},"BW":{"name":"Botswana","article":false},"BV":{"name":"Bouvet Island","article":false},"BR":{"name":"Brazil","article":false},"IO":{"name":"British Indian Ocean Territory","article":false},"BN":{"name":"Brunei Darussalam","article":false},"BG":{"name":"Bulgaria","article":false},"BF":{"name":"Burkina Faso","article":false},"BI":{"name":"Burundi","article":false},"CV":{"name":"Cabo Verde","article":false},"KH":{"name":"Cambodia","article":false},"CM":{"name":"Cameroon","article":false},"CA":{"name":"Canada","article":false},"KY":{"name":"Cayman Islands","article":false},"CF":{"name":"Central African Republic","article":true},"TD":{"name":"Chad","article":false},"CL":{"name":"Chile","article":false},"CN":{"name":"China","article":false},"CX":{"name":"Christmas Island","article":false},"CC":{"name":"Cocos (Keeling) Islands","article":false},"CO":{"name":"Colombia","article":false},"KM":{"name":"Comoros","article":false},"CD":{"name":"Democratic Republic of the Congo","article":true},"CG":{"name":"Congo","article":false},"CK":{"name":"Cook Islands","article":false},"CR":{"name":"Costa Rica","article":false},"HR":{"name":"Croatia","article":false},"CU":{"name":"Cuba","article":false},"CW":{"name":"Cura\xe7ao","article":false},"CY":{"name":"Cyprus","article":false},"CZ":{"name":"Czechia","article":false},"CI":{"name":"C\xf4te d\'Ivoire","article":false},"DK":{"name":"Denmark","article":false},"DJ":{"name":"Djibouti","article":false},"DM":{"name":"Dominica","article":false},"DO":{"name":"Dominican Republic","article":true},"EC":{"name":"Ecuador","article":false},"EG":{"name":"Egypt","article":false},"SV":{"name":"El Salvador","article":false},"GQ":{"name":"Equatorial Guinea","article":false},"ER":{"name":"Eritrea","article":false},"EE":{"name":"Estonia","article":false},"SZ":{"name":"Eswatini","article":false},"ET":{"name":"Ethiopia","article":false},"FK":{"name":"Falkland Islands [Malvinas]","article":false},"FO":{"name":"Faroe Islands","article":false},"FJ":{"name":"Fiji","article":false},"FI":{"name":"Finland","article":false},"FR":{"name":"France","article":false},"GF":{"name":"French Guiana","article":false},"PF":{"name":"French Polynesia","article":false},"TF":{"name":"French Southern Territories","article":false},"GA":{"name":"Gabon","article":false},"GM":{"name":"Gambia","article":false},"GE":{"name":"Georgia","article":false},"DE":{"name":"Germany","article":false},"GH":{"name":"Ghana","article":false},"GI":{"name":"Gibraltar","article":false},"GR":{"name":"Greece","article":false},"GL":{"name":"Greenland","article":false},"GD":{"name":"Grenada","article":false},"GP":{"name":"Guadeloupe","article":false},"GU":{"name":"Guam","article":false},"GT":{"name":"Guatemala","article":false},"GG":{"name":"Guernsey","article":false},"GN":{"name":"Guinea","article":false},"GW":{"name":"Guinea-Bissau","article":false},"GY":{"name":"Guyana","article":false},"HT":{"name":"Haiti","article":false},"HM":{"name":"Heard Island and McDonald Islands","article":false},"VA":{"name":"Holy See","article":false},"HN":{"name":"Honduras","article":false},"HK":{"name":"Hong Kong","article":false},"HU":{"name":"Hungary","article":false},"IS":{"name":"Iceland","article":false},"IN":{"name":"India","article":false},"ID":{"name":"Indonesia","article":false},"IR":{"name":"Islamic Republic of Iran","article":true},"IQ":{"name":"Iraq","article":false},"IE":{"name":"Ireland","article":false},"IM":{"name":"Isle of Man","article":false},"IL":{"name":"Israel","article":false},"IT":{"name":"Italy","article":false},"JM":{"name":"Jamaica","article":false},"JP":{"name":"Japan","article":false},"JE":{"name":"Jersey","article":false},"JO":{"name":"Jordan","article":false},"KZ":{"name":"Kazakhstan","article":false},"KE":{"name":"Kenya","article":false},"KI":{"name":"Kiribati","article":false},"KP":{"name":"Democratic People\'s Republic of Korea","article":true},"KR":{"name":"Republic of Korea","article":true},"KW":{"name":"Kuwait","article":false},"KG":{"name":"Kyrgyzstan","article":false},"LA":{"name":"Lao People\'s Democratic Republic","article":true},"LV":{"name":"Latvia","article":false},"LB":{"name":"Lebanon","article":false},"LS":{"name":"Lesotho","article":false},"LR":{"name":"Liberia","article":false},"LY":{"name":"Libya","article":false},"LI":{"name":"Liechtenstein","article":false},"LT":{"name":"Lithuania","article":false},"LU":{"name":"Luxembourg","article":false},"MO":{"name":"Macao","article":false},"MG":{"name":"Madagascar","article":false},"MW":{"name":"Malawi","article":false},"MY":{"name":"Malaysia","article":false},"MV":{"name":"Maldives","article":false},"ML":{"name":"Mali","article":false},"MT":{"name":"Malta","article":false},"MH":{"name":"Marshall Islands","article":false},"MQ":{"name":"Martinique","article":false},"MR":{"name":"Mauritania","article":false},"MU":{"name":"Mauritius","article":false},"YT":{"name":"Mayotte","article":false},"MX":{"name":"Mexico","article":false},"FM":{"name":"Micronesia (Federated States of)","article":false},"MD":{"name":"Republic of Moldova","article":true},"MC":{"name":"Monaco","article":false},"MN":{"name":"Mongolia","article":false},"ME":{"name":"Montenegro","article":false},"MS":{"name":"Montserrat","article":false},"MA":{"name":"Morocco","article":false},"MZ":{"name":"Mozambique","article":false},"MM":{"name":"Myanmar","article":false},"NA":{"name":"Namibia","article":false},"NR":{"name":"Nauru","article":false},"NP":{"name":"Nepal","article":false},"NL":{"name":"Netherlands","article":true},"NC":{"name":"New Caledonia","article":false},"NZ":{"name":"New Zealand","article":false},"NI":{"name":"Nicaragua","article":false},"NE":{"name":"Niger","article":false},"NG":{"name":"Nigeria","article":false},"NU":{"name":"Niue","article":false},"NF":{"name":"Norfolk Island","article":false},"MP":{"name":"Northern Mariana Islands","article":false},"NO":{"name":"Norway","article":false},"OM":{"name":"Oman","article":false},"PK":{"name":"Pakistan","article":false},"PW":{"name":"Palau","article":false},"PS":{"name":"Palestine, State of","article":false},"PA":{"name":"Panama","article":false},"PG":{"name":"Papua New Guinea","article":false},"PY":{"name":"Paraguay","article":false},"PE":{"name":"Peru","article":false},"PH":{"name":"Philippines","article":true},"PN":{"name":"Pitcairn","article":false},"PL":{"name":"Poland","article":false},"PT":{"name":"Portugal","article":false},"PR":{"name":"Puerto Rico","article":false},"QA":{"name":"Qatar","article":false},"MK":{"name":"Republic of North Macedonia","article":true},"RO":{"name":"Romania","article":false},"RU":{"name":"Russian Federation","article":false},"RW":{"name":"Rwanda","article":false},"RE":{"name":"R\xe9union","article":false},"BL":{"name":"Saint Barth\xe9lemy","article":false},"SH":{"name":"Saint Helena, Ascension and Tristan da Cunha","article":false},"KN":{"name":"Saint Kitts and Nevis","article":false},"LC":{"name":"Saint Lucia","article":false},"MF":{"name":"Saint Martin (French part)","article":false},"PM":{"name":"Saint Pierre and Miquelon","article":false},"VC":{"name":"Saint Vincent and the Grenadines","article":false},"WS":{"name":"Samoa","article":false},"SM":{"name":"San Marino","article":false},"ST":{"name":"Sao Tome and Principe","article":false},"SA":{"name":"Saudi Arabia","article":false},"SN":{"name":"Senegal","article":false},"RS":{"name":"Serbia","article":false},"SC":{"name":"Seychelles","article":false},"SL":{"name":"Sierra Leone","article":false},"SG":{"name":"Singapore","article":false},"SX":{"name":"Sint Maarten (Dutch part)","article":false},"SK":{"name":"Slovakia","article":false},"SI":{"name":"Slovenia","article":false},"SB":{"name":"Solomon Islands","article":false},"SO":{"name":"Somalia","article":false},"ZA":{"name":"South Africa","article":false},"GS":{"name":"South Georgia and the South Sandwich Islands","article":false},"SS":{"name":"South Sudan","article":false},"ES":{"name":"Spain","article":false},"LK":{"name":"Sri Lanka","article":false},"SD":{"name":"Sudan","article":false},"SR":{"name":"Suriname","article":false},"SJ":{"name":"Svalbard and Jan Mayen","article":false},"SE":{"name":"Sweden","article":false},"CH":{"name":"Switzerland","article":false},"SY":{"name":"Syrian Arab Republic","article":true},"TW":{"name":"Taiwan (Province of China)","article":false},"TJ":{"name":"Tajikistan","article":false},"TZ":{"name":"United Republic of Tanzania","article":true},"TH":{"name":"Thailand","article":false},"TL":{"name":"Timor-Leste","article":false},"TG":{"name":"Togo","article":false},"TK":{"name":"Tokelau","article":false},"TO":{"name":"Tonga","article":false},"TT":{"name":"Trinidad and Tobago","article":false},"TN":{"name":"Tunisia","article":false},"TR":{"name":"Turkey","article":false},"TM":{"name":"Turkmenistan","article":false},"TC":{"name":"Turks and Caicos Islands","article":false},"TV":{"name":"Tuvalu","article":false},"UG":{"name":"Uganda","article":false},"UA":{"name":"Ukraine","article":false},"AE":{"name":"United Arab Emirates","article":false},"GB":{"name":"United Kingdom of Great Britain and Northern Ireland","article":true},"UM":{"name":"United States Minor Outlying Islands","article":false},"US":{"name":"United States of America","article":true},"UY":{"name":"Uruguay","article":false},"UZ":{"name":"Uzbekistan","article":false},"VU":{"name":"Vanuatu","article":false},"VE":{"name":"Bolivarian Republic of Venezuela","article":true},"VN":{"name":"Vietnam","article":false},"VG":{"name":"Virgin Islands (British)","article":false},"VI":{"name":"Virgin Islands (U.S.)","article":false},"WF":{"name":"Wallis and Futuna","article":false},"EH":{"name":"Western Sahara","article":false},"YE":{"name":"Yemen","article":false},"ZM":{"name":"Zambia","article":false},"ZW":{"name":"Zimbabwe","article":false},"AX":{"name":"\xc5land Islands","article":false}}'),of=n(10091);var om=a.n(of);let op=n(95135);var oy=a.n(op);let oh=n(84102);function ov(e){return(ov="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)}function og(e,t,n){var r={metric:{unit:"km",smallUnit:"m",factor:.001,small:900,medium:1e4},imperial:{unit:"mi",smallUnit:"yd",factor:621371192e-12,small:500,medium:1e4}};t=t||ta.fallbackLocale;var o="object"===ov(r[n])?r[n]:r.metric,i=new Intl.NumberFormat(t,{maximumSignificantDigits:5});if(e<o.small){var a=e;return a<40?"< 50 ".concat(o.smallUnit):(a=50*Math.round(a/50),"".concat(i.format(a)," ").concat(o.smallUnit))}if(e<o.medium){var l=e*o.factor;return l=Math.round(10*l)/10,"".concat(i.format(l)," ").concat(o.unit)}var s=Math.round(e*o.factor);return"".concat(i.format(s)," ").concat(o.unit)}function ob(e){if(2===e.length)return 1e3*oy()(e[0],e[1],{unit:"kilometers"});var t=(0,oh.lineString)(e);return 1e3*om()(t,{unit:"kilometers"})}let oj={nobreak:"blockChainLink_nobreak__663gg",link:"blockChainLink_link__663gg"};function o_(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ow(e,t);var n=({}).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)?ow(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ow(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let ox=function(e){var t=e.blockchainType,n=o_((0,c.useState)(!1),2),r=n[0],o=n[1],i=o_((0,c.useState)(),2),a=(i[0],i[1]),l=o_((0,c.useState)(),2),s=l[0],u=l[1];return(0,c.useEffect)(function(){void 0!==m.supportedBlockChains[t]?(o(!0),a(m.supportedBlockChains[t].homepage),u(m.supportedBlockChains[t].name)):o(!1)},[t]),r?(0,y.jsx)(F,{path:"/blockchain-info/".concat(t),children:(0,y.jsx)("span",{className:oj.nobreak,children:(0,y.jsxs)(ea,{styles:oj,owner:"BlockChainLink",children:[(0,y.jsxs)("a",{className:oj.link,children:[s," ",(0,y.jsx)(v.FormattedMessage,{id:"blockchainlink-blockchain",defaultMessage:"blockchain"})]})," ","\xbb"]})})}):null},oS={row:"blockChainVerifiedBy_row__zqk4s",label:"blockChainVerifiedBy_label__zqk4s"},oO=function(e){var t=e.blockchainType,n=e.blockchainStatus;return void 0===m.supportedBlockChains[t]||null===n||n===m.blockchainState.error||n===m.blockchainState.pending?null:(0,y.jsxs)(j.Row,{wrap:"false",align:"middle",className:oS.row,children:[(0,y.jsx)(j.Col,{flex:"none",className:oS.logo,children:(0,y.jsx)(h,{blockchainType:t})}),(0,y.jsx)(j.Col,{flex:"auto",className:oS.label,children:(0,y.jsx)(v.FormattedMessage,{id:"journey-summary-verified-using",defaultMessage:"Verified using the {link}",values:{link:(0,y.jsx)(ox,{blockchainType:t})}})})]})},ok={journeySummary:"journeySummary_journeySummary__vvdpe",selected:"journeySummary_selected__vvdpe",journeyHeading:"journeySummary_journeyHeading__vvdpe",journeySummaryText:"journeySummary_journeySummaryText__vvdpe",journeySummaryTextLoading:"journeySummary_journeySummaryTextLoading__vvdpe",loader:"journeySummary_loader__vvdpe"},oC=function(e){var t=e.productChain,n=e.facilities,r=e.events,o=e.selected,i=e.aboveSelected,a=e.embedded,l=e.blockchainType,s=e.blockchainStatus,c=e.dynamicFieldsUpdating,u=(0,v.useIntl)(),d=u.locale,f=d.indexOf("US")>0?"imperial":"metric",m=function(e){var t=e.productChain,n=e.events,r=e.facilities,o=e.raw,i=e.locale,a=e.unitSystem;if(!r||!t||!n)return -1;var l=void 0,s=0;return t.map(function(e){e.events.map(function(e){var t,o=r[n[e].facility];if(o){var i=null===(t=o.location)||void 0===t?void 0:t.coordinates[0];if(i){if(l){var a=ob([[l.lng,l.lat],[i.lng,i.lat]]);s+=a}l=i}}})}),void 0!==o&&o?Math.round(s):og(s,void 0===i?"en-US":i,void 0===a?"metric":a)}({productChain:t,events:r,facilities:n,locale:d,unitSystem:f}),p=function(e){for(var t=e.countries,n=e.intl,r=[],o=0;o<t.length;o++){var i=t[o];if("string"==typeof i){var a=od[i.toUpperCase()];if(void 0!==a){var l=n.formatDisplayName(i.toUpperCase(),{type:"region"});0===n.locale.indexOf("en")&&a.article?r.push(n.formatMessage({id:"countries-for-text-country-article",defaultMessage:"the {countryName}"},{countryName:l})):r.push(l)}else console.warn("No details for ".concat(i.toUpperCase()))}else console.warn("No country code")}return n.formatList(r,{type:"conjunction"})}({countries:function(e){var t=e.productChain,n=e.events,r=e.facilities;if(!r||!t||!n)return[];var o=[];return t.map(function(e){e.events.map(function(e){var t,i,a=r[n[e].facility];a&&0>o.indexOf(null===(t=a.location)||void 0===t?void 0:t.countryCode)&&o.push(null===(i=a.location)||void 0===i?void 0:i.countryCode)})}),o}({productChain:t,events:r,facilities:n}),intl:u});return(0,y.jsx)(ea,{styles:ok,owner:"JourneySummary",children:(0,y.jsx)("div",{className:"".concat(ok.journeySummary," ").concat(o?ok.selected:""," ").concat(i?ok.selectedPredecessor:""," ").concat(a?ok.wzEmbeddedChild:""," ").concat(a?ok.embedded:""),id:"supply-step-summary",children:(0,y.jsx)("div",{className:ok.journeyContainer,children:(0,y.jsx)("div",{className:ok.journeyContainer__inner,children:(0,y.jsx)("div",{className:ok.journeyContainer__innerContent,children:(0,y.jsxs)("div",{className:ok.journeyContainer__innerContentMain,children:[(0,y.jsx)(ea,{styles:ok,owner:"JourneySummary",children:(0,y.jsx)("h3",{className:"".concat(ok.journeyHeading," ").concat(o?ok.selected:""),children:(0,y.jsx)(v.FormattedMessage,{id:"journey-summary-heading",defaultMessage:"Journey Summary"})})}),(0,y.jsx)(ea,{styles:ok,owner:"JourneySummary",children:(0,y.jsx)("p",{className:c?ok.journeySummaryTextLoading:ok.journeySummaryText,children:!c&&(0,y.jsx)(v.FormattedMessage,{id:"journey-summary-text",defaultMessage:"This product traveled approximately {distanceWithUnit} through {readableCountryList}.",values:{distanceWithUnit:m,readableCountryList:p}})})}),(0,y.jsx)(oO,{blockchainType:l,blockchainStatus:s})]})})})})})})},oM={modalContent:"certificationModalContent_modalContent__8wfex",modalContentFullWidth:"certificationModalContent_modalContentFullWidth__8wfex",modalMedia:"certificationModalContent_modalMedia__8wfex",modalContent__inner:"certificationModalContent_modalContent__inner__8wfex",iconWrapper:"certificationModalContent_iconWrapper__8wfex",icon:"certificationModalContent_icon__8wfex",icon__certification:"certificationModalContent_icon__certification__8wfex",headlineWrapper:"certificationModalContent_headlineWrapper__8wfex",headline:"certificationModalContent_headline__8wfex",description:"certificationModalContent_description__8wfex",linkWrapper:"certificationModalContent_linkWrapper__8wfex",button:"certificationModalContent_button__8wfex"},oP=function(e){var t=e.certification,n=(0,v.useIntl)(),r=(0,c.useMemo)(function(){return _.certificationTypes.exists(t)?_.certificationTypes.getById(t):{}},[t,n]),o=(0,c.useMemo)(function(){return _.certificationTypes.icon(t)},[t]),i=(0,c.useMemo)(function(){return _.certificationTypes.hasMedia(t)},[t]),a=(0,c.useMemo)(function(){return _.certificationTypes.media(t)},[t]),l=r.description,s=r.website,u=r.name;return(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsxs)("div",{className:"".concat(oM.modalContent," ").concat(i?oM.modalContentFullWidth:""),children:[i?(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("div",{className:oM.modalMedia,children:(0,y.jsx)(ro,{mediaItemsClass:"fromCertificationModalContent",media:a,className:oM.banner,mediaSectionBtn:oM.bannerButtonClass,slug:"certification"})})}):null,(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsxs)("div",{className:oM.modalContent__inner,children:[(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsxs)("div",{className:oM.headlineWrapper,children:[(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("div",{className:oM.iconWrapper,children:(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("i",{className:"".concat(oM.icon," ").concat(oM.icon__certification),style:{backgroundImage:"url(".concat(o,")")}})})})}),u?(0,y.jsxs)(ea,{styles:oM,owner:"CertificationModalContent",children:[(0,y.jsx)("h2",{className:oM.headline,children:u})," "]}):null]})}),l?(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("div",{className:oM.description,children:l instanceof Array?l.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):l})}):null,s?(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("div",{className:oM.linkWrapper,children:(0,y.jsx)(eZ,{href:s,children:(0,y.jsx)(ea,{styles:oM,owner:"CertificationModalContent",children:(0,y.jsx)("button",{className:oM.button,children:(0,y.jsx)(v.FormattedMessage,{id:"component-certificationModalContent--url-button",defaultMessage:"Learn more\xbb"})})})})})}):null]})})]})})},oI={modalContent:"customCertificationModalContent_modalContent__34m18",modalContent__inner:"customCertificationModalContent_modalContent__inner__34m18",headlineWrapper:"customCertificationModalContent_headlineWrapper__34m18",headline:"customCertificationModalContent_headline__34m18",description:"customCertificationModalContent_description__34m18"};var oN={a:eZ,del:r9,h1:r9,h2:r9,h3:r9,h4:r9,h5:r9,h6:r9,img:r9,input:r9,sup:r9,tbody:r9,td:r9,th:r9,thead:r9,tr:r9};let oT=function(e){var t=e.title,n=e.longDescription;return(0,y.jsx)(ea,{styles:oI,owner:"CustomCertificationModalContent",children:(0,y.jsx)("div",{className:oI.modalContent,children:(0,y.jsxs)("div",{className:oI.modalContent__inner,children:[(0,y.jsx)("div",{className:oI.headlineWrapper,children:(0,y.jsx)(ea,{styles:oI,owner:"CustomCertificationModalContent",children:t?(0,y.jsx)("h2",{className:oI.headline,children:t}):null})}),(0,y.jsx)(ea,{styles:oI,owner:"CustomCertificationModalContent",children:n?(0,y.jsx)("div",{className:oI.description,children:(0,y.jsx)(oe,{content:n,overrides:oN})}):null})]})})})},oL={heading:"nutritionFacts_heading__jbcbm",servings:"nutritionFacts_servings__jbcbm",factSelect:"nutritionFacts_factSelect__jbcbm",base:"nutritionFacts_base__jbcbm",headingDailyValue:"nutritionFacts_headingDailyValue__jbcbm",disclaimer:"nutritionFacts_disclaimer__jbcbm",fact:"nutritionFacts_fact__jbcbm",factLabel:"nutritionFacts_factLabel__jbcbm",factValue:"nutritionFacts_factValue__jbcbm",factDaily:"nutritionFacts_factDaily__jbcbm",subFact:"nutritionFacts_subFact__jbcbm",microNutritients:"nutritionFacts_microNutritients__jbcbm"};function oE(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return oz(e,t);var n=({}).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)?oz(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oA(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 oF(e){return(oF="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)}var oD="serving",oB="weight100g",oW=function e(t){var n=t.state,r=t.fact,o=t.className,i=t.hideValue;if("string"==typeof r.options&&r.options.includes("hidden"))return null;var a="object"===oF(r.subFacts)?r.subFacts.map(function(t){return(0,y.jsx)(e,{state:n,className:oL.subFact,fact:t,hideValue:i},t.id)}):null;return(0,y.jsx)(ea,{styles:oL,owner:"NutritionFactsFact",children:(0,y.jsxs)("div",{className:"".concat(oL.fact," ").concat(o||""),children:[(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{className:oL.factLabel,children:r.label}),i?null:(0,y.jsx)(j.Col,{className:oL.factValue,children:oR({state:n,value:r.value,unit:r.unit})}),r.daily?(0,y.jsx)(j.Col,{className:oL.factDaily,children:oR({state:n,value:r.daily,unit:"%"})}):null]}),a]})})};function oR(e){var t=e.state,n=e.value,r=e.unit,o={},i=!1;switch(r){case"g":i=!0,o={style:"unit",unit:"gram",unitDisplay:"narrow"};break;case"%":i=!0,o={style:"unit",unit:"percent",unitDisplay:"narrow"}}var a=t.intl.formatNumber(parseFloat(n)*t.servingSizeFactor,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oA(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=oF(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=oF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==oF(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({maximumSignificantDigits:2},o));return"".concat(a).concat(r&&!i?r:"")}let oU=function(e){var t=e.nutritionFacts,n=oE((0,c.useState)(oD),2),r=n[0],o=n[1],i=oE((0,c.useState)(1),2),a=i[0],l=i[1],s=(0,v.useIntl)(),u={servingSize:r,setServingSize:o,servingSizeFactor:a,setServingSizeFactor:l,intl:s},d=oE((0,c.useMemo)(function(){if(!t)return[];var e,n,r,o,i,a,l,c,d,f,m=function(e){return function(t){return t.id===e}},p=null===(e=t.serving)||void 0===e?void 0:e.find(m("calories")),y=null===(n=t.serving)||void 0===n?void 0:n.find(m("size"));return null===(r=t.micro)||void 0===r||r.find(m("vitamin")),null===(o=t.micro)||void 0===o||o.find(m("mineral")),[oR({value:p.value,unit:p.unit,state:u}),oR({value:y.value,unit:y.unit,state:{servingSizeFactor:1,intl:s}}),y.value,null!==(i=null!==(a=null==t?void 0:t.vitamins)&&void 0!==a?a:null==t||null===(l=t.micro)||void 0===l?void 0:l.find(m("vitamins")))&&void 0!==i?i:null,null!==(c=null!==(d=null==t?void 0:t.minerals)&&void 0!==d?d:null==t||null===(f=t.micro)||void 0===f?void 0:f.find(m("minerals")))&&void 0!==c?c:null]},[t,a]),5),f=d[0],m=d[1],p=d[2],h=d[3],g=d[4];return t?(0,y.jsxs)(ea,{styles:oL,owner:"NutritionFacts",children:[(0,y.jsx)("div",{className:oL.heading,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-heading",defaultMessage:"Nutrition Facts"})}),(0,y.jsxs)("div",{className:oL.servings,children:[(0,y.jsx)("div",{className:oL.fact,children:(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{className:oL.factLabel,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-servings-amount-per",defaultMessage:"Amount per"})}),(0,y.jsx)(j.Col,{className:oL.factValue,children:(0,y.jsxs)(j.Select,{className:oL.factSelect,defaultValue:oD,onChange:function(e){var t,n,r,o;return n=(t={state:u,value:e,servingSize:p}).state,r=t.value,o=t.servingSize,void(r===oD&&n.setServingSizeFactor(1),r===oB&&n.setServingSizeFactor(100/o),n.setServingSize(r))},children:[(0,y.jsx)(j.Select.Option,{value:oD,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-servings-size-serving",defaultMessage:"Serving"})}),(0,y.jsx)(j.Select.Option,{value:oB,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-servings-size-100g",defaultMessage:"100g"})})]})})]})}),r==oD?(0,y.jsx)("div",{className:oL.fact,children:(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{className:oL.factLabel,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-servings-size",defaultMessage:"Serving Size"})}),(0,y.jsx)(j.Col,{className:oL.factValue,children:m})]})}):null,(0,y.jsx)("div",{className:oL.fact,children:(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{className:oL.factLabel,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-servings-calories",defaultMessage:"Calories"})}),(0,y.jsx)(j.Col,{className:oL.factValue,children:f})]})})]}),(0,y.jsxs)("div",{className:oL.base,children:[(0,y.jsx)("div",{className:oL.fact,children:(0,y.jsx)(j.Row,{className:oL.headingDailyValue,children:(0,y.jsxs)(j.Col,{className:oL.factLabel,children:[(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-heading-daily-value",defaultMessage:"% Daily Value"}),"*"]})})}),t.base.map(function(e){return(0,y.jsx)(oW,{fact:e,state:u},e.id)})]}),(0,y.jsxs)("div",{className:oL.microNutritients,children:[h&&h.map(function(e){return(0,y.jsx)(oW,{fact:e,hideValue:!1,state:u},e.id)}),g&&g.map(function(e){return(0,y.jsx)(oW,{fact:e,hideValue:!1,state:u},e.id)})]}),(0,y.jsx)("div",{className:oL.disclaimer,children:(0,y.jsx)(v.FormattedMessage,{id:"component-nutrition-facts-disclaimer",defaultMessage:"*Percent Daily Values are based on a 2,000 calorie diet. Your daily values may be higher or lower depending on your calorie needs."})})]}):null},oH={modalContent:"ingredientDescriptionModalContent_modalContent__nfvcv",withNutritionFacts:"ingredientDescriptionModalContent_withNutritionFacts__nfvcv",modalMedia:"ingredientDescriptionModalContent_modalMedia__nfvcv",modalContent__inner:"ingredientDescriptionModalContent_modalContent__inner__nfvcv",headlineWrapper:"ingredientDescriptionModalContent_headlineWrapper__nfvcv",headline:"ingredientDescriptionModalContent_headline__nfvcv",specificName:"ingredientDescriptionModalContent_specificName__nfvcv",descriptionContainer:"ingredientDescriptionModalContent_descriptionContainer__nfvcv",typeDescription:"ingredientDescriptionModalContent_typeDescription__nfvcv",regionContainer:"ingredientDescriptionModalContent_regionContainer__nfvcv",regionMedia:"ingredientDescriptionModalContent_regionMedia__nfvcv",regionDescription:"ingredientDescriptionModalContent_regionDescription__nfvcv",regionHeadline:"ingredientDescriptionModalContent_regionHeadline__nfvcv",regionDescriptionNoMedia:"ingredientDescriptionModalContent_regionDescriptionNoMedia__nfvcv",nutritionFactsContainer:"ingredientDescriptionModalContent_nutritionFactsContainer__nfvcv"};function oq(e){return(oq="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)}let oG=function(e){var t=e.name,n=e.specificName,r=e.description,o=e.media,i=e.nativeRegion,a=i.media,l=i.description,s=e.nutritionFacts,c=void 0===s?null:s,u="object"===oq(o);return(0,y.jsxs)("div",{className:"".concat(oH.modalContent," ").concat(c?oH.withNutritionFacts:""),children:[u&&!c?(0,y.jsx)("div",{className:oH.modalMedia,children:(0,y.jsx)(ro,{mediaItemsClass:"fromIngredientDescriptionModalContentMedia",media:o,className:oH.banner,buttonClass:oH.bannerButton,slug:"ingredient"})}):null,(0,y.jsxs)("div",{className:oH.modalContent__inner,children:[(0,y.jsxs)("div",{className:oH.headlineWrapper,children:[(0,y.jsx)(ea,{styles:oH,owner:"IngredientDescriptionModalContent",children:(0,y.jsx)("h2",{className:oH.headline,children:t})}),(0,y.jsx)("div",{className:oH.specificName,children:n})]}),(0,y.jsxs)("div",{className:oH.descriptionContainer,children:[r?(0,y.jsx)("div",{className:oH.typeDescription,children:r instanceof Array?r.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):r}):null,l&&l.length?(0,y.jsxs)("div",{className:oH.regionContainer,children:[(0,y.jsx)(ro,{mediaItemsClass:"fromIngredientDescriptionModalContentRegion",media:a,className:oH.regionMedia,buttonClass:oH.regionMediaButton,slug:"ingredient-region"}),(0,y.jsxs)("div",{className:a&&a.length>0?oH.regionDescription:oH.regionDescriptionNoMedia,children:[(0,y.jsx)(ea,{styles:oH,owner:"IngredientDescriptionModalContent",children:(0,y.jsx)("h3",{className:oH.regionHeadline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-ingredientDescriptionModalContent--region-title",defaultMessage:"Native Region"})})}),l instanceof Array?l.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):l]})]}):null,(0,y.jsx)("div",{className:oH.nutritionFactsContainer,children:(0,y.jsx)(oU,{nutritionFacts:c})})]})]})]})};function oV(e){return(oV="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)}function oZ(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}let oY=function(e){var t=e.name,n=e.location,r=e.media,o=e.hyphenatedName,i=function(){return(0,y.jsxs)("div",{className:"facility_facilityInner__uywpp",children:[(0,y.jsx)("div",{className:"facility_facilityBanner__uywpp",style:{backgroundImage:r&&r[0]?"url(".concat(r[0].url,")"):"url(/images/image-placeholder--grey.svg)"}}),(0,y.jsxs)("div",{className:"facility_facilityDescription__uywpp",children:[(0,y.jsx)("div",{className:"facility_facilityNameWrapper__uywpp",children:(0,y.jsx)("h3",{className:"facility_facilityName__uywpp",children:t})}),(0,y.jsx)("div",{className:"facility_facilityLocation__uywpp",children:(0,y.jsx)(rm,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oZ(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=oV(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=oV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==oV(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n))})]})]})};return o?(0,y.jsx)(F,{path:"/facility/".concat(o),children:(0,y.jsx)("a",{className:"facility_facility__uywpp",children:(0,y.jsx)(i,{})})}):(0,y.jsx)(i,{})},oJ={facilities:"facilities_facilities__4517f",headline:"facilities_headline__4517f",facilitiesList:"facilities_facilitiesList__4517f"};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})(e)}function oQ(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}let oK=function(e){var t=e.className,n=e.facilities;return(0,y.jsxs)("div",{className:null!=t?t:oJ.facilities,children:[(0,y.jsx)("div",{className:oJ.headlineWrapper,children:(0,y.jsx)("h3",{className:oJ.headline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-facilities--title",defaultMessage:"Facilities"})})}),(0,y.jsx)("div",{className:oJ.facilitiesList,children:n.map(function(e,t){return(0,y.jsx)(oY,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oQ(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o$(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e),t)})})]})},oX=n(99318);var o0=a.n(oX);let o1=n(72229);var o2=a.n(o1),o5=function(e,t){return{scalar:e,units:t}};let o8=function(e){var t=e.areaM2;if(!t)return null;var n=o2()("1 hectare"),r=o2()("1000 hectare"),o=o2()("".concat(t," m2")),i="m2";o.gt(n)&&o.lt(r)?i="hectare":o.gt(r)&&(i="km2");var a=o.format(i,o5),l=a.scalar,s=a.units;return"km2"===s?(0,y.jsx)(v.FormattedMessage,{id:"components-area-km2",defaultMessage:"{scalar} km\xb2",values:{scalar:l}}):"hectare"==s?(0,y.jsx)(v.FormattedMessage,{id:"components-area-hectare",defaultMessage:"{scalar} hectares",values:{scalar:l}}):"m2"==s?(0,y.jsx)(v.FormattedMessage,{id:"components-area-m2",defaultMessage:"{scalar} m\xb2",values:{scalar:l}}):null},o4=function(e){var t=e.type,n=e.numberMembers,r=na(),o=(0,v.useIntl)().locale,i=(0,c.useMemo)(function(){if(null==r||!r.organizationTypes||!t)return null;var e=r.organizationTypes.getByRefId(t);return Object.keys(e)&&"string"==typeof e.name&&""!==e.name.trim()?e.name:(console.warn("OrganizationType: no enums, fallback to refId"),t)},[null==r?void 0:r.organizationTypes,t]),a=(0,c.useMemo)(function(){return!isNaN(n)&&Number(n)>0},[n]),l=(0,c.useMemo)(function(){return a?new Intl.NumberFormat(o,{}).format(n):0},[o,n,a]);return i?(0,y.jsxs)(y.Fragment,{children:[i,a&&(0,y.jsxs)(y.Fragment,{children:[" ",(0,y.jsx)(v.FormattedMessage,{id:"organization-type-member-number",defaultMessage:"{numberMembers, plural, one {with <value></value> member} two {with <value></value> members} few {with <value></value> members} many {with <value></value> members} other {with <value></value> members} }",values:{numberMembers:n,value:function(){return(0,y.jsx)(y.Fragment,{children:l})}}})]})]}):null},o3=function(e){var t=e.roles,n=e.seperator,r=void 0===n?", ":n;return t.map(function(e,t){switch(e){case"grower":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-grower",defaultMessage:"Grower"})},t);case"exporter":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-exporter",defaultMessage:"Exporter"})},t);case"importer":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-importer",defaultMessage:"Importer"})},t);case"packer":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-packer",defaultMessage:"Packer"})},t);case"logistics":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-logistics",defaultMessage:"Shipping & Logistics"})},t);case"processor":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-processor",defaultMessage:"Processor / Maker"})},t);case"storage":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-storage",defaultMessage:"Warehouse / Storage"})},t);case"distributor":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-distributor",defaultMessage:"Distributor"})},t);case"retailer":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-retailer",defaultMessage:"Retailer"})},t);case"other":return(0,y.jsx)(c.Fragment,{children:(0,y.jsx)(v.FormattedMessage,{id:"component-roles-other",defaultMessage:"Other"})},t);default:return null}}).map(function(e,t){return(0,y.jsxs)(c.Fragment,{children:[t>0?r:"",e]},t)})};function o6(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o9(e,void 0);var n=({}).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)?o9(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function o9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o7(e){return(o7="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)}function ie(e){var t=e.organization,n=e.facilities;if(!t||"object"!==o7(t)||!Array.isArray(t.facilities)||!t.facilities.length||!n||!Object.keys(n).length)return null;var r,o=o6(t.facilities);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=n[i];if(a){if("10"===a.type||"office-headquarter"===a.type||"Office - Headquarter"===a.type)return a}else console.warn("getMainFacility: office-headquarter: invalid facility in organization: the facility is not exposed in all facilities",{organization:t,facilityId:i})}}catch(e){o.e(e)}finally{o.f()}var l,s=o6(t.facilities);try{for(s.s();!(l=s.n()).done;){var c=l.value,u=n[c];if(u){if("3"===u.type||"office"===u.type||"Office"===u.type)return u}else console.warn("getMainFacility: office: invalid facility in organization: the facility is not exposed in all facilities",{organization:t,facilityId:c})}}catch(e){s.e(e)}finally{s.f()}var d,f=o6(t.facilities);try{for(f.s();!(d=f.n()).done;){var m=n[d.value];if(m)return m;console.warn("getMainFacility: fallback: invalid facility in organization: the facility is not exposed in all facilities",{organization:t,facilityId:t.facilities[0]})}}catch(e){f.e(e)}finally{f.f()}return null}let it={organizationInformation:"organizationInformation_organizationInformation__u76d8",affiliatedOrganizationDetail:"organizationInformation_affiliatedOrganizationDetail__u76d8",organizationType:"organizationInformation_organizationType__u76d8",headlineWrapper:"organizationInformation_headlineWrapper__u76d8",supheadline:"organizationInformation_supheadline__u76d8",headline:"organizationInformation_headline__u76d8",location:"organizationInformation_location__u76d8",mapMarkerIcon:"organizationInformation_mapMarkerIcon__u76d8",chainRole:"organizationInformation_chainRole__u76d8",roleLabel:"organizationInformation_roleLabel__u76d8",description:"organizationInformation_description__u76d8",disableLink:"organizationInformation_disableLink__u76d8"};function ir(e){return(ir="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)}function io(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}let ii=function(e){var t=e.customClass,n=void 0===t?null:t,r=e.disableFacilityLink,o=void 0!==r&&r,i=e.facilities,a=e.name,l=e.numberMembers,s=e.organizationType,u=e.ownedFacilities,d=e.story,f=e.supplyChainRoles,m=e.type,p=e.withFlag,h=void 0!==p&&p,g=e.withSupHeadline,b=e.yearEstablished,j=(0,c.useMemo)(function(){return"".concat(it.organizationInformation," ").concat(n?it[n]:"")},[n]),_=(0,c.useMemo)(function(){return ie({facilities:i,organization:{facilities:u.map(function(e){return e.id})}})},[u,i]),w=(0,c.useMemo)(function(){var e;return null!==(e=null==_?void 0:_.location)&&void 0!==e?e:null},[_]),x=(0,c.useMemo)(function(){return Array.isArray(u)?u.reduce(function(e,t){return t.growingAreaM2?e+t.growingAreaM2:e},0):0},[u]);return w||console.error("organizationInformation: Location could not determined (no mainFacility?)."),(0,y.jsxs)("div",{className:j,children:[(0,y.jsxs)("div",{className:it.headlineWrapper,children:[(void 0===g||g)&&(0,y.jsx)("p",{className:it.supheadline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation-organization-header",defaultMessage:"Organization"})}),(0,y.jsx)("h2",{className:it.headline,children:a})]}),null!=w&&w.countryCode?(0,y.jsx)("div",{className:it.location,children:(0,y.jsx)(F,{className:!o&&it.disableLink,path:"/facility/".concat(_.hyphenatedName),children:(0,y.jsxs)("a",{className:o&&it.disableLink,children:[h&&(0,y.jsx)(o0(),{countryCode:w.countryCode,svg:!0}),(0,y.jsx)(rm,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?io(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=ir(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ir(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ir(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):io(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({customClass:n,hideIcon:h},w))]})})}):null,(0,y.jsxs)("div",{className:it.organizationType,children:[(0,y.jsx)(o4,{type:null!=s?s:m,numberMembers:l}),x?(0,y.jsxs)(y.Fragment,{children:[" • ",(0,y.jsx)(o8,{areaM2:x})]}):null,b?(0,y.jsxs)(y.Fragment,{children:[" • ",(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation-established",defaultMessage:"Established {yearEstablished}",values:{yearEstablished:b}})]}):null]}),f&&f.length?(0,y.jsxs)("div",{className:it.chainRole,children:[(0,y.jsx)("span",{className:it.roleLabel,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation-supply-chain-roles",defaultMessage:"Supply Chain Roles"})}),": ",(0,y.jsx)(o3,{roles:f})]}):null,d?(0,y.jsx)(ea,{styles:it,owner:"OrganizationInformation",children:(0,y.jsx)("div",{className:it.description,children:d instanceof Array?d.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):d})}):null]})},ia={valueContainer:"value_valueContainer__s9tg5",iconWrapper:"value_iconWrapper__s9tg5",icon:"value_icon__s9tg5",icon__value:"value_icon__value__s9tg5",valueText:"value_valueText__s9tg5",fromProductSection:"value_fromProductSection__s9tg5",fromOrgnModal:"value_fromOrgnModal__s9tg5"};function il(e){return(il="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)}let is=function(e){var t=e.valueClass,n=e.value,r=e.className,o=void 0===r?null:r,i=(0,v.useIntl)(),a=(0,c.useMemo)(function(){return"object"!==il(_.values)?null:_.values.getByRefId(n)},[n,i]),l=(0,c.useMemo)(function(){return _.values.icon(a.id)},[a]);if(!a)return null;var s=a.hyphenatedName,u=a.name,d=(0,y.jsxs)("span",{children:["\xa0",(0,y.jsx)("br",{}),"\xa0"]});return"string"!=typeof s||"string"!=typeof u?(console.warn("Missing enum hyphenatedName or name for enum value:",n),null):(0,y.jsx)(ea,{styles:ia,owner:"value",children:(0,y.jsx)("div",{className:"".concat(null!=o?o:ia.valueContainer," ").concat(t?ia["".concat(t)]:""),onClick:function(){eU("Opened ".concat(s," value popup"),{category:"Engagement",label:"Product profile"})},children:(0,y.jsx)(F,{path:s?"/value/".concat(s):"/value/need-to-add",onTop:!0,children:(0,y.jsxs)("a",{children:[(0,y.jsx)(ea,{styles:ia,owner:"value",children:(0,y.jsx)("span",{className:ia.iconWrapper,children:(0,y.jsx)(ea,{styles:ia,owner:"value",children:(0,y.jsx)("i",{className:"".concat(ia.icon," ").concat(ia.icon__value),style:{backgroundImage:"url(".concat(null!=l?l:"/images/icon-certification-value-placeholder.svg",")")}})})})}),(0,y.jsx)("div",{className:ia.valueText,children:null!=u?u:d})]})})})})},ic=function(e){var t=e.values,n=e.valuesSorted,r=void 0===n?[]:n,o=e.valuesClass;return Array.isArray(r)&&r.length?r.map(function(e,t){return(0,y.jsx)(is,{valueClass:o,value:e},t)}):Array.isArray(t)&&t.length?t.map(function(e,t){return(0,y.jsx)(is,{valueClass:o,value:e},t)}):null},iu={modalContent:"organizationModalContent_modalContent__9xrwg",modalMedia:"organizationModalContent_modalMedia__9xrwg",modalContent__inner:"organizationModalContent_modalContent__inner__9xrwg",socialMediaContainer:"organizationModalContent_socialMediaContainer__9xrwg",headline:"organizationModalContent_headline__9xrwg",valuesWrapper:"organizationModalContent_valuesWrapper__9xrwg",panelHeader:"organizationModalContent_panelHeader__9xrwg"},id=function(e){var t,n=e.name,r=e.yearEstablished,o=e.type,i=e.organizationType,a=e.supplyChainRoles,l=e.story,s=e.facilities,c=e.values,u=e.valuesSorted,d=e.certifications,f=e.certificationsSorted,m=e.social,p=e.allFacilities,h=e.media,g=null!==(t=null==s?void 0:s.map(function(e){return p[e]}).filter(function(e){return e}))&&void 0!==t?t:[];return(0,y.jsxs)("div",{className:iu.modalContent,children:[(0,y.jsx)("div",{className:iu.modalMedia,children:(0,y.jsx)(ro,{mediaItemsClass:"fromOrganizationModalContent",media:h,placeholderImage:"/images/image-placeholder--grey.svg",slug:"organization"})}),(0,y.jsxs)("div",{className:iu.modalContent__inner,children:[(0,y.jsx)(ii,{name:n,facilities:p,ownedFacilities:g,supplyChainRoles:a,type:o,organizationType:i,yearEstablished:r,story:l}),(null==g?void 0:g.length)>0?(0,y.jsx)(oK,{facilities:g}):null,(null==c?void 0:c.length)>0||(null==d?void 0:d.length)>0?(0,y.jsxs)(tY,{children:[(null==c?void 0:c.length)>0?(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:iu.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationModal--values-title",defaultMessage:"Values"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:iu,owner:"OrganizationModalContent",children:(0,y.jsx)("div",{className:iu.valuesWrapper,children:(0,y.jsx)(ic,{valuesClass:"fromOrgnModal",values:c,valuesSorted:u})})})},"1"):null,(null==d?void 0:d.length)>0?(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:iu.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation--certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:iu,owner:"OrganizationModalContent",children:(0,y.jsx)(nv,{certifications:d,certificationsSorted:f})})},"2"):null]}):null,(null==m?void 0:m.length)>0?(0,y.jsxs)("div",{className:iu.socialMediaContainer,children:[(0,y.jsx)("div",{className:iu.headlineWrapper,children:(0,y.jsx)("h3",{className:iu.headline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationInformation--connect-title",defaultMessage:"Connect"})})}),(0,y.jsx)(rk,{fromComponentClass:"orgModalContent",social:m})]}):null]})]})},im={modalContent:"recipeModalContent_modalContent__3vdmj",modalMedia:"recipeModalContent_modalMedia__3vdmj",singleHeaderImage:"recipeModalContent_singleHeaderImage__3vdmj",modalContent__inner:"recipeModalContent_modalContent__inner__3vdmj",headlineWrapper:"recipeModalContent_headlineWrapper__3vdmj",headline:"recipeModalContent_headline__3vdmj",timeToPrepareWrapper:"recipeModalContent_timeToPrepareWrapper__3vdmj",timeToPrepare:"recipeModalContent_timeToPrepare__3vdmj",historyIcon:"recipeModalContent_historyIcon__3vdmj",description:"recipeModalContent_description__3vdmj",ingredients:"recipeModalContent_ingredients__3vdmj",preparation:"recipeModalContent_preparation__3vdmj",summary:"recipeModalContent_summary__3vdmj",linkWrapper:"recipeModalContent_linkWrapper__3vdmj"},ip=function(e){e.id;var t=e.title,n=(e.hyphenatedName,e.description),r=e.ingredients,o=e.preparation,i=e.timeToPrepare,a=e.summary,l=e.media;return(0,y.jsxs)("div",{className:im.modalContent,children:[l?(0,y.jsx)("div",{className:im.modalMedia,children:l.length?(0,y.jsx)(ro,{mediaItemsClass:"fromRecipeModalContent",media:l,className:im.banner,mediaSectionBtn:im.bannerButtonClass,onlymedia:!0,slug:"recipe",modalProps:{zIndex:1018}}):(0,y.jsx)("div",{className:im.singleHeaderImage,style:{backgroundImage:"".concat("linear-gradient(rgba(0, 0, 0, 0.7) 0%, transparent 30%, transparent 100%, rgba(0, 0, 0, 0.8) 100%)",", url(").concat("/images/image-placeholder--grey.svg",")")}})}):null,(0,y.jsxs)("div",{className:im.modalContent__inner,children:[(0,y.jsx)("div",{className:im.headlineWrapper,children:(0,y.jsxs)(ea,{styles:im,owner:"RecipeModalContent",children:[(0,y.jsx)("div",{className:im.iconWrapper}),t?(0,y.jsx)("h2",{className:im.headline,children:t}):null]})}),(0,y.jsx)("div",{className:im.timeToPrepareWrapper,children:(0,y.jsx)(ea,{styles:im,owner:"RecipeModalContent",children:(0,y.jsxs)("a",{className:im.timeToPrepare,children:[(0,y.jsx)("i",{className:im.historyIcon}),b().duration(i,"minutes").humanize({h:24,m:90})]})})}),(0,y.jsxs)(ea,{styles:im,owner:"RecipeModalContent",children:[n?(0,y.jsx)("div",{className:im.description,children:n instanceof Array?n.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):n}):null,r?(0,y.jsxs)("div",{className:im.ingredients,children:[(0,y.jsxs)("h3",{className:im.headline,children:[(0,y.jsx)(v.FormattedMessage,{id:"recipe-ingredients-headline",defaultMessage:"Ingredients"}),":"]}),(0,y.jsx)("ul",{children:r instanceof Array?r.map(function(e,t){return(0,y.jsx)("li",{children:e},t)}):r})]}):null,o?(0,y.jsxs)("div",{className:im.preparation,children:[(0,y.jsxs)("h3",{className:im.headline,children:[(0,y.jsx)(v.FormattedMessage,{id:"recipe-preparation-headline",defaultMessage:"Preparation of {recipeTitle}",values:{recipeTitle:t}}),":"]}),(0,y.jsx)("ol",{children:o instanceof Array?o.map(function(e,t){return(0,y.jsx)("li",{children:e},t)}):o})]}):null,a?(0,y.jsx)("div",{className:im.summary,children:a instanceof Array?a.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):a}):null]})]})]})},iy={modalContent:"valueModalContent_modalContent__ka3ek",modalContentFullWidth:"valueModalContent_modalContentFullWidth__ka3ek",modalMedia:"valueModalContent_modalMedia__ka3ek",modalContent__inner:"valueModalContent_modalContent__inner__ka3ek",iconWrapper:"valueModalContent_iconWrapper__ka3ek",icon:"valueModalContent_icon__ka3ek",icon__value:"valueModalContent_icon__value__ka3ek",headlineWrapper:"valueModalContent_headlineWrapper__ka3ek",headline:"valueModalContent_headline__ka3ek",description:"valueModalContent_description__ka3ek",linkWrapper:"valueModalContent_linkWrapper__ka3ek",button:"valueModalContent_button__ka3ek"},ih=function(e){var t=e.value,n=(0,c.useMemo)(function(){return _.values.exists(t)?_.values.getById(t):{}},[t]),r=(0,c.useMemo)(function(){return _.values.icon(t)},[t]),o=(0,c.useMemo)(function(){return _.values.hasMedia(t)},[t]),i=(0,c.useMemo)(function(){return _.values.media(t)},[t]),a=n.description,l=(n.website,n.name);return(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsxs)("div",{className:"".concat(iy.modalContent," ").concat(o?iy.modalContentFullWidth:""),children:[o?(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsx)("div",{className:iy.modalMedia,children:(0,y.jsx)(ro,{mediaItemsClass:"fromValueModalContent",media:i,className:iy.banner,mediaSectionBtn:iy.bannerButtonClass,slug:"value",modalProps:{zIndex:1020}})})}):null,(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsxs)("div",{className:iy.modalContent__inner,children:[(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsxs)("div",{className:iy.headlineWrapper,children:[(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsx)("div",{className:iy.iconWrapper,children:(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsx)("i",{className:"".concat(iy.icon," ").concat(iy.icon__value),style:{backgroundImage:"url(".concat(r,")")}})})})}),l?(0,y.jsx)("h2",{className:iy.headline,children:l}):null]})}),a?(0,y.jsx)(ea,{styles:iy,owner:"ValueModalContent",children:(0,y.jsx)("div",{className:iy.description,children:a instanceof Array?a.map(function(e,t){return(0,y.jsx)("p",{children:e},t)}):a})}):null]})})]})})},iv={modalContentMobile:"blockChainModalContent_modalContentMobile__x8v9b",blockchainLogoDesktop:"blockChainModalContent_blockchainLogoDesktop__x8v9b",modalMedia:"blockChainModalContent_modalMedia__x8v9b",blockchainLogoMobile:"blockChainModalContent_blockchainLogoMobile__x8v9b","blockchainLogoMobile-brecredible":"blockChainModalContent_blockchainLogoMobile-brecredible__x8v9b",singleHeaderImage:"blockChainModalContent_singleHeaderImage__x8v9b",modalContent__inner:"blockChainModalContent_modalContent__inner__x8v9b",headline:"blockChainModalContent_headline__x8v9b",linkWrapper:"blockChainModalContent_linkWrapper__x8v9b",button:"blockChainModalContent_button__x8v9b",modalContentDesktop:"blockChainModalContent_modalContentDesktop__x8v9b","blockchainLogoDesktop-becredible":"blockChainModalContent_blockchainLogoDesktop-becredible__x8v9b",iconWrapper:"blockChainModalContent_iconWrapper__x8v9b",icon__value:"blockChainModalContent_icon__value__x8v9b",headlineWrapper:"blockChainModalContent_headlineWrapper__x8v9b",description:"blockChainModalContent_description__x8v9b"};function ig(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ib(e,t);var n=({}).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)?ib(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ij=eQ.fromTabletWithoutMobileLandscape;let i_=e4(function(e){var t=e.blockchainType,n=e.windowWidth,r=e.windowHeight,o=e.portrait,i=ig((0,c.useState)(),2),a=i[0],l=i[1],s=ig((0,c.useState)(),2),u=s[0],d=s[1],p=!ij({width:n,height:r,portrait:o});(0,c.useEffect)(function(){void 0!==m.supportedBlockChains[t]&&(l(m.supportedBlockChains[t].homepage),d(m.supportedBlockChains[t].name))},[t]);var h=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchain-modal-content-foodtrust-info",defaultMessage:"Food Trust is the only network of its kind to connect participants across the food supply through a permissioned, permanent and shared record of food system data."}),g=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchain-modal-content-vechain-info",defaultMessage:"The public blockchain that derives its value from activities created by members within the ecosystem solving real world economic problems."}),b=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchain-modal-content-becredible-info",defaultMessage:"Credible empowers fashion sourcing teams with real time traceability, automation & supplier collaboration tools."}),j=(0,y.jsx)(v.FormattedMessage,{id:"component-blockchain-modal-content-unknown-info",defaultMessage:"Sorry the selected blockchain is not documented."});switch(t){case"foodtrust":j=h;break;case"vechain":j=g;break;case"becredible":j=b;break;default:console.warn("unsupported blockchain")}return(0,y.jsx)(ea,{styles:iv,owner:"BlockChainModalContent",children:(0,y.jsxs)("div",{className:"".concat(p?iv.modalContentMobile:iv.modalContentDesktop),children:[(0,y.jsx)("div",{className:iv.modalMedia,children:(0,y.jsx)("div",{className:iv.singleHeaderImage,style:{backgroundImage:"".concat(p?"linear-gradient(rgba(0, 0, 0, 0.7) 0%, transparent 30%, transparent 100%, rgba(0, 0, 0, 0.8) 100%),":""," url(/images/image-blockchain-info-").concat(t,".jpg)")},children:(0,y.jsx)(f(),{className:"".concat(iv.blockchainLogoMobile," ").concat(iv["blockchainLogoMobile-"+t]),alt:"mobile blockchain info logo",width:88,height:89,src:"/images/logos/logo-blockchain-info-".concat(t,"--white.png")})})}),(0,y.jsx)(ea,{styles:iv,owner:"BlockChainModalContent",children:(0,y.jsxs)("div",{className:iv.modalContent__inner,children:[(0,y.jsxs)("div",{className:iv.headlineWrapper,children:[(0,y.jsx)("div",{className:iv.iconWrapper,children:(0,y.jsx)(f(),{className:"".concat(iv.blockchainLogoDesktop," ").concat(iv["blockchainLogoDesktop-"+t]),alt:"desktop blockchain info logo",fill:!0,layout:"fill",style:{objectFit:"contain"},src:"/images/logos/logo-blockchain-info-".concat(t,"--white.png")})}),(0,y.jsx)("h2",{className:iv.headline,children:u})]}),(0,y.jsx)("div",{className:iv.description,children:(0,y.jsx)("p",{children:j})}),(0,y.jsx)(ea,{styles:iv,owner:"BlockChainModalContent",children:(0,y.jsx)("div",{className:iv.linkWrapper,children:(0,y.jsx)(eZ,{href:a,children:(0,y.jsx)(ea,{styles:iv,owner:"BlockChainModalContent",children:(0,y.jsxs)("button",{className:iv.button,children:[(0,y.jsx)(v.FormattedMessage,{id:"component-blockchain-modal-button-website",defaultMessage:"{blockchainLabel} Website",values:{blockchainLabel:u}}),"\xbb"]})})})})})]})})]})})}),iw={backIconContainer:"navModals_backIconContainer__2nknx",closeIconContainer:"navModals_closeIconContainer__2nknx",closeIcon:"navModals_closeIcon__2nknx",noMedia:"navModals_noMedia__2nknx",backIcon:"navModals_backIcon__2nknx",organizationsModal:"navModals_organizationsModal__2nknx",facilitiesModal:"navModals_facilitiesModal__2nknx",productsTypeModal:"navModals_productsTypeModal__2nknx",ingredientModal:"navModals_ingredientModal__2nknx",storyClaimModal:"navModals_storyClaimModal__2nknx",customCertificationsModal:"navModals_customCertificationsModal__2nknx",certificationsModal:"navModals_certificationsModal__2nknx",valuesModal:"navModals_valuesModal__2nknx",recipeModal:"navModals_recipeModal__2nknx",ingredientModalWithNutritionFacts:"navModals_ingredientModalWithNutritionFacts__2nknx",blockchainModal:"navModals_blockchainModal__2nknx",navigationalModalEmbedded:"navModals_navigationalModalEmbedded__2nknx",embedDesktopModal:"navModals_embedDesktopModal__2nknx",modalContent:"navModals_modalContent__2nknx"},ix={modalContent:"storyClaimModalContent_modalContent__xnq7m",modalContent__inner:"storyClaimModalContent_modalContent__inner__xnq7m",iconWrapper:"storyClaimModalContent_iconWrapper__xnq7m",icon:"storyClaimModalContent_icon__xnq7m",icon__claimtype:"storyClaimModalContent_icon__claimtype__xnq7m",headlineWrapper:"storyClaimModalContent_headlineWrapper__xnq7m",headline:"storyClaimModalContent_headline__xnq7m",description:"storyClaimModalContent_description__xnq7m",originalClaimDescription:"storyClaimModalContent_originalClaimDescription__xnq7m",originalDisclaimer:"storyClaimModalContent_originalDisclaimer__xnq7m",section:"storyClaimModalContent_section__xnq7m",claimValues:"storyClaimModalContent_claimValues__xnq7m",verifiedBy:"storyClaimModalContent_verifiedBy__xnq7m",valueMeasurement:"storyClaimModalContent_valueMeasurement__xnq7m",framework:"storyClaimModalContent_framework__xnq7m",methodology:"storyClaimModalContent_methodology__xnq7m"};var iS="/images/icon-certification-value-placeholder.svg";let iO=function(e){var t=e.claimTypeDetail,n=void 0===t?{}:t,r=e.className,o=void 0===r?null:r,i=e.textClassName,a=void 0===i?null:i,l=na(),s=(0,c.useMemo)(function(){if("string"!=typeof(null==n?void 0:n.selectedFramework)||!n.selectedFramework.trim().length)return null;try{var e=l.mrvFrameworks.getByRefId(n.selectedFramework,!0);if(e.id)return e}catch(e){}try{var t=n.mrvFrameworks.find(function(e){return e.refId===n.selectedFramework});if(t.id)return t}catch(e){}return null},[null==l?void 0:l.mrvFrameworks,n]),u=(0,c.useMemo)(function(){if(null==s||!s.id)return iS;try{var e=l.mrvFrameworks.icon(s.id);if(e!==l.mrvFrameworks.fallbackIcon)return e}catch(e){}try{var t,r=n.mrvFrameworks.find(function(e){return e.refId===n.selectedFramework});if("string"==typeof(null==r||null===(t=r.icon)||void 0===t?void 0:t.url)&&r.icon.url.trim().length)return r.icon.url}catch(e){}return iS},[null==s?void 0:s.id,l,n]);if(!s)return null;var d=s.name,f=(0,y.jsxs)("span",{children:["\xa0",(0,y.jsx)("br",{}),"\xa0"]});return(0,y.jsxs)("div",{className:"".concat(null!=o?o:"mrvFramework_container__c8xgk"),children:[(0,y.jsx)("span",{className:"mrvFramework_iconContainer__c8xgk",children:(0,y.jsx)("i",{className:"".concat("mrvFramework_icon__c8xgk"),style:{backgroundImage:"url(".concat(u,")")}})}),(0,y.jsx)("div",{className:null!=a?a:"mrvFramework_text__c8xgk",children:null!=d?d:f})]})};var ik="/images/icon-certification-value-placeholder.svg";let iC=function(e){var t=e.claimTypeDetail,n=void 0===t?{}:t,r=e.className,o=void 0===r?null:r,i=e.textClassName,a=void 0===i?null:i,l=na(),s=(0,c.useMemo)(function(){if("string"!=typeof(null==n?void 0:n.selectedMethodology)||!n.selectedMethodology.trim().length)return null;try{var e=l.mrvMethodologies.getByRefId(n.selectedMethodology,!0);if(e.id)return e}catch(e){}try{var t=n.mrvMethodologies.find(function(e){return e.refId===n.selectedMethodology});if(t.id)return t}catch(e){}return null},[null==l?void 0:l.mrvMethodologies,n]),u=(0,c.useMemo)(function(){if(null==s||!s.id)return ik;try{var e=l.mrvMethodologies.icon(s.id);if(e!==l.mrvMethodologies.fallbackIcon)return e}catch(e){}try{var t,r=n.mrvMethodologies.find(function(e){return e.refId===n.selectedMethodology});if("string"==typeof(null==r||null===(t=r.icon)||void 0===t?void 0:t.url)&&r.icon.url.trim().length)return r.icon.url}catch(e){}return ik},[null==s?void 0:s.id,l,n]);if(!s)return null;var d=s.name,f=(0,y.jsxs)("span",{children:["\xa0",(0,y.jsx)("br",{}),"\xa0"]});return(0,y.jsxs)("div",{className:"".concat(null!=o?o:"mrvMethodology_container__7acj2"),children:[(0,y.jsx)("span",{className:"mrvMethodology_iconContainer__7acj2",children:(0,y.jsx)("i",{className:"".concat("mrvMethodology_icon__7acj2"),style:{backgroundImage:"url(".concat(u,")")}})}),(0,y.jsx)("div",{className:null!=a?a:"mrvMethodology_text__7acj2",children:null!=d?d:f})]})};function iM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var iP={a:eZ,del:r9,h1:r9,h2:r9,h3:r9,h4:r9,h5:r9,h6:r9,img:r9,input:r9,sup:r9,tbody:r9,td:r9,th:r9,thead:r9,tr:r9};let iI=function(e){var t=e.overrideTitle,n=e.overrideDescription,r=e.claimTypeDetail,o=e.showValues,i=e.showMethodology,a=e.showFramework,l=e.showTimeApplicability,s=e.showTitle,u=e.showDescription,d=e.values,f=e.timeApplicability,m=e.title,p=e.description,h=e.media,g=na(),j=(0,v.useIntl)(),_=(0,c.useMemo)(function(){return rU({storyClaim:{claimTypeDetail:r},enums:g,intl:j})},[r,t,g,j]),w=(0,c.useMemo)(function(){return!("string"!=typeof n||!n.trim().length)},[n]),S=(0,c.useMemo)(function(){return!!("string"==typeof n&&n.trim().length||"string"==typeof t&&t.trim().length)},[t,n]),O=(0,c.useMemo)(function(){return function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.storyClaim,o=n.enums,i=void 0===o?{}:o,a=n.intl,l=(void 0===r?{}:r).claimTypeDetail;if("function"==typeof(null==i||null===(e=i.mrvClaimTypes)||void 0===e?void 0:e.getByRefId)){var s=i.mrvClaimTypes.getByRefId(l.mrvClaimType.refId);if("string"==typeof(null==s?void 0:s.description)&&s.description.trim().length)return s.description}return"string"!=typeof(null==l||null===(t=l.mrvClaimType)||void 0===t?void 0:t.description)||""===l.mrvClaimType.description.trim()?a.formatMessage({id:"component-story-claim-no-description",defaultMessage:"No Description"}):l.mrvClaimType.description}({storyClaim:{claimTypeDetail:r},enums:g,intl:j})},[r,g,j]),k=(0,c.useMemo)(function(){return rH({storyClaim:{claimTypeDetail:r,media:h},enums:g})},[r,g,h]),C=(0,c.useMemo)(function(){return rU({storyClaim:{claimTypeDetail:r},overrideTitle:t,enums:g,intl:j})},[r,t,g,j]),M=(0,c.useMemo)(function(){return"string"==typeof n&&n.trim().length?n:O},[O,n]),P=(0,c.useMemo)(function(){if(!o||!Array.isArray(d)||!d.length)return null;var e,t=[],n=void 0,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return iM(e,void 0);var n=({}).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)?iM(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(d);try{for(i.s();!(e=i.n()).done;){var a,l=e.value,s=null===(a=l.measurementType)||void 0===a?void 0:a.refId;s!==n&&(n=s,t.push((0,y.jsx)(rT,{className:ix.valueMeasurement,value:l,claimTypeDetail:r},t.length))),t.push((0,y.jsx)("div",{children:(0,y.jsx)(rB,{className:ix.value,value:l,claimTypeDetail:r,withIcon:!0})},t.length))}}catch(e){i.e(e)}finally{i.f()}return t},[r,o,d]),I=(0,c.useMemo)(function(){return l&&Array.isArray(f)&&2===f.length&&f[0]&&f[1]?f[0]&&f[0]===f[1]?j.formatMessage({id:"story-claim-modal-content-time-applicability-at",defaultMessage:"at {start}"},{start:b()(f[0]).utc().format("LL")}):j.formatMessage({id:"story-claim-modal-content-time-applicability-from",defaultMessage:"From {start} to {end}"},{start:b()(f[0]).utc().format("LL"),end:b()(f[1]).utc().format("LL")}):null},[l,f,j]),N=(0,c.useMemo)(function(){return!!s&&!("string"!=typeof m||!m.trim().length)},[m,s]),T=(0,c.useMemo)(function(){return!!u&&!("string"!=typeof p||!p.trim().length)},[p,u]),L=(0,c.useMemo)(function(){return!(!k||""===k)},[k]),E=(0,c.useMemo)(function(){return a?(0,y.jsx)(iO,{claimTypeDetail:r}):null},[a,r]),z=(0,c.useMemo)(function(){return i?(0,y.jsx)(iC,{claimTypeDetail:r}):null},[i,r]);return(0,y.jsx)(ea,{styles:ix,owner:"StoryClaimModalContent",children:(0,y.jsx)("div",{className:ix.modalContent,children:(0,y.jsxs)("div",{className:ix.modalContent__inner,children:[(0,y.jsxs)("div",{className:ix.headlineWrapper,children:[L&&(0,y.jsx)(ea,{styles:ix,owner:"StoryClaimModalContent",children:(0,y.jsx)("div",{className:ix.iconWrapper,children:(0,y.jsx)(ea,{styles:ix,owner:"StoryClaimModalContent",children:(0,y.jsx)("i",{className:"".concat(ix.icon," ").concat(ix.icon__claimtype),style:{backgroundImage:"url(".concat(k,")")}})})})}),(0,y.jsx)(ea,{styles:ix,owner:"StoryClaimModalContent",children:(0,y.jsx)("h2",{className:ix.headline,children:C})})]}),(0,y.jsx)(ea,{styles:ix,owner:"StoryClaimModalContent",children:(0,y.jsxs)("div",{className:ix.description,children:[(0,y.jsx)("div",{className:ix.framework,children:E}),(0,y.jsx)("div",{className:ix.methodology,children:z}),w?(0,y.jsx)(oe,{content:M,overrides:iP}):M,S&&(0,y.jsxs)("div",{className:ix.originalClaimDescription,children:[(0,y.jsx)("hr",{}),(0,y.jsx)("div",{className:ix.originalDisclaimer,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-original-disclaimer",defaultMessage:"This is the original description of the MRV+ Sustainability Claim"})}),(0,y.jsx)("h2",{className:ix.originalHeadline,children:_}),(0,y.jsx)("div",{className:ix.originalDescription,children:O})]}),null!==I&&(0,y.jsxs)("div",{className:"".concat(ix.timeApplicabilitySection," ").concat(ix.section),children:[(0,y.jsx)("h3",{className:ix.timeApplicabilityHeadline,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-time-applicability-headline",defaultMessage:"Applicability"})}),(0,y.jsx)("div",{className:ix.timeApplicability,children:I})]}),N&&(0,y.jsxs)("div",{className:"".concat(ix.claimTitleSection," ").concat(ix.section),children:[(0,y.jsx)("h3",{className:ix.claimTitleHeadline,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-title-headline",defaultMessage:"Producer supplied Summary"})}),(0,y.jsx)("div",{className:ix.title,children:m})]}),T&&(0,y.jsxs)("div",{className:"".concat(ix.claimDescriptionSection," ").concat(ix.section),children:[(0,y.jsx)("h3",{className:ix.claimDescriptionHeadline,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-description-headline",defaultMessage:"Producer supplied Description"})}),(0,y.jsx)("div",{className:ix.description,children:p})]}),null!==P&&(0,y.jsxs)("div",{className:"".concat(ix.claimValuesSection," ").concat(ix.section),children:[(0,y.jsx)("h3",{className:ix.claimValuesHeadline,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-values-headline",defaultMessage:"Values"})}),(0,y.jsx)("div",{className:ix.values,children:P})]}),(0,y.jsx)("div",{className:ix.verifiedBy,children:(0,y.jsx)(v.FormattedMessage,{id:"story-claim-modal-content-verified by",defaultMessage:"Verified with <link>MRV+</link>",values:{link:function(e){return(0,y.jsx)(x(),{href:"https://producerstrust.com/mrv",scroll:!1,target:"_blank",onClick:function(){eU("Clicked verifiedBy in StoryClaimModalContent",{category:"Engagement",label:"StoryBird StoryClaim"})},children:e})}}})})]})})]})})})};function iN(e){return(iN="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)}var iT=["organizations","facilities","ingredientDescriptions","customCertifications","recipes","nutritionFacts","storyClaims","zIndexDefault","embedded","notDesktopEmbed"],iL=["params"];function iE(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 iz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iE(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=iN(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=iN(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==iN(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iA(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var iF=["certification","value"],iD=e4(function(e){var t=e.children,n=e.onClose,r=e.className,o=e.embedDesktop,i=e.windowWidth,a=e.windowHeight,l=e.portrait,s=e.zIndex,u=e.embedded,d=(0,c.useMemo)(function(){return{width:i,height:a,portrait:l}},[i,a,l]),f=(0,c.useMemo)(function(){return o&&(!u&&eQ.fromTabletWithoutMobileLandscape(d)||u&&eQ.fromMediumSizeEmbed(d))},[u,d]),m=(0,c.useRef)(null);return(0,c.useEffect)(function(){f&&m.current&&(u||window.setTimeout(function(){var e=m.current.getBoundingClientRect();e.top>window.innerHeight?m.current.scrollIntoView({behavior:"smooth"}):window.scrollTo(0,e.top+window.scrollY)},0))},[r,f]),f?(0,y.jsxs)("div",{className:"".concat(iw.embedDesktopModal," ").concat(r),ref:m,style:{zIndex:s},children:[(0,y.jsx)("div",{className:iw.backIconContainer,onClick:n,children:(0,y.jsx)("i",{className:iw.backIcon})}),(0,y.jsx)("div",{className:iw.closeIconContainer,onClick:n,children:(0,y.jsx)(ea,{styles:iw,owner:"NavModal",children:(0,y.jsx)("i",{className:iw.closeIcon})})}),t]}):(0,y.jsxs)(j.Modal,{className:"".concat(null!=r?r:iw.navigationalModal," ").concat(u?iw.navigationalModalEmbedded:""),open:!0,centered:!0,footer:null,mask:!0,maskClosable:!0,closable:!1,onCancel:n,width:"100%",height:"100%",bodyStyle:{padding:0},zIndex:s+20,children:[(0,y.jsx)("div",{className:iw.closeIconContainer,onClick:n,children:(0,y.jsx)(ea,{styles:iw,owner:"NavModal",children:(0,y.jsx)("i",{className:iw.closeIcon})})}),t]})}),iB=function(e){var t={};return e&&Object.keys(e).forEach(function(n){var r;null!==(r=e[n])&&void 0!==r&&r.hyphenatedName&&(t[e[n].hyphenatedName]=n)}),t};let iW=function(e){var t=e.organizations,n=e.facilities,r=e.ingredientDescriptions,o=e.customCertifications,i=e.recipes,a=e.nutritionFacts,l=e.storyClaims,s=e.zIndexDefault,u=void 0===s?997:s,d=e.embedded,f=void 0!==d&&d,m=e.notDesktopEmbed,p=void 0!==m&&m,h=(iA(e,iT),(0,v.useIntl)()),g=(0,c.useMemo)(function(){var e,a,l,s,c,u,d;return _&&_.certificationTypes&&_.values?(a=(e={organizations:t,facilities:n,ingredientDescriptions:r,certifications:_.certificationTypes.map("id",["hyphenatedName"]),values:_.values.map("id",["hyphenatedName"]),recipes:i,customCertifications:o}).facilities,l=e.ingredientDescriptions,s=e.certifications,c=e.values,u=e.recipes,d=e.customCertifications,{organizationsHyphenatedNameMap:iB(e.organizations),facilitiesHyphenatedNameMap:iB(a),ingredientDescriptionHyphenatedNameMap:iB(l),certificationHyphenatedNameMap:iB(s),valueHyphenatedNameMap:iB(c),recipeHyphenatedNameMap:iB(u),customCertificationHyphenatedNameMap:iB(d)}):{}},[t,n,r,i,o,h]),b=g.organizationsHyphenatedNameMap,j=g.facilitiesHyphenatedNameMap,w=g.ingredientDescriptionHyphenatedNameMap,x=g.certificationHyphenatedNameMap,O=g.valueHyphenatedNameMap,k=g.recipeHyphenatedNameMap,C=g.customCertificationHyphenatedNameMap,M=(0,S.useRouter)(),P=M.pathname,I=M.query,N=I.params,T=iA(I,iL);if((0,c.useEffect)(function(){if((null==N?void 0:N.filter(function(e){return iF.includes(e)}).length)>1){var e=window.location.hash;M.push({pathname:P,query:iz(iz({},T),{},{params:N.slice(2)}),hash:e},void 0,{scroll:!1})}},[N,T,M]),N&&N.length>1){for(var L=function(){var e=window.location.hash;M.push({pathname:P,query:iz(iz({},T),{},{params:N.slice(0,-2)}),hash:e},void 0,{scroll:!1})},E=[],z=[],A=[],F=[],D=[],B=[],W=[],R=[],U=[],H=0,q=0,G=null;N[H];)(function(){var e=N[H],t=N[H+1];switch(e){case"facility":"string"==typeof(G=j[t])&&E.push({level:q,id:G}),H+=2;break;case"organization":"string"==typeof(G=b[t])&&z.push({level:q,id:G}),H+=2;break;case"ingredient":"string"==typeof(G=w[t])&&A.push({level:q,id:G}),H+=2;break;case"certification":"string"==typeof(G=x[t])&&F.push({level:q,id:parseInt(G,10)}),H+=2;break;case"customCertification":"string"==typeof(G=C[t])&&D.push({level:q,id:G}),H+=2;break;case"value":"string"==typeof(G=O[t])&&B.push({level:q,id:parseInt(G,10)}),H+=2;break;case"recipe":G=k[t],i&&"string"==typeof G&&W.push({level:q,id:G}),H+=2;break;case"blockchain-info":R.push({id:"blockchain-info-".concat(t),level:q+1,blockchainType:t}),H+=2;break;case"storyClaim":Array.isArray(l)&&U.push({id:"story-claim-".concat(t),level:q+1,storyClaim:l.find(function(e){return t===e.id})}),H+=2;break;default:H++}q++})();var V=0;return(0,y.jsxs)(y.Fragment,{children:[z.map(function(e){var r=e.level,o=e.id;return V++,(0,y.jsx)(iD,{className:iw.organizationsModal,zIndex:r+u,onClose:L,embedded:f,embedDesktop:!0,children:(0,y.jsx)(id,iz(iz({},t[o]),{},{allFacilities:n}))},V)}),E.map(function(e){var r=e.level,o=e.id;return V++,(0,y.jsx)(iD,{className:iw.facilitiesModal,zIndex:r+u,onClose:L,embedded:f,embedDesktop:!p,children:(0,y.jsx)(r1,iz(iz({},n[o]),{},{organization:t[n[o].organization],storyClaims:l}))},V)}),A.map(function(e){var t=e.level,n=e.id;V++;var o=r[n].media&&r[n].media.length;return(0,y.jsx)(iD,{className:"".concat(a?iw.ingredientModalWithNutritionFacts:iw.ingredientModal," ").concat(o?"":iw.noMedia),zIndex:t+u,onClose:function(e){document.body.style.overflow="unset",L()},embedded:f,children:(0,y.jsx)(oG,iz(iz({},r[n]),{},{nutritionFacts:a}))},V)}),F.map(function(e){var t=e.level,n=e.id;if(V++,!_.certificationTypes.exists(n))return null;var r=_.certificationTypes.hasMedia(n);return(0,y.jsx)(iD,{className:"".concat(iw.certificationsModal," ").concat(r?"":iw.noMedia),zIndex:t+u,onClose:L,embedded:f,children:(0,y.jsx)(oP,{certification:n})},V)}),D.map(function(e){var t=e.level,n=e.id;return V++,(0,y.jsx)(iD,{className:iw.customCertificationsModal,zIndex:t+u,onClose:L,embedded:f,children:(0,y.jsx)(oT,iz({},o[n]))},V)}),B.map(function(e){var t=e.level,n=e.id;if(V++,!_.values.exists(n))return null;var r=_.values.hasMedia(n);return(0,y.jsx)(iD,{className:"".concat(iw.valuesModal," ").concat(r?"":iw.noMedia),zIndex:t+u,onClose:L,embedded:f,children:(0,y.jsx)(ih,{value:n})},V)}),W.map(function(e){var t,n,r=e.level,o=e.id;V++;var a=(null===(t=i[o])||void 0===t?void 0:t.media)&&(null===(n=i[o])||void 0===n||null===(n=n.media)||void 0===n?void 0:n.length);return(0,y.jsx)(iD,{className:"".concat(iw.recipeModal," ").concat(a?"":iw.noMedia),zIndex:r+u,onClose:L,embedded:f,children:(0,y.jsx)(ip,iz({},i[o]))},V)}),R.map(function(e){var t=e.level,n=(e.id,e.blockchainType);return V++,(0,y.jsx)(iD,{className:iw.blockchainModal,zIndex:t+u,onClose:L,embedded:f,children:(0,y.jsx)(i_,{blockchainType:n})},V)}),U.map(function(e){var t=e.level,n=e.storyClaim;return V++,(0,y.jsx)(iD,{className:iw.storyClaimModal,zIndex:t+u,onClose:L,embedded:f,children:(0,y.jsx)(iI,iz({},n))},V)})]})}return null};var iR=/^(?=.{1,256})(?=.{1,64}@.{1,255}$)(?=\S)(?:(?!@)[\w&'*+._%~-]+(?:(?<=\S)\\)(?:(?!@)[\w&'*+._%~-]+)*)?(?:(?!@)[\w&'*+._%~-]+(?:(?<=\S)-)(?:(?!@)[\w&'*+._%~-]+)*)?(?:(?!@)[\w&'*+._%~-]+(?:(?<=\S)')(?:(?!@)[\w&'*+._%~-]+)*)?(?:(?!@)[\w&'*+._%~-]+(?:(?<=\S)\.(?:(?!@)[\w&'*+._%~-]+)+)*)?@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;function iU(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return iH(e,t);var n=({}).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)?iH(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var iq=function(e){var t=e.type,n=e.message,r=e.description;j.notification[t]({message:n,description:r,placement:"bottomRight",bottom:50})};let iG=function(e){var t=e.customElId,n=e.newsletterUrl,r=(0,v.useIntl)(),o=iU((0,c.useState)(""),2),i=o[0],a=o[1],l=iU((0,c.useState)("idle"),2),s=l[0],u=l[1],d=(0,c.useCallback)(function(e){if(n){u("sending");try{ew().post(n,{email:e}).then(function(){a(""),u("success"),iq({type:"success",message:r.formatMessage({id:"notifications-success-newsletter-subscription-title",defaultMessage:"You have been successfully subscribed."}),description:r.formatMessage({id:"notifications-success-newsletter-subscription-description",defaultMessage:"Please confirm your subscription via your email inbox!"})})}).catch(function(e){iq({type:"error",message:r.formatMessage({id:"notifications-error-newsletter-subscription-title",defaultMessage:"Error while subscribing to the newsletter."}),description:r.formatMessage({id:"notifications-error-newsletter-subscription-description",defaultMessage:"Please try again later!"})}),console.error("Error: catch subscribe",e),u("error")})}catch(e){u("error"),console.error("Error:",e)}}},[r,n]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(j.Form,{id:t,className:"newsletterForm_newsletter__sk9ys",layout:"inline",requiredMark:!1,onFinish:function(){return d(i)},children:[(0,y.jsx)(j.Form.Item,{className:"newsletterForm_email_item__sk9ys",name:"email",rules:[{required:!0,message:r.formatMessage({id:"forms-validation-invalid-email",defaultMessage:"Please enter a valid email address"})},{type:"email",message:r.formatMessage({id:"forms-validation-invalid-email",defaultMessage:"Please enter a valid email address"})},{pattern:{emailRegex:iR},message:r.formatMessage({id:"forms-validation-invalid-email",defaultMessage:"Please enter a valid email address"})}],children:(0,y.jsx)(j.Input,{className:"newsletterForm_input_item__sk9ys",autoComplete:"email",placeholder:r.formatMessage({id:"forms-placeholder-your-email",defaultMessage:"Your email address"}),value:i,onChange:function(e){return a(e.target.value)},disabled:!n})}),(0,y.jsx)(j.Form.Item,{className:"newsletterForm_button_item__sk9ys",children:(0,y.jsx)(j.Button,{className:"newsletterForm_button__sk9ys",htmlType:"submit",disabled:!n||"sending"===s,children:"sending"===s?(0,y.jsx)(v.FormattedMessage,{id:"forms-newsletter-subscribe-btn-sending",defaultMessage:"Sending..."}):(0,y.jsx)(v.FormattedMessage,{id:"forms-newsletter-subscribe-btn-subscribe",defaultMessage:"Subscribe"})})})]}),(0,y.jsx)("p",{className:"newsletterForm_archive_link__sk9ys",children:(0,y.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://producersmarket.com/blog/newsletters",description:"Footer nav link for Producers Market blog",children:[(0,y.jsx)(v.FormattedMessage,{id:"forms-newsletter-archive-link-label",description:"Footer Newsletter Form Archive Link",defaultMessage:"See the archives of past issues"}),(0,y.jsx)(rC.DoubleRightOutlined,{})]})})]})};var iV="default",iZ={organization:"organization",product:"product",smallFarmer:"smallFarmer"},iY=function(e){var t=e.hyphenatedName,n=e.id,r=e.itemType;return"/".concat(iZ[r],"/").concat(t,"-").concat(n)};let iJ="cardItemCertifications_imgLabelListItem__3ra1r",i$=function(e){var t=e.itemCertifications,n=na().certificationTypes.enumValues;return!Array.isArray(t)||!Array.isArray(n)||!t.length>0||!n.length>0?null:(0,y.jsxs)("ul",{className:"cardItemCertifications_imgLabelList__3ra1r",children:[t.map(function(e,t){return t<3?n.filter(function(t){return t.refId===e}).map(function(e){var t,n;return(0,y.jsx)("li",{className:iJ,children:(0,y.jsx)(f(),{src:null!==(t=null===(n=e.icon)||void 0===n?void 0:n.url)&&void 0!==t?t:"/images/icon-certification-value-placeholder.svg",alt:e.name,width:36.5,height:36.5})},e.id)}):null}),t.length>3&&(0,y.jsxs)("li",{className:"".concat(iJ," ").concat("cardItemCertifications_extraCount__3ra1r"),children:["+",t.length-3]})]})},iQ=function(e){var t=e.item,n=e.handleImageClick,r=(0,c.useMemo)(function(){return t.dateCreated>1e3*b()().subtract(1,"months").unix()},[null==t?void 0:t.dateCreated]);return(0,y.jsxs)("div",{className:"cardItemBannerInner_imgWrapper__5db4e",onClick:n||void 0,children:[(0,y.jsx)(i$,{itemCertifications:t.certifications}),r&&(0,y.jsx)("div",{className:"cardItemBannerInner_badge__5db4e",children:(0,y.jsx)(v.FormattedMessage,{id:"component-card-item-banner-new",defaultMessage:"New"})})]})};function iK(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return iX(e,void 0);var n=({}).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)?iX(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function iX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var i0={organization:"/images/components/banner/placeholder-banner.png",product:"/images/components/products/placeholder-product.png",smallFarmer:"/images/components/banner/placeholder-farmer.png"};function i1(e,t){var n=new URL(e);return n.searchParams.get("auto")||n.searchParams.set("auto","compress,format"),n.searchParams.set("width",t.width),n.toString()}var i2=function(e){var t,n,r=e.itemType,o=e.media,i=e.options,a=void 0===i?{width:800}:i;if(!Array.isArray(o))return i0[r];var l,s=iK(o);try{for(s.s();!(l=s.n()).done;){var c=l.value;if((null==c?void 0:c.mediaType)===m.mediaTypes.image)return i1(c.url,a)}}catch(e){s.e(e)}finally{s.f()}var u,d=iK(o);try{for(d.s();!(u=d.n()).done;){var f=u.value;if((null==f?void 0:f.mediaType)===m.mediaTypes.video)return f.thumbUrl}}catch(e){d.e(e)}finally{d.f()}var p=Array.isArray(o)&&o[0];if(null!=p&&p.url&&null!=p&&null!==(t=p.params)&&void 0!==t&&null!==(t=t.image)&&void 0!==t&&t.rect){var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.params.image,r=n.rect,o=n.fit,i=n.auto,a=r.x1,l=r.x2,s=r.y1,c=r.y2;return"?rect=".concat(a,",").concat(l,",").concat(s,",").concat(c,"&fit=").concat(o,"&auto=").concat(i).concat(t?"&w=".concat(t):"")}(p);return"".concat(p.url).concat(y)}return null==p||!p.url||null!=p&&null!==(n=p.params)&&void 0!==n&&null!==(n=n.image)&&void 0!==n&&n.rect?i0[r]:i1(p.url,a)};let i5={fromModalEmbed:"storyBirdEmbed_fromModalEmbed__duaeu",fromProductProfile:"storyBirdEmbed_fromProductProfile__duaeu",default:"storyBirdEmbed_default__duaeu"};var i8,i4,i3,i6,i9,i7,ae=null!==(i7=r.env.NEXT_PUBLIC_STORYBIRD_URL)&&void 0!==i7?i7:"https://storybird.io",at=function(e){var t;return null!==(t=i5[e])&&void 0!==t?t:i5.default};let an=function(e){var t=e.embedType,n=e.minHeight,r=e.customClass,o=e.product,i=e.locale,a=(0,c.useMemo)(function(){return n?{minHeight:n}:{}},[n]),l=(0,c.useMemo)(function(){return i?"?lang=".concat(i):""},[i]),s=(0,c.useMemo)(function(){return"".concat(ae,"/embed/").concat(null!=t?t:"full","/").concat(null==o?void 0:o.storyUuid).concat(l)},[t,null==o?void 0:o.storyUuid,l]);return null!=o&&o.storyUuid?(0,y.jsx)("div",{className:at(r),style:a,children:(0,y.jsx)("iframe",{width:"100%",height:"100%",frameBorder:"0",scrolling:"no",src:s})}):null},ar=function(e){var t=e.product,n=e.storybirdModal,r=e.setStorybirdModal,o=e.productLinkPath,i=e.routerParam;return(0,y.jsxs)(j.Modal,{className:"storyBirdEmbedModal_modal__zgd9y",open:n,center:!0,footer:null,onCancel:function(){return r(!1)},closeIcon:(0,y.jsx)("i",{className:"storyBirdEmbedModal_closeIcon__zgd9y"}),maskClosable:!1,children:[(0,y.jsx)("h4",{className:"storyBirdEmbedModal_head__zgd9y",children:(0,y.jsx)(v.FormattedMessage,{id:"component-storybird-embed-modal-storybird-journey",defaultMessage:"StoryBird Journey"})}),(0,y.jsx)("h1",{className:"storyBirdEmbedModal_title__zgd9y",children:t.name}),(0,y.jsx)(an,{customClass:"fromModalEmbed",product:t,minHeight:"480px"}),(0,y.jsx)("div",{className:"storyBirdEmbedModal_viewButton__zgd9y",children:(0,y.jsx)(ou,{onClick:function(){return eU("storybird_modal_view_product",{productId:t.id,productName:t.name})},to:o,routerParam:void 0===i?null:i,children:(0,y.jsx)(j.Button,{type:"primary",className:"storyBirdEmbedModal_button__zgd9y",children:(0,y.jsx)(v.FormattedMessage,{id:"component-storybird-embed-modal-view-product",defaultMessage:"View Product"})})})})]})},ao={imgWrapper:"cardItemBanner_imgWrapper__arqcq",organizationAffiliatesCard:"cardItemBanner_organizationAffiliatesCard__arqcq",organizationCardImgWrapper:"cardItemBanner_organizationCardImgWrapper__arqcq",featuredMembersCard:"cardItemBanner_featuredMembersCard__arqcq",featuredMembersCarousel:"cardItemBanner_featuredMembersCarousel__arqcq",infowindowOrgItem:"cardItemBanner_infowindowOrgItem__arqcq",statusUnpublished:"cardItemBanner_statusUnpublished__arqcq",storybirdContainer:"cardItemBanner_storybirdContainer__arqcq",storybirdButton:"cardItemBanner_storybirdButton__arqcq",storybirdText:"cardItemBanner_storybirdText__arqcq"};function ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let aa=function(e){var t,n=e.item,r=e.itemLinkPath,o=void 0===r?null:r,i=e.itemType,a=void 0===i?iZ.organization:i,l=e.handleImageClick,s=void 0===l?function(){}:l,u=e.mode,d=void 0===u?iV:u,m=e.routerParam,p=void 0===m?null:m,h=e.withRedirect,g=void 0===h||h,b=e.customClass,j=void 0===b?null:b,_=(0,v.useIntl)().locale,w=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return ai(e,2);var n=({}).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)?ai(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=w[0],S=w[1],O=(0,c.useMemo)(function(){var e=n.media;return a===iZ.organization&&null!=n&&n.banner&&(e=Array.isArray(n.banner)?n.banner:[n.banner]),i2({media:e,itemType:a})},[n.banner,n.media,a]);return(0,y.jsxs)("div",{style:{backgroundImage:"url(".concat(O,")"),backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},className:j?ao[aj[j]]:ao.organizationCardImgWrapper,children:["preview"===d&&n.publishedUser&&(0,y.jsx)("div",{className:ao.statusUnpublished,children:(0,y.jsx)(v.FormattedMessage,{id:"component-card-item-banner-unpublished-label",description:"Unpublished label for the org grid item",defaultMessage:"Unpublished"})}),o&&g?(0,y.jsx)(ou,{locale:_,to:o,onClick:s,routerParam:p,children:(0,y.jsx)(iQ,{item:n})}):(0,y.jsx)(iQ,{item:n,handleImageClick:g?null:s}),n.storyUuid&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:ao.storybirdContainer,children:(0,y.jsxs)("div",{onClick:function(){S(!0)},className:ao.storybirdButton,children:[(0,y.jsx)(f(),{src:"/images/logos/producers-hummingbird-white.png",alt:"Producers Market Logo",width:15,height:16}),(0,y.jsx)("div",{className:ao.storybirdText,children:(0,y.jsx)(v.FormattedMessage,{id:"component-card-item-banner-see-the-journey",description:"Unpublished label for the product grid item",defaultMessage:"See the Journey"})})]})}),x&&(0,y.jsx)(ar,{product:n,storybirdModal:x,setStorybirdModal:S,productLinkPath:o,routerParam:p})]})]})},al=n(18975);var as=a.n(al);let ac=n(41086);var au=a.n(ac);let ad=n(6655);var af=a.n(ad);as().registerLocale(au()),as().registerLocale(af());let am=function(e){var t,n=e.countryCode,r=(0,v.useIntl)().locale,o=as().getNames(r);return(0,y.jsx)("span",{children:null!==(t=o[n])&&void 0!==t?t:null})},ap=function(e){var t=e.countryCode,n=e.countyStateProvince,r=(0,v.useIntl)().locale,o=(0,c.useMemo)(function(){return ru({countryCode:t,countyStateProvince:n,locale:r})},[t,n,r]);return(0,y.jsx)("span",{children:o?o+", ":null})},ay=function(e){var t,n,r=e.facility,o=e.showOriginText,i=(0,c.useMemo)(function(){var e;return null==r||null===(e=r.location)||void 0===e||null===(e=e.countryCode)||void 0===e?void 0:e.toUpperCase()},[null==r||null===(t=r.location)||void 0===t?void 0:t.countryCode]),a=(0,c.useMemo)(function(){var e;return null==r||null===(e=r.location)||void 0===e?void 0:e.state},[null==r||null===(n=r.location)||void 0===n?void 0:n.state]);return(0,y.jsxs)("div",{className:"cardItemLocation_placeWrapper__1fgya",children:[i&&(0,y.jsx)("span",{className:"cardItemLocation_metaFlag__1fgya",children:(0,y.jsx)(o0(),{countryCode:i,svg:!0})}),a||i?(0,y.jsxs)("span",{className:"cardItemLocation_place__1fgya",children:[void 0!==o&&o&&(0,y.jsxs)("span",{className:"cardItemLocation_origin__1fgya",children:[(0,y.jsx)(v.FormattedMessage,{id:"misc.words.origin",defaultMessage:"Origin"}),":"]}),(0,y.jsx)(ap,{countryCode:i,countyStateProvince:a}),i&&(0,y.jsx)(am,{countryCode:i})]}):null]})},ah=function(e){var t=e.itemProductTypes,n=na().productTypes.enumValues,r=(0,c.useMemo)(function(){return Array.isArray(t)&&t.length>0?Array.from(new Set(t)):[]},[t]);return!Array.isArray(n)||!n.length>0||!r.length>0?null:(0,y.jsx)("ul",{children:r.map(function(e){return n.filter(function(t){return t.refId===e}).map(function(e,t){return(0,y.jsx)("li",{children:e.name},t)})})})};function av(e){var t=e.areaTotalCultivated,n=e.areaTotalForested,r=e.areaTotalOther,o=e.areaTotal;return!!(!isNaN(t)&&Number(t)>0||!isNaN(n)&&Number(n)>0||!isNaN(r)&&Number(r)>0||!isNaN(o)&&Number(o)>0)}let ag=function(e){var t=e.organization,n=t.areaTotalCultivated,r=t.areaTotalForested,o=t.areaTotalOther,i=t.areaTotal,a=(0,c.useMemo)(function(){var e=0;return Number(i)>0?e=i:Number(r)>0?e=r:Number(n)>0?e=n:Number(o)>0&&(e=o),Number(e)/1e4},[i,r,n,o]);return a?(0,y.jsx)(v.FormattedNumber,{value:a,style:"unit",unit:"hectare",unitDisplay:"long"}):null},ab={infowindowOrgItem:"organizationCard_infowindowOrgItem__wejb1",featuredMembersCard:"organizationCard_featuredMembersCard__wejb1",featuredMembersCarousel:"organizationCard_featuredMembersCarousel__wejb1",organizationAffiliatesCard:"organizationCard_organizationAffiliatesCard__wejb1",organizationCard:"organizationCard_organizationCard__wejb1",orgGridItem:"organizationCard_orgGridItem__wejb1",content:"organizationCard_content__wejb1",body:"organizationCard_body__wejb1",name:"organizationCard_name__wejb1",affiliatedProducersWrapper:"organizationCard_affiliatedProducersWrapper__wejb1",totalGrowingAreaWrapper:"organizationCard_totalGrowingAreaWrapper__wejb1",productTypeWrapper:"organizationCard_productTypeWrapper__wejb1",countHighlight:"organizationCard_countHighlight__wejb1",value:"organizationCard_value__wejb1"};var aj={"featured-members-card":"featuredMembersCard","featured-members-carousel":"featuredMembersCarousel","infowindow-org-item":"infowindowOrgItem","organization-affiliates-card":"organizationAffiliatesCard"};let a_=function(e){var t=e.organization,n=e.customClass,r=void 0===n?null:n,o=e.mode,i=e.onOrgCardClick,a=void 0===i?function(){}:i,l=e.routerParam,s=void 0===l?null:l,u=e.index,d=void 0===u?null:u,f=e.withRedirect,m=void 0===f||f,p=(0,v.useIntl)().locale,h=na().productTypes.enumValues,g=(0,c.useCallback)(function(){return a({orgId:t.id,index:d})},[d,t.id,a]),b=(0,c.useMemo)(function(){return iY({hyphenatedName:t.hyphenatedName,id:t.id,itemType:iZ.organization})},[t.hyphenatedName,t.id]),j=(0,c.useMemo)(function(){return"".concat(ab.orgGridItem," ").concat(r?ab[aj[r]]:ab.organizationCard)},[r]),_=(0,c.useMemo)(function(){return"number"==typeof(null==t?void 0:t.numberMembers)&&t.numberMembers>0||"number"==typeof(null==t?void 0:t.affiliationsCount)&&t.affiliationsCount>0},[t]),w=(0,c.useMemo)(function(){var e;return(null==t||null===(e=t.productTypes)||void 0===e?void 0:e.length)>0&&(null==t?void 0:t.productCount)>0&&h&&"function"==typeof(null==h?void 0:h.filter)},[t,h]),x=(0,c.useMemo)(function(){return m?(0,y.jsx)(ou,{locale:p,to:"".concat(b,"#product-anchor"),target:"_blank",rel:"noopener norefferer",onClick:g,routerParam:s,children:(0,y.jsxs)("span",{className:ab.countHighlight,children:["(",t.productCount,")"]})}):(0,y.jsxs)("span",{className:ab.countHighlight,children:["(",t.productCount,")"]})},[p,g,b,t.productCount,s,m]),S=(0,c.useMemo)(function(){var e=0;return"number"==typeof(null==t?void 0:t.numberMembers)&&t.numberMembers>0&&(e=t.numberMembers),"number"==typeof(null==t?void 0:t.affiliationsCount)&&t.affiliationsCount>0&&(e=t.affiliationsCount),(0,y.jsxs)("span",{className:ab.countHighlight,children:["(",e,")"]})},[t]),O=av(t);return(0,y.jsx)("div",{className:j,children:(0,y.jsxs)("div",{className:ab.content,children:[(0,y.jsx)(aa,{item:t,itemLinkPath:m?b:null,withRedirect:m,itemType:iZ.organization,handleImageClick:g,mode:void 0===o?iV:o,routerParam:s,customClass:r}),(0,y.jsxs)("div",{className:ab.body,children:[m?(0,y.jsx)(ou,{locale:p,to:b,onClick:g,routerParam:s,children:(0,y.jsx)("div",{className:ab.name,children:t.name})}):(0,y.jsx)("div",{onClick:g,className:ab.name,children:t.name}),(0,y.jsx)(ay,{facility:t.facility}),_&&(0,y.jsx)("div",{className:ab.affiliatedProducersWrapper,children:(0,y.jsx)("b",{children:(0,y.jsx)(v.FormattedMessage,{id:"card-organization-affiliations-count",defaultMessage:"Affiliated Producers {numberMembers}",values:{numberMembers:S}})})}),O&&(0,y.jsxs)("div",{className:ab.totalGrowingAreaWrapper,children:[(0,y.jsxs)("b",{children:[(0,y.jsx)(v.FormattedMessage,{id:"card-organization-growing-area",defaultMessage:"Total Growing Area"}),":"]}),(0,y.jsx)("span",{className:ab.value,children:(0,y.jsx)(ag,{organization:t})})]}),w&&(0,y.jsxs)("div",{className:ab.productTypeWrapper,children:[(0,y.jsxs)("b",{children:[(0,y.jsx)(v.FormattedMessage,{id:"card-organization-product-count",defaultMessage:"Products {productCount}",values:{productCount:x}}),":"]})," ",(0,y.jsx)(ah,{itemProductTypes:t.productTypes})]})]})]})})};var aw=a(967),ax=a.n(aw);let aS={originNavSlider:"originNavSlider_originNavSlider__fbz4x",containerWrapper:"originNavSlider_containerWrapper__fbz4x",fixedToTop:"originNavSlider_fixedToTop__fbz4x",container:"originNavSlider_container__fbz4x",headline:"originNavSlider_headline__fbz4x",headlineEmbedded:"originNavSlider_headlineEmbedded__fbz4x",originsContainer:"originNavSlider_originsContainer__fbz4x",originSlide:"originNavSlider_originSlide__fbz4x",originSlide__inner:"originNavSlider_originSlide__inner__fbz4x",originSlidePicture:"originNavSlider_originSlidePicture__fbz4x",originName:"originNavSlider_originName__fbz4x",selected:"originNavSlider_selected__fbz4x",originsContainerEmbedded:"originNavSlider_originsContainerEmbedded__fbz4x",originsContainerEmbeddedInMap:"originNavSlider_originsContainerEmbeddedInMap__fbz4x",containerWrapperEmbedded:"originNavSlider_containerWrapperEmbedded__fbz4x"};function aO(e){return(aO="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)}function ak(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 aC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ak(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=aO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=aO(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==aO(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ak(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aM(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let aP=function(e){var t,n=e.origins,r=e.products,o=e.onChange,i=void 0===o?function(){return console.warn("OriginNavSlider::onChange not set")}:o,a=e.selectedOrigin,l=void 0===a?0:a,s=e.containerRef,u=e.mapIsExpanded,d=e.stickyTo,f=e.stickyOptions,m=e.enableSticky,p=void 0===m||m,h=e.onStickyInitDestroy,g=e.embedded,b=void 0!==g&&g,j=e.embeddedInMap,_=void 0!==j&&j,w=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return aM(e,2);var n=({}).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)?aM(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=w[0],S=w[1];return(0,c.useEffect)(function(){var e;if(p)return d1=new(ax())(".".concat(aS.originNavSlider),aC(aC({stickyContainer:d,wrap:!0},f),{},{onChange:function(e){var t=e.sticky,n=e.bottom;S(!(!t&&!n)),f.onChange&&f.onChange({sticky:t,bottom:n})}})),h&&h(d1),function(){d1.destroy(),d1=void 0,h&&h()};null===(e=d1)||void 0===e||e.destroy(),d1=void 0,h&&h()},[p]),(0,y.jsx)("div",{className:"".concat(aS.originNavSlider,"\n      ").concat(x?aS.fixedToTop:"","\n      ").concat(u?aS.withExpandedMap:""),onTransitionEnd:function(){d1&&d1.update()},ref:s,children:(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:"".concat(aS.containerWrapper," ").concat(b?aS.containerWrapperEmbedded:""," ").concat(_?aS.containerWrapperEmbeddedInMap:""," ").concat(x?aS.fixedToTop:""),children:(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsxs)("div",{className:"".concat(aS.container," container"),children:[(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:aS.headlineWrapper,children:(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("h2",{className:"".concat(aS.headline," ").concat(b?aS.headlineEmbedded:""),children:(0,y.jsx)(v.FormattedMessage,{id:"components-originNavSlider-heading",defaultMessage:"Origins"})})})})}),(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:"".concat(aS.originsContainer," ").concat(b?aS.originsContainerEmbedded:""," ").concat(_?aS.originsContainerEmbeddedInMap:""),children:n.map(function(e,t){var n=r[e],o=n.media,a=n.name;return null!=o&&o.length||console.warn("Media for ",e," is missing."),(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:"".concat(aS.originSlide," ").concat(l===e?aS.selected:""),onClick:function(){i(e),eU("Clicked origin selection",{category:"Engagement",label:"Product profile",value:e})},children:(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsxs)("div",{className:aS.originSlide__inner,children:[(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:aS.originSlidePicture,style:{backgroundImage:"url(".concat(o&&o[0]?o[0].url:"/images/image-placeholder--grey.svg",")")}})}),(0,y.jsx)(ea,{styles:aS,owner:"OriginNavSlider",children:(0,y.jsx)("div",{className:aS.originName,children:a})})]})})})},t)})})})]})})})})})},aI={container:"blockChainProofLink_container__55pn7",selected:"blockChainProofLink_selected__55pn7",embedded:"blockChainProofLink_embedded__55pn7",blockchainNotVerified:"blockChainProofLink_blockchainNotVerified__55pn7",verifiedIcon:"blockChainProofLink_verifiedIcon__55pn7",pendingIcon:"blockChainProofLink_pendingIcon__55pn7",errorIcon:"blockChainProofLink_errorIcon__55pn7",rightShiftIcon:"blockChainProofLink_rightShiftIcon__55pn7",arrowIconDown:"blockChainProofLink_arrowIconDown__55pn7",arrowIconUp:"blockChainProofLink_arrowIconUp__55pn7"};function aN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let aT=function(e){var t,n=e.locale,r=e.event,o=e.selected,i=e.embedded,a=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return aN(e,2);var n=({}).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)?aN(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],s=a[1],u=(null==r?void 0:r.blockchainStatus)===m.blockchainState.verified?(0,y.jsx)("span",{className:"".concat(r.blockchainStatus),children:(0,y.jsxs)("a",{onClick:function(){s(!l),eU(l?"Clicked close blockchain detail":"Clicked open blockchain detail",{category:"Navigation",label:"Events timeline"})},className:aI.boldLink,children:[(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofLink",children:(0,y.jsx)("i",{className:aI.verifiedIcon})}),(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainproofdetail-txt-text",defaultMessage:"See data traced on the blockchain"}),(0,y.jsx)(function(e){var t=e.expanded;return(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofDetail",children:(0,y.jsx)("i",{className:"".concat(t?aI.arrowIconUp:aI.arrowIconDown)})})},{expanded:l,type:"button"})]})}):(null==r?void 0:r.blockchainStatus)===m.blockchainState.pending?(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofLink",children:(0,y.jsxs)("span",{className:"".concat(aI.blockchainNotVerified," ").concat(r.blockchainStatus),children:[(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofLink",children:(0,y.jsx)("i",{className:aI.pendingIcon})}),(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainprooflink-loading-blockchain-data",defaultMessage:"Loading Blockchain data"})]})}):(null==r?void 0:r.blockchainStatus)===m.blockchainState.error?(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofLink",children:(0,y.jsxs)("span",{className:"".concat(aI.blockchainNotVerified," ").concat(r.blockchainStatus),children:[(0,y.jsx)(ea,{styles:aI,owner:"BlockChainProofLink",children:(0,y.jsx)("i",{className:aI.errorIcon})}),(0,y.jsx)(v.FormattedMessage,{id:"component-blockchainprooflink-blockchain-data-unavailable",defaultMessage:"Blockchain data unavailable"})]})}):null;return u?(0,y.jsxs)(ea,{styles:aI,owner:"BlockChainProofLink",children:[(0,y.jsx)("div",{className:"".concat(aI.container," ").concat(void 0!==o&&o?aI.selected:""," ").concat(void 0!==i&&i?aI.embedded:""),children:u}),l?(0,y.jsx)(ej,{locale:n,event:r}):null]}):null},aL={storyClaimProofDetail:"storyClaimProofDetail_storyClaimProofDetail__jwut9",descriptionsTable:"storyClaimProofDetail_descriptionsTable__jwut9",label:"storyClaimProofDetail_label__jwut9",labelOnly:"storyClaimProofDetail_labelOnly__jwut9",claimTitle:"storyClaimProofDetail_claimTitle__jwut9",value:"storyClaimProofDetail_value__jwut9",valueLink:"storyClaimProofDetail_valueLink__jwut9",imageLinkContainer:"storyClaimProofDetail_imageLinkContainer__jwut9"};function aE(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return az(e,void 0);var n=({}).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)?az(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function az(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aA(e){var t=e.field,n=(0,c.useMemo)(function(){var e;return void 0===(null==t?void 0:t.value)?null:(0,y.jsx)(ea,{styles:aL,owner:"StoryClaimProofDetail",children:(0,y.jsx)("span",{className:null!==(e=t.styles)&&void 0!==e?e:aL.value,children:t.value})})},[t]);return n?(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{children:(0,y.jsx)(ea,{styles:aL,owner:"StoryClaimProofDetail",children:(0,y.jsx)("span",{className:aL.label,children:t.name})})}),(0,y.jsx)("td",{children:n})]}):(0,y.jsx)("tr",{children:(0,y.jsx)("th",{colSpan:2,children:(0,y.jsxs)("span",{className:aL.labelOnly,children:[t.image?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("span",{className:aL.imageLinkContainer,children:[(0,y.jsx)(F,{path:"/storyClaim/".concat(t.id),children:(0,y.jsx)(f(),{src:t.image,width:89,height:12,alt:"story claim proof detail"})}),"\xa0"]})}):null,(0,y.jsx)("span",{children:t.name})]})})})}function aF(e){var t=e.fields,n=(0,c.useMemo)(function(){return t.map(function(e,t){return(0,y.jsx)(aA,{field:e},t)})},[t]);return Array.isArray(t)?(0,y.jsx)(ea,{styles:aL,owner:"StoryClaimProofDetail",children:(0,y.jsx)("div",{className:aL.descriptionsTable,children:n})}):null}let aD=function(e){var t=e.storyClaims,n=na(),r=(0,v.useIntl)(),o=(0,c.useMemo)(function(){var e=[];if(!Array.isArray(t))return e;var o,i=aE(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(e.push({name:rU({storyClaim:a,enums:n,intl:r}),image:"/images/logos/logo-mrvplus.png",id:a.id,styles:aL.claimTitle}),a.showValues&&Array.isArray(a.values)&&a.values.length){var l,s=void 0,c=aE(a.values);try{for(c.s();!(l=c.n()).done;){var u,d=l.value,f=null===(u=d.measurementType)||void 0===u?void 0:u.refId;f!==s&&(s=f,e.push({name:(0,y.jsx)(rT,{className:aL.valueMeasurement,value:d,claimTypeDetail:a.claimTypeDetail})})),e.push({name:(0,y.jsx)(rB,{className:aL.value,value:d,claimTypeDetail:a.claimTypeDetail,nameOnly:!0}),value:(0,y.jsx)(rB,{className:aL.value,value:d,claimTypeDetail:a.claimTypeDetail,valueOnly:!0})})}}catch(e){c.e(e)}finally{c.f()}}}}catch(e){i.e(e)}finally{i.f()}return e},[t,n,r]);return(0,y.jsx)("table",{className:aL.storyClaimProofDetail,children:(0,y.jsx)(aF,{fields:o})})};function aB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let aW=function(e){var t,n=e.locale,r=e.event,o=e.selected,i=e.embedded,a=e.storyClaims,l=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return aB(e,2);var n=({}).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)?aB(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],u=l[1],d=(0,c.useMemo)(function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.storyClaims,n=void 0===t?[]:t,r=e.event,o=void 0===r?null:r;if(!Array.isArray(n)||!o||"object"!==rW(o))return[];var i=[];o.facility?i.push(o.facility):(o.sourceFacility&&i.push(o.sourceFacility),o.destinationFacility&&i.push(o.destinationFacility));for(var a=[],l=0;l<i.length;l++)(function(){var e=i[l];if("string"==typeof e&&e.trim().length){var t=n.reduce(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.showWithEvent&&("string"!=typeof n.facility||n.facility!==e||t.push(n)),t},[]);a=a.concat(t)}})();return a}({storyClaims:a,event:r})},[a,r]);return(0,c.useMemo)(function(){return!!d.length},[d])?(0,y.jsxs)(ea,{styles:aI,owner:"StoryClaimProofLink",children:[(0,y.jsx)("div",{className:"".concat(aI.container," ").concat(void 0!==o&&o?aI.selected:""," ").concat(void 0!==i&&i?aI.embedded:""),children:(0,y.jsx)("span",{className:"".concat(r.blockchainStatus),children:(0,y.jsxs)("a",{onClick:function(){u(!s),eU(s?"Clicked close story-claim detail":"Clicked open story-claim detail",{category:"Navigation",label:"Events timeline"})},className:aI.boldLink,children:[(0,y.jsx)(ea,{styles:aI,owner:"StoryClaimProofLink",children:(0,y.jsx)("i",{className:aI.verifiedIcon})}),(0,y.jsx)(v.FormattedMessage,{id:"component-story-claimproofdetail-txt-text",defaultMessage:"See data traced with MRV+"}),(0,y.jsx)(function(e){var t=e.expanded;return(0,y.jsx)(ea,{styles:aI,owner:"StoryClaimProofDetail",children:(0,y.jsx)("i",{className:"".concat(t?aI.arrowIconUp:aI.arrowIconDown)})})},{expanded:s,type:"button"})]})})}),s&&(0,y.jsx)(aD,{locale:n,event:r,storyClaims:d})]}):null},aR={rmrlContainer:"readMoreReadLess_rmrlContainer__ygs2x",controlBtn:"readMoreReadLess_controlBtn__ygs2x",linkStyles:"readMoreReadLess_linkStyles__ygs2x",rmrlContainerStory:"readMoreReadLess_rmrlContainerStory__ygs2x",contentLess:"readMoreReadLess_contentLess__ygs2x",contentMore:"readMoreReadLess_contentMore__ygs2x",rmrlContainerSupply:"readMoreReadLess_rmrlContainerSupply__ygs2x",buttonStyles:"readMoreReadLess_buttonStyles__ygs2x",arrowIcon:"readMoreReadLess_arrowIcon__ygs2x",arrowIconUp:"readMoreReadLess_arrowIconUp__ygs2x",controlBtnMore:"readMoreReadLess_controlBtnMore__ygs2x",controlBtnLess:"readMoreReadLess_controlBtnLess__ygs2x",golden:"readMoreReadLess_golden__ygs2x"};function aU(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return aH(e,t);var n=({}).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)?aH(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let aq=function(e){var t=e.content,n=void 0===t?"":t,r=e.color,o=void 0===r?"black":r,i=e.maxCharLength,a=void 0===i?200:i,l=e.readMoreLabel,s=void 0===l?(0,y.jsx)(v.FormattedMessage,{id:"component-readMoreReadLess-read_more",defaultMessage:"Read More"}):l,u=e.readMoreIcon,d=void 0===u?function(e){var t=e.color,n=e.isActive;return(0,y.jsx)(ea,{styles:aR,owner:"ReadMoreReadLess",children:(0,y.jsx)("i",{className:"".concat(aR.arrowIcon," ").concat(aR[t]," ").concat(n?aR.arrowIconDown:aR.arrowIconUp)})})}:u,f=e.readLessLabel,m=void 0===f?(0,y.jsx)(v.FormattedMessage,{id:"component-readMoreReadLess-read_less",defaultMessage:"Read Less"}):f,p=e.type,h=e.parent,g=e.buttonClassName,b=e.name,j=e.handleShortenedContent,_=aU((0,c.useState)(!1),2),w=_[0],x=_[1],S=aU((0,c.useState)(-1),2),O=S[0],k=S[1],C=(0,c.useMemo)(function(){return r6(n,a)},[n,a]);(0,c.useEffect)(function(){-1===O&&window&&k(window.scrollY)});var M={name:void 0===b?"unnamed component":b,expandedText:w,setExpandedText:x,setWindowScroll:k};if((0,c.useEffect)(function(){-1!==O&&window.scrollTo(0,O)},[w]),(0,c.useEffect)(function(){"function"==typeof j&&j(C)},[j,C]),C){var P=(0,y.jsxs)(ea,{styles:aR,owner:"ReadMoreReadLess",children:[" ",(0,y.jsxs)("button",{onClick:function(){window&&M.setWindowScroll(window.scrollY),M.setExpandedText(!M.expandedText),eU(M.expandedText?"Clicked ".concat(M.name," read less text"):"Clicked ".concat(M.name," read more text"),{category:"Engagement",label:"Product profile"})},className:"".concat(aR.controlBtn," ").concat(aR[o]," ").concat(w?aR.controlBtnLess:aR.controlBtnMore," ").concat("button"===p?aR.buttonStyles:aR.linkStyles),children:[(0,y.jsx)(d,{color:o,isActive:!w,type:"button"}),w?m:s]})]});return(0,y.jsx)(ea,{styles:aR,owner:"ReadMoreReadLess",children:(0,y.jsx)("div",{className:"".concat(aR.rmrlContainer," ").concat("storySection"===h?aR.rmrlContainerStory:""," ").concat("supplyStep"===h?aR.rmrlContainerSupply:""," ").concat((void 0===g?"":g)||""),children:w?(0,y.jsxs)("div",{className:aR.contentLess,children:[(0,y.jsx)(oe,{content:n}),P]}):(0,y.jsx)("div",{className:aR.contentMore,children:(0,y.jsx)(oe,{content:n,limit:a,end:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{children:"..."}),P]})})})})})}return(0,y.jsx)(ea,{styles:aR,owner:"ReadMoreReadLess",children:(0,y.jsx)("div",{className:"".concat(aR.rmrlContainer," ").concat("storySection"===h?aR.rmrlContainerStory:""," ").concat("supplyStep"===h?aR.rmrlContainerSupply:""),children:(0,y.jsx)("span",{className:aR.contentLess,children:(0,y.jsx)(oe,{content:n})})})})},aG={supplyStep:"supplyStep_supplyStep__penk8",embedded:"supplyStep_embedded__penk8",embeddedFull:"supplyStep_embeddedFull__penk8",iconLineContainer:"supplyStep_iconLineContainer__penk8",supplyStepIconWrapper:"supplyStep_supplyStepIconWrapper__penk8",supplyStepIcon:"supplyStep_supplyStepIcon__penk8",selectedPredecessor:"supplyStep_selectedPredecessor__penk8",selected:"supplyStep_selected__penk8",descriptionContainer:"supplyStep_descriptionContainer__penk8",descriptionContainer__inner:"supplyStep_descriptionContainer__inner__penk8",descriptionHeading:"supplyStep_descriptionHeading__penk8",descriptionSubline:"supplyStep_descriptionSubline__penk8",descriptionFacilityTitle:"supplyStep_descriptionFacilityTitle__penk8",descriptionContent:"supplyStep_descriptionContent__penk8",readMoreReadLessButton:"supplyStep_readMoreReadLessButton__penk8",descriptionPicture:"supplyStep_descriptionPicture__penk8",descriptionContainer__innerContentLoading:"supplyStep_descriptionContainer__innerContentLoading__penk8",loader:"supplyStep_loader__penk8",descriptionContainer__innerContentMain:"supplyStep_descriptionContainer__innerContentMain__penk8",mapMarkerIcon:"supplyStep_mapMarkerIcon__penk8",wzEmbeddedChild:"supplyStep_wzEmbeddedChild__penk8",descriptionContainer__innerContent:"supplyStep_descriptionContainer__innerContent__penk8",descriptionContainerEmbeddedSide:"supplyStep_descriptionContainerEmbeddedSide__penk8",descriptionPicture__embedded:"supplyStep_descriptionPicture__embedded__penk8",blockChainProofLinkWrapper:"supplyStep_blockChainProofLinkWrapper__penk8",storyClaimProofLinkWrapper:"supplyStep_storyClaimProofLinkWrapper__penk8"};function aV(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 aZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aV(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=aY(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=aY(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==aY(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aY(e){return(aY="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)}let aJ=function(e){var t,n,r=e.locale,o=e.name,i=e.event,a=e.facility,l=e.organizationName,s=e.organizationHyphenatedName,u=e.index,d=e.aboveSelected,f=e.selected,m=e.embedded,p=void 0!==m&&m,h=e.embeddedFull,g=void 0!==h&&h,b=e.hideFacilityName,j=void 0!==b&&b,w=e.dynamicFieldsUpdating,x=e.storyClaims;o||console.warn("No name for SupplyStep!");var S=(0,v.useIntl)(),O=(0,c.useMemo)(function(){return!(!_||!_.eventTypes)&&!!(null!=i&&i.type||null!=i&&i.refId)&&_.eventTypes.isTransport(i)},[i]),k=(0,c.useMemo)(function(){return _&&_.eventTypes&&(null!=i&&i.type||null!=i&&i.refId)?_.eventTypes.iconClass(i,f):""},[i,f]),C=(0,c.useMemo)(function(){var e=S.formatMessage({id:"component-supplystep-fallback-heading",defaultMessage:"Origin"});return i?"string"==typeof i.name&&i.name.trim().length?i.name:i.type?_&&_.eventTypes?_.eventTypes.name(i):i.type:e:e},[i,null==i?void 0:i.name,S]),M=(0,c.useMemo)(function(){return"".concat(aG.supplyStep," ").concat(f?aG.selected:""," ").concat(d?aG.selectedPredecessor:""," ").concat(p&&!g?aG.wzEmbeddedChild:""," ").concat(p?aG.embedded:""," ").concat(g?aG.embeddedFull:"")},[f,d,p,g]),P=(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("i",{className:aG.mapMarkerIcon})});return i&&"object"===aY(i)?(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsxs)("div",{className:M,id:"supply-step-".concat(u),children:[(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsxs)("div",{className:aG.iconLineContainer,children:[(0,y.jsx)("div",{className:aG.supplyStepIconWrapper,children:(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:!w&&(0,y.jsx)("i",{className:"".concat(aG.supplyStepIcon," ").concat(k)})})}),(0,y.jsx)("div",{className:aG.line})]})}),(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("div",{className:aG.descriptionContainer,children:(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsxs)("div",{className:aG.descriptionContainer__inner,children:[(0,y.jsxs)("div",{className:aG.descriptionContainer__innerContent,children:[(0,y.jsxs)("div",{className:w?aG.descriptionContainer__innerContentLoading:aG.descriptionContainer__innerContentMain,children:[(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("h4",{className:aG.descriptionHeading,children:!w&&C})}),l&&(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("div",{className:aG.descriptionSubline,children:!w&&(i.timestampStart&&i.timestampEnd?(0,y.jsx)(v.FormattedMessage,{id:"component-supplystep-subline-by-org-on-date",defaultMessage:"by {organization_link} on {date}",values:{organization_link:p||g||!s?(0,y.jsx)("span",{className:aG.noLinkOrganizationName,children:l}):(0,y.jsx)(F,{path:"/organization/".concat(s),children:(0,y.jsx)("a",{className:aG.organizationLink,children:l})}),date:(0,y.jsx)(r2,{start:i.timestampStart,end:i.timestampEnd,locale:r})}}):(0,y.jsx)(v.FormattedMessage,{id:"component-supplystep-subline-by-org",defaultMessage:"by {organization_link}",values:{organization_link:p||g||!s?(0,y.jsx)("span",{className:aG.noLinkOrganizationName,children:l}):(0,y.jsx)(F,{path:"/organization/".concat(s),children:(0,y.jsx)("a",{className:aG.organizationLink,children:l})})}}))})}),O?null:(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("div",{className:aG.descriptionFacilityTitle,children:!w&&(p||g||null==a||!a.hyphenatedName?(0,y.jsx)("span",{className:aG.noLinkFacilityName,children:(0,y.jsx)(rm,aZ({icon:P,name:a.name,facilityNameSpan:!p&&(null==a?void 0:a.hyphenatedName),hideFacilityName:j},a.location))}):(0,y.jsx)(F,{path:"/facility/".concat(a.hyphenatedName),children:(0,y.jsx)("a",{children:(0,y.jsx)(rm,aZ({icon:P,name:a.name,hideFacilityName:j,selected:f,isLink:!0},a.location))})}))})}),null!==(t=i.media)&&void 0!==t&&t.length&&!w?(0,y.jsx)(ro,{mediaItemsClass:"fromSupplyStep",className:aG.descriptionPicture,media:i.media,slug:"event-".concat(u),embedded:p,embeddedFull:g}):null,i.description?(0,y.jsx)(ea,{styles:aG,owner:"SupplyStep",children:(0,y.jsx)("div",{className:aG.descriptionContent,children:!w&&(0,y.jsx)(aq,{content:i.description,buttonClassName:aG.readMoreReadLessButton,type:"link",parent:"supplyStep",name:"supply step"})})}):null]}),(0,y.jsx)("div",{className:aG.blockChainProofLinkWrapper,children:(0,y.jsx)(aT,{locale:r,event:i,selected:f,embedded:p})}),(0,y.jsx)("div",{className:aG.storyClaimProofLinkWrapper,children:(0,y.jsx)(aW,{locale:r,event:i,selected:f,embedded:p,storyClaims:x})})]}),null!==(n=i.media)&&void 0!==n&&n.length?p&&!g?(0,y.jsx)("div",{className:aG.descriptionContainerEmbeddedSide,children:(0,y.jsx)(ro,{mediaItemsClass:"fromEmbeddedSupplyStep",className:"".concat(aG.descriptionPicture," ").concat(aG.descriptionPicture__embedded),media:i.media,slug:"event-".concat(u),embedded:p,embeddedFull:g})}):"":null]})})})})]})}):null},a$=function(e){var t=e.product,n=e.facilities,r=e.organizations,o=e.events,i=e.storyClaims,a=e.startIndex,l=e.selectedIndex,s=e.locale,c=e.embedded,u=void 0!==c&&c,d=e.embeddedFull,f=void 0!==d&&d,m=e.hideFacilityName,p=void 0!==m&&m,h=e.dynamicFieldsUpdating,v=a;return t.events.map(function(e,c){v=a+c;var d,m,g,b=o[e],j=null!==(d=n[b.facility])&&void 0!==d?d:{},_=r[b.organization];return(0,y.jsx)(aJ,{name:t.name,event:b,facility:j,storyClaims:i,organizationName:null!==(m=null==_?void 0:_.name)&&void 0!==m?m:null,organizationHyphenatedName:null!==(g=null==_?void 0:_.hyphenatedName)&&void 0!==g?g:null,index:v,aboveSelected:l>v,selected:l===v,embedded:u,embeddedFull:f,hideFacilityName:p,locale:s,dynamicFieldsUpdating:h},"".concat(t.id).concat(c))})},aQ={poweredBy:"poweredByBadge_poweredBy__rh8m3",poweredBy__outer:"poweredByBadge_poweredBy__outer__rh8m3",poweredBy__inner:"poweredByBadge_poweredBy__inner__rh8m3",label:"poweredByBadge_label__rh8m3",storybirdLogo:"poweredByBadge_storybirdLogo__rh8m3"},aK=function(e){var t=e.blockchainStatus,n=e.blockchainType;return(0,y.jsx)(ea,{styles:aQ,owner:"PoweredByBadge",children:(0,y.jsx)("div",{className:"".concat(aQ.poweredBy),children:(0,y.jsx)("div",{className:aQ.poweredBy__outer,children:(0,y.jsxs)("div",{className:aQ.poweredBy__inner,children:[(0,y.jsx)("span",{className:aQ.label,children:(0,y.jsx)(v.FormattedMessage,{id:"component-embeddedMap",defaultMessage:"powered by"})})," ",(0,y.jsx)(eZ,{href:"https://storybird.io:443",children:(0,y.jsx)(f(),{src:"/images/logos/logo-storybird--black.svg",width:119,height:40,alt:"Storybird Logo",className:aQ.storybirdLogo})}),t&&"error"!==t?(0,y.jsx)(h,{blockchainType:n,poweredBy:!0}):null]})})})})},aX={originSteps:"originSteps_originSteps__aege5",embeddedFull:"originSteps_embeddedFull__aege5",withNavSlider:"originSteps_withNavSlider__aege5",originStepsMoreBtnWrapper:"originSteps_originStepsMoreBtnWrapper__aege5",embedded:"originSteps_embedded__aege5",fixedBottomContainerSpacer:"originSteps_fixedBottomContainerSpacer__aege5",fixedBottomContainer:"originSteps_fixedBottomContainer__aege5",embeddedButtonUntilTablet:"originSteps_embeddedButtonUntilTablet__aege5",toggleShowAll:"originSteps_toggleShowAll__aege5",arrowIconDown:"originSteps_arrowIconDown__aege5",embeddedButtonFromTablet:"originSteps_embeddedButtonFromTablet__aege5",show3Steps:"originSteps_show3Steps__aege5",hiddenStepsCounter:"originSteps_hiddenStepsCounter__aege5",arrowIcon:"originSteps_arrowIcon__aege5",arrowIconUp:"originSteps_arrowIconUp__aege5",desktopSpacer:"originSteps_desktopSpacer__aege5"};var a0=function(e){var t=e.showAll,n=e.numberOfHiddenElements,r=e.onClick;return(0,y.jsx)(ea,{styles:aX,owner:"HideShowButton",children:(0,y.jsx)("div",{className:aX.originStepsMoreBtnWrapper,children:(0,y.jsx)(ea,{styles:aX,owner:"HideShowButton",children:(0,y.jsxs)("button",{className:aX.toggleShowAll,onClick:r,children:[(0,y.jsx)(ea,{styles:aX,owner:"HideShowButton",children:(0,y.jsx)("i",{className:"".concat(aX.arrowIcon," ").concat(t?aX.arrowIconUp:aX.arrowIconDown)})}),t?(0,y.jsx)(v.FormattedMessage,{id:"component-originSteps-showMoreStepsButton-show_less",defaultMessage:"See fewer steps"}):(0,y.jsx)(v.FormattedMessage,{id:"component-originSteps-showMoreStepsButton-show_more",defaultMessage:"See more steps"}),!t&&(0,y.jsxs)("span",{className:aX.hiddenStepsCounter,children:["(",n,")"]})]})})})})};let a1=function(e){var t=e.productChain,n=e.organizations,r=e.facilities,o=e.events,i=e.storyClaims,a=e.minimumStepsShown,l=void 0===a?3:a,s=e.containerRef,u=e.showAllSteps,d=e.onScroll,f=e.afterHideShowSteps,m=e.selected,p=e.embedded,h=void 0!==p&&p,g=e.embeddedFull,b=void 0!==g&&g,j=e.withNavSlider,_=e.hideFacilityName,w=void 0!==_&&_,x=e.hideJourneySummary,S=void 0!==x&&x,O=e.blockchainType,k=void 0===O?null:O,C=e.blockchainStatus,M=void 0===C?null:C,P=e.dynamicFieldsUpdating,I=(0,v.useIntl)(),N=(0,c.useMemo)(function(){return t.reduce(function(e,t){return e+t.events.length},0)},[t]),T=(0,c.useMemo)(function(){var e=0;return t.map(function(t,a){var l,s,c=e;return e+=null!==(l=null==t||null===(s=t.events)||void 0===s?void 0:s.length)&&void 0!==l?l:0,(0,y.jsx)(a$,{startIndex:c,selectedIndex:m,product:t,facilities:r,organizations:n,events:o,storyClaims:i,embedded:h,embeddedFull:b,hideFacilityName:w,dynamicFieldsUpdating:P,locale:I.locale},a)})},[t,o,m,null==I?void 0:I.locale]);return(0,c.useEffect)(function(){0!==N&&eD(N,null,!0)},[N]),(0,c.useEffect)(function(){0!==N&&eD(N,m)},[m]),S&&!m&&(m=0),(0,y.jsx)(ea,{styles:aX,owner:"OriginSteps",children:(0,y.jsxs)("div",{className:"".concat(aX.originSteps," ").concat(h?aX.embedded:""," ").concat(b?aX.embeddedFull:""," ").concat(void 0!==j&&j?aX.withNavSlider:""),ref:s,onScroll:d,children:[S?null:(0,y.jsx)(oC,{productChain:t,events:o,facilities:r,selected:null==m,blockchainType:k,blockchainStatus:M,dynamicFieldsUpdating:P}),(0,y.jsx)(nf,{minimumElementsShown:l,numberOfElements:N,hideClass:aX["show".concat(l,"Steps")],button:a0,forceShow:u||h,afterChange:f,embedded:h,children:T}),h?(0,y.jsx)(aK,{blockchainStatus:M,blockchainType:k}):null]})})},a2=n(83854),a5=n(6158);var a8=a.n(a5);function a4(e){return(a4="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)}function a3(){a3=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==a4(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(a4(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function a6(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var a9=(dH=function e(t,n,r,o){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.map=t,this.type=n,this.owner=r,this.options=o,this.initialized=!1,this.zoomLevels={World:1,Continent:5,City:10,Streets:15,Buildings:20,Max:24}},dq=[{key:"destructor",value:function(){}},{key:"fitBounds",value:function(e){}},{key:"getZoom",value:function(){return -1}},{key:"getDiv",value:function(){return{clientWidth:-1,clientHeight:-1}}},{key:"getCenter",value:function(){return{lat:-1,lng:-1}}},{key:"getBounds",value:function(){return this.newLatLngBounds()}},{key:"setZoom",value:function(e){}},{key:"setCenter",value:function(e){}},{key:"setOptions",value:function(e){}},{key:"panTo",value:function(e){}},{key:"addListenerOnce",value:function(e,t){return setTimeout(function(){return t()},100)}},{key:"addListener",value:function(e,t){return setInterval(function(){return t()},100)}},{key:"removeListener",value:function(e){}},{key:"newLatLngBounds",value:function(){return{extend:function(){},contains:function(){return!1},getCenter:function(){return{lat:-1,lng:-1}},getNorthEast:function(){return{lat:-1,lng:-1}},getSouthWest:function(){return{lat:-1,lng:-1}}}}},{key:"extendLatLngBounds",value:function(e,t){return e.extend(t),e}},{key:"cleanup",value:function(){}},{key:"updateContainer",value:function(){}},{key:"fetchDirections",value:(dG=a3().mark(function e(t){return a3().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 2:case"end":return e.stop()}},e)}),dV=function(){var e=this,t=arguments;return new Promise(function(n,r){var o=dG.apply(e,t);function i(e){a6(o,n,r,i,a,"next",e)}function a(e){a6(o,n,r,i,a,"throw",e)}i(void 0)})},function(e){return dV.apply(this,arguments)})}],function(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,function(e){var t=function(e,t){if("object"!=a4(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=a4(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a4(t)?t:t+""}(r.key),r)}}(dH.prototype,dq),Object.defineProperty(dH,"prototype",{writable:!1}),dH);let a7=n(66084);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})(e)}function lt(e,t){if("number"!=typeof t)throw console.error("invalid zoomLevel",t,le(t)),Error("invalid zoomLevel");return 8e4/Math.pow(2,t)/10<=e}function ln(e){return(ln="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)}function lr(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 lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=li(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function li(e){var t=function(e,t){if("object"!=ln(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ln(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ln(t)?t:t+""}function la(e,t){if(t&&("object"==ln(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ll(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ll=function(){return!!e})()}function ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lc(e,t){return(lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var lu={strokeColor:"#000000",strokeOpacity:.7,strokeWeight:4,fillColor:"#000000",fillOpacity:1,clickable:!0,draggable:!1,editable:!1,visible:!0,radius:3e4,geodesic:!0,zIndex:1,icons:[{icon:{path:"M 0,12 21,0 21,21 Z",anchor:{x:12,y:12},strokeColor:"#000",strokeOpacity:0,fillColor:"#201F22",fillOpacity:1,rotation:90,size:{width:22,height:22},scale:1},offset:"50%"}]},ld=function(e){var t;function n(e,t,r){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n);var o,i,a,l=(o=n,i=[e,"google",t,r],o=ls(o),a=la(this,ll()?Reflect.construct(o,i||[],ls(this).constructor):o.apply(this,i)));return google&&google.maps?(l.initialized=!0,a):la(a)}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&lc(e,t)}(n,e),t=[{key:"destructor",value:function(){google.maps.event.clearInstanceListeners(this.map)}},{key:"fitBounds",value:function(e){return this.map.fitBounds(e)}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"getDiv",value:function(){return this.map.getDiv()}},{key:"getCenter",value:function(){var e=this.map.getCenter();return{lat:e.lat(),lng:e.lng()}}},{key:"getBounds",value:function(){return this.map.getBounds()}},{key:"setZoom",value:function(e){return this.map.setZoom(e)}},{key:"setCenter",value:function(e){return this.map.setCenter(e)}},{key:"setOptions",value:function(e){return this.map.setOptions(e)}},{key:"panTo",value:function(e){return this.map.panTo(e)}},{key:"addListenerOnce",value:function(e,t){return google.maps.event.addListenerOnce(this.map,e,t)}},{key:"addListener",value:function(e,t){return google.maps.event.addListener(this.map,e,t)}},{key:"removeListener",value:function(e){return google.maps.event.removeListener(e)}},{key:"newLatLngBounds",value:function(){return new google.maps.LatLngBounds}},{key:"extendLatLngBounds",value:function(e,t){return e.extend(t)}},{key:"drawRoute",value:function(e){var t=e.route,n=e.geodesic,r=e.isSelected,o=e.transportArrowZoomLevel,i=e.onRouteClickHandler,a=e.onInfoWindowClickHandler,l=e.onInfoWindowCloseHandler,s=e.infoWindowContent,c=e.index;if(t[0]&&t[1]){var u=(0,a7.computeDistanceBetween)(t[0],t[1]),d=this.options.drawArrows&&lt(u/1e3,o),f=(0,a7.interpolate)(t[0],t[1],.5),m={lat:f.latitude,lng:f.longitude},p=[];return p.push((0,y.jsx)(a2.Polyline,{path:t,options:lo(lo(lo({geodesic:n,paths:t},lu),{strokeColor:r?this.options.selectColor:this.options.lineColor,fillColor:r?this.options.selectColor:this.options.lineColor}),{},{zIndex:r?10:5},{icons:[{icon:{path:"M 0,12 21,0 21,21 Z",anchor:{x:12,y:12},strokeColor:"#000",strokeOpacity:0,fillColor:r?this.options.selectColor:this.options.lineColor,fillOpacity:d?1:0,rotation:90,size:{width:22,height:22},scale:1},offset:"50%"}]}),onClick:function(){return i(c)}},c)),s&&p.push((0,y.jsx)(a2.InfoWindow,{position:m,options:{disableAutoPan:!0},onCloseClick:function(){return l(c)},onClick:function(){return a(c)},children:this.renderInfoWindow(s)},c+"_info")),p}}},{key:"drawMarker",value:function(e){var t=this,n=e.coordinates,r=e.index,o=e.isSelected,i=e.infoWindowContent,a=e.onMarkerClickHandler,l=e.onInfoWindowClickHandler,s=e.onInfoWindowCloseHandler,c=this.options.mapMarkerPath,u=this.options.mapMarkerSelectedPath,d=o?{url:u,size:{width:40,height:40},scaledSize:{width:40,height:40},anchor:{x:20,y:34}}:{url:c,size:{width:20,height:20},anchor:{x:10,y:10},scaledSize:{width:20,height:20}},f=[];return n.forEach(function(e,n){f.push((0,y.jsx)(a2.Marker,{position:e,onClick:function(){return a(r)},icon:d,options:{anchorPoint:{x:50,y:20},zIndex:o?10:5}},r+"_"+n)),i&&f.push((0,y.jsx)(a2.InfoWindow,{position:e,onCloseClick:function(){return s(r)},onClick:function(){return l(r)},options:{pixelOffset:{width:0,height:-38},disableAutoPan:!0},children:t.renderInfoWindow(i)},r+"_"+n+"_info"))}),f}},{key:"renderInfoWindow",value:function(e){if(!Array.isArray(e))return null;var t=[],n=null,r=null,o=null;return e.forEach(function(e){if(void 0!==e.data)switch(e.type){case"media":if("string"!=typeof e.data.url)return;t.push({url:e.data.url,mediaType:m.mediaTypes.image});break;case"text":if("string"!=typeof e.data.text)return;n=e.data.text;break;case"location":r={name:e.data.name,location:e.data.location};break;case"headline":if("string"!=typeof e.data.text)return;o=e.data.text}}),(0,y.jsx)(oo,{media:t,organizationName:o,facility:r,distanceWithUnit:n,close,hideFacilityName:!1})}}],function(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,li(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(a9);let lf=n(20745),lm=a.p+"static/mb.css",lp=a.p+"static/mbgc.css",ly=n(25913);var lh=a.n(ly);let lv=n(78230);var lg=a.n(lv);let lb=n(51208);var lj=a.n(lb);let l_={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},lw=new Uint8Array(16),lx=[];for(let e=0;e<256;++e)lx.push((e+256).toString(16).slice(1));let lS=function(t,n,r){if(l_.randomUUID&&!n&&!t)return l_.randomUUID();let o=(t=t||{}).random||(t.rng||function(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(lw)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n){r=r||0;for(let e=0;e<16;++e)n[r+e]=o[e];return n}return function(e,t=0){return lx[e[t+0]]+lx[e[t+1]]+lx[e[t+2]]+lx[e[t+3]]+"-"+lx[e[t+4]]+lx[e[t+5]]+"-"+lx[e[t+6]]+lx[e[t+7]]+"-"+lx[e[t+8]]+lx[e[t+9]]+"-"+lx[e[t+10]]+lx[e[t+11]]+lx[e[t+12]]+lx[e[t+13]]+lx[e[t+14]]+lx[e[t+15]]}(o)};function lO(e){return(lO="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)}function lk(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 lC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lk(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=lO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lO(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==lO(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var lM={type:"google",geodesic:!0,directions:!1,linePattern:!1,drawArrows:!0,selectedAnimation:!1,lineWidth:4,selectColor:"#2D88AE",lineColor:"#201F22",mapMarkerSelectedPath:"/images/icon-mapmarker-shadowed.svg",mapMarkerPath:"/images/icon-mapmarker-circle.svg",mapboxStyleUrl:"mapbox://styles/producersmarket/ckttqs76z0kxw18pm8w426x68"};let lP={debug:!1,defaultZoomLevel:1,defaultEntitiesMapZoomLevel:3,mainOrganizationZoomLevel:10,defaultTransportArrowZoomLevel:5,defaultMapOptions:lM,directionsApiUrl:"https://api.mapbox.com/directions/v5/mapbox/driving/",forwardGeocodingApiUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",marketplaceMapOptions:lC(lC({},lM),{},{mapboxStyleUrl:"mapbox://styles/producersmarket/cm2iya2uz001301r6byw413mh"}),maxFacilityZoomLevel:15,maxInfoWindowHeight:225,maxInfoWindowWidth:245,maxSingleFacilityZoomLevel:5,mock:!1,zoomAnimationTime:300};var lI=a(804);function lN(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 lT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lN(Object(n),!0).forEach(function(t){var r,o;r=t,o=n[t],(r=lW(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lL(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=lz(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function lE(){lE=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==lF(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(lF(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function lz(e,t){if(e){if("string"==typeof e)return lA(e,t);var n=({}).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)?lA(e,t):void 0}}function lA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lF(e){return(lF="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)}function lD(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function lB(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){lD(i,r,o,a,l,"next",e)}function l(e){lD(i,r,o,a,l,"throw",e)}a(void 0)})}}function lW(e){var t=function(e,t){if("object"!=lF(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lF(t)?t:t+""}function lR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(lR=function(){return!!e})()}function lU(e){return(lU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lH(e,t){return(lH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var lq={mapboxglStyles:lm,mapboxglgeocoderStyles:lp};function lG(e){for(var t in e)lq[t]=e[t]}function lV(){var e=document.querySelector('link[href$="'.concat(lq.mapboxglStyles,'"]'));e||((e=document.createElement("link")).href=lq.mapboxglStyles,e.rel="stylesheet",e.type="text/css",document.getElementsByTagName("head")[0].appendChild(e))}var lZ=function(e){var t,n,r,o,i;function a(e,t,n){var r,o,i;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),(o=a,i=[e,"mapbox",t,n],o=lU(o),r=function(e,t){if(t&&("object"==lF(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,lR()?Reflect.construct(o,i||[],lU(this).constructor):o.apply(this,i))).initialized=!0,r.directionsCache={},r._lastFitBounds=null,r.owner._setZoom=function(e,t){r.map.zoomTo(e,{duration:300,essential:!0}),r.map.on("idle",function e(){t({zoom:r.getZoom()}),r.map.off("idle",e)})},r.owner._panToWithZoom=function(e,t,n){r.map.flyTo({center:e,zoom:t,essential:!0}),r.map.on("idle",function e(){n({zoom:r.getZoom()}),r.map.off("idle",e)})},r.owner._panTo=function(e,t){r.map.flyTo({center:e,essential:!0}),r.map.on("idle",function e(){t(),r.map.off("idle",e)})},r.owner._fitBoundsTo=function(e,t,n){r._lastFitBounds=t,r.map.fitBounds(t,{padding:Math.min(r.getDiv().clientWidth/8,r.getDiv().clientHeight/8),maxZoom:15,essential:!0}),r.map.on("idle",function e(){n({zoom:r.map.getZoom(),bounds:r.map.getBounds()}),r.map.off("idle",e)})},r}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&lH(e,t)}(a,e),t=[{key:"destructor",value:function(){this.map.remove()}},{key:"fitBounds",value:function(e){return this.map.fitBounds(e)}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"getDiv",value:function(){return this.map.getContainer()}},{key:"getCenter",value:function(){var e=this.map.getCenter();return{lat:e.latitude,lng:e.longitude}}},{key:"getBounds",value:function(){return this.map.getBounds()}},{key:"setZoom",value:function(e){return this.map.zoomTo(e,{duration:300,essential:!0})}},{key:"setCenter",value:function(e,t){return null!=t&&t.fly?this.map.flyTo({center:this.getLatLngLike(e),essential:!0}):this.map.setCenter(this.getLatLngLike(e))}},{key:"setOptions",value:function(e){"number"==typeof e.maxZoom?this.map.setMaxZoom(e.maxZoom):"number"==typeof e.minZoom?this.map.setMinZoom(e.minZoom):console.warn("setOptions is not supported by mapbox",e)}},{key:"panTo",value:function(e,t){return this.map.panTo(e,t)}},{key:"addListenerOnce",value:function(e,t){return this.map.once(e,t)}},{key:"addListener",value:function(e,t){var n=e;return"zoom_changed"===e&&(n="zoomend"),this.map.on(n,t)}},{key:"removeListener",value:function(e){return this.map.off(e)}},{key:"newLatLngBounds",value:function(){return new(a8()).LngLatBounds}},{key:"extendLatLngBounds",value:function(e,t){return e.isEmpty()?(e.setNorthEast(t),e.setSouthWest(t)):Array.isArray(t)&&t.length?e.extend(new(a8()).LngLat(t[0],t[1])):e.extend(new(a8()).LngLat(t.lng,t.lat)),e}},{key:"removeLayers",value:function(e){var t=this;if("function"==typeof this.map.removeLayer)try{e.forEach(function(e){return t.map.removeLayer(e)})}catch(e){}}},{key:"removePopups",value:function(e){try{e.forEach(function(e){return e.remove()})}catch(e){}}},{key:"removeSources",value:function(e){var t=this;if("function"==typeof this.map.removeSource)try{e.forEach(function(e){return t.map.removeSource(e)})}catch(e){}}},{key:"removeMarkers",value:function(e){e.forEach(function(e){try{e.remove()}catch(e){}})}},{key:"fetchDirections",value:(i=lB(lE().mark(function e(t){var n,r,o,i,a=this;return lE().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[this.getLatLngLike(t[0]),this.getLatLngLike(t[t.length-1])].map(function(e){return e.join(",")}).join(";"),"object"!==lF(this.directionsCache[n])){e.next=3;break}return e.abrupt("return",this.directionsCache[n]);case 3:return o=Object.keys(r={overview:"full",geometries:"geojson",exclude:"ferry",access_token:"pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A"}).map(function(e){return"".concat(e,"=").concat(r[e])}).join("&"),i="".concat(lP.directionsApiUrl).concat(n,"?").concat(o),e.abrupt("return",ew().get(i).then(function(e){if(200!==e.status)throw new lI.apiError(e.status,"invalid directions response");if(0===e.data.routes.length)throw new lI.apiError(e.status,"no directions received");var r,o={type:"FeatureCollection",features:[(0,oh.lineString)([t[0]].concat(function(e){if(Array.isArray(e))return lA(e)}(r=e.data.routes[0].geometry.coordinates)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||lz(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[t[t.length-1]]))]};return a.directionsCache[n]=o,o}));case 7:case"end":return e.stop()}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"forwardGeocode",value:(o=lB(lE().mark(function e(t){var n,r,o;return lE().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(n={types:"country,region,postcode,district,place,locality,neighborhood,address",autocomplete:"true",access_token:"pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A"}).map(function(e){return"".concat(e,"=").concat(n[e])}).join("&"),o="".concat(lP.forwardGeocodingApiUrl).concat(encodeURIComponent(t),".json?").concat(r),e.abrupt("return",ew().get(o).then(function(e){if(200!==e.status)throw new lI.apiError(e.status,"invalid forwardGeocode response");if(0===e.data.features.length)throw new lI.apiError(e.status,"no forwardGeocode received");return e.data.features}));case 4:case"end":return e.stop()}},e)})),function(e){return o.apply(this,arguments)})},{key:"reverseGeocode",value:(r=lB(lE().mark(function e(t){var n,r,o,i,a,l,s;return lE().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object.keys(n={types:"country,region,postcode,district,place,locality,neighborhood,address",autocomplete:"true",access_token:"pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A"}).map(function(e){return"".concat(e,"=").concat(n[e])}).join("&"),a=(i=function(e){if(Array.isArray(e))return e}(o=this.getLatLngLike(t))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(o,2)||lz(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],l=i[1],s="".concat(lP.forwardGeocodingApiUrl).concat(a,",").concat(l,".json?").concat(r),e.abrupt("return",ew().get(s).then(function(e){if(200!==e.status)throw new lI.apiError(e.status,"invalid forwardGeocode response");if(0===e.data.features.length)throw new lI.apiError(e.status,"no forwardGeocode received");return e.data.features}));case 5:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"featureToLocation",value:function(e){if("object"!==lF(e))return null;var t={coordinates:[],countryCode:void 0,state:void 0,city:void 0,zip:void 0,address:void 0};if(Array.isArray(e.center)&&2===e.center.length&&(t.coordinates=[{lnglat:e.center.join(",")}]),Array.isArray(e.subcontext)){var n,r=lL(e.subcontext);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.id.startsWith("country")&&(t.countryCode=o.short_code),o.id.startsWith("region")&&(t.state=o.text),o.id.startsWith("place")&&(t.city=o.text),o.id.startsWith("postcode")&&(t.zip=o.text)}}catch(e){r.e(e)}finally{r.f()}}return"string"==typeof e.id&&"string"==typeof e.address&&e.id.startsWith("address")&&(t.address=e.text,"string"==typeof e.address&&e.address&&(t.address+=" "+e.address)),"string"==typeof e.id&&"string"==typeof e.place_name&&"object"===lF(e.properties)&&e.id.startsWith("country")&&(t.countryCode=e.properties.short_code),t}},{key:"getLatLngLike",value:function(e){if("object"===lF(e)&&void 0!==e.lng&&void 0!==e.lat)return[e.lng,e.lat];if(Array.isArray(e)&&2===e.length)return e;if("string"==typeof e){var t=e.split(",");try{var n=parseFloat(t[0]),r=parseFloat(t[1]);if(!isNaN(n)&&!isNaN(r))return[n,r]}catch(e){}}throw console.error("invalid latlng like",e),TypeError("Invalid LatLngLike")}},{key:"getRoute",value:function(e){var t=e.origin,n=e.destination,r=e.geodesic;if(!t||!n)return null;var o={type:"FeatureCollection",features:[(0,oh.lineString)([this.getLatLngLike(t),this.getLatLngLike(n)])]};if(r){var i=om()(o.features[0].geometry);if(0===i)return null;for(var a=[],l=0;l<=500;l++){var s=lh()(o.features[0],l*i/500);a.push(s.geometry.coordinates)}o.features[0]=(0,oh.lineString)(a)}else{var c=(0,oh.points)(o.features[0].geometry.coordinates),u=[];u.push(o.features[0].geometry.coordinates[0]),u.push(lg()(c).geometry.coordinates),u.push(o.features[0].geometry.coordinates[1]),o.features[0]=(0,oh.lineString)(u)}return o}},{key:"drawArrow",value:function(e){var t=this,n=e.route,r=e.isSelected,o=e.geodesic,i=e.infoWindowContent,a=e.layersRef,l=e.popupsRef,s=e.sourcesRef,c=lS(),u=lS(),d=[];if(3===n.features[0].geometry.coordinates.length)d=n.features[0].geometry.coordinates;else{var f=Math.round(n.features[0].geometry.coordinates.length/2);d=[n.features[0].geometry.coordinates[f-1],n.features[0].geometry.coordinates[f],n.features[0].geometry.coordinates[f+1]]}var m,p,y,h,v,g,b={type:"FeatureCollection",features:[{type:"Feature",properties:{bearing:o?lj()((0,oh.point)(d[0]),(0,oh.point)(d[2])):(m=d[0],p=d[2],y=0,h=m[1],v=m[0],g=p[1],(y=180/Math.PI*Math.atan2(p[0]-v,g-h))<0&&(y=360-Math.abs(y)),Math.abs(y))},geometry:{type:"Point",coordinates:d[1]}}]};this.map.addSource(u,{type:"geojson",data:b}),s.push(u),this.map.addLayer({id:c,source:u,type:"symbol",layout:{"icon-image":r?"arrow-north-selected":"arrow-north","icon-rotate":["get","bearing"],"icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0}});for(var j=this.zoomLevels.Buildings,_=om()(n),w=0;w<j;w++)if(lt(_,w)){this.map.setLayerZoomRange(c,w,j);break}this.renderInfoWindow(i,function(e){var n=e.domContent,o=new(a8()).Popup({offset:25,focusAfterOpen:!1}).setLngLat(d[1]).setDOMContent(n);r&&o.addTo(t.map),l.push(o)}),a.push(c)}},{key:"drawRoute",value:function(e){var t=this,n=e.route,r=e.options,o=e.isSelected,i=e.layersRef,a=e.sourcesRef,l=e.onRouteClickHandler,s=lS(),c=lS(),u=lS();this.map.addSource(u,{type:"geojson",lineMetrics:!0,data:n}),a.push(u);var d=o?r.selectColor:r.lineColor,f={};if(r.linePattern&&(f["line-pattern"]=o?"pattern-line-selected":"pattern-line"),this.map.addLayer({id:s,source:u,type:"line",paint:lT({"line-width":r.lineWidth,"line-color":d},f),layout:{"line-join":"round","line-cap":"round",visibility:"visible"}}),this.map.addLayer({id:c,source:u,type:"line",paint:{"line-width":20,"line-color":"rgba(0, 0, 0, 0)"},layout:{"line-join":"round","line-cap":"round",visibility:"visible"}}),o&&r.selectedAnimation){var m=[r.lineColor,r.selectColor];this.directionAnimation(s,m)}i.push(s),i.push(c),"function"==typeof l&&this.map.on("click",c,function(e){var r=e.point,o=t.map.project(n.features[0].geometry.coordinates[0]),i=t.map.project(n.features[0].geometry.coordinates[n.features[0].geometry.coordinates.length-1]),a=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),s=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2));a<20||s<20||l()})}},{key:"directionAnimation",value:function(e,t){var n,r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=[];if(o<=10){var a=o/10;i.push(0),i.push(t[1]),i.push(a),i.push(t[0]),1!=a&&(i.push(1),i.push(t[1]))}if(o>10&&o<=20){var l=(o-10)/10;i.push(0),i.push(t[0]),i.push(l),i.push(t[1]),1!=l&&(i.push(1),i.push(t[0]))}++o>20&&(o=1);var s=["interpolate",["linear"],["line-progress"]].concat(i);try{null!=this&&null!==(n=this.map)&&void 0!==n&&n.getLayer(e)&&(this.map.setPaintProperty(e,"line-gradient",s),setTimeout(function(){requestAnimationFrame(function(){return r.directionAnimation(e,t,o)})},100))}catch(e){}}},{key:"drawMarker",value:function(e){var t=this,n=e.coordinates,r=e.options,o=e.onMarkerClickHandler,i=e.onMarkerMoveHandler,a=e.infoWindowContent,l=e.isSelected,s=e.hideSelectedInitial,c=void 0!==s&&s,u=e.markersRef,d={url:l?r.mapMarkerSelectedPath:r.mapMarkerPath,size:{width:l?1320/45:20,height:l?40:20}};n.forEach(function(e){var n=document.createElement("div");if(n.className="marker",n.style.backgroundImage="url(".concat(d.url,")"),n.style.width="".concat(d.size.width,"px"),n.style.height="".concat(d.size.height,"px"),n.style.backgroundSize="contain",n.style.backgroundRepeat="no-repeat",n.style.zIndex=l?1:0,n.style.className="marker",n.addEventListener("click",o),t.map.getCanvasContainer()){var r=t.getLatLngLike(e),s=new(a8()).Marker(n,{anchor:l?"bottom":"center",draggable:"function"==typeof i}).setLngLat(r).addTo(t.map);"function"==typeof i&&s.on("dragend",function(){var e=s.getLngLat();i("".concat(e.lng,",").concat(e.lat))}),t.renderInfoWindow(a,function(e){var t=e.domContent,n=e.hasMedia,r={top:[0,10],"top-left":[0,10],"top-right":[0,10],bottom:[0,-1*d.size.height-5],"bottom-left":[0,-1*d.size.height-5],"bottom-right":[0,-1*d.size.height-5],left:[10,0],right:[-10,0]},o=new(a8()).Popup({offset:r,focusAfterOpen:!1,anchor:"bottom",className:n?"global-infowindow-with-media":"global-infowindow-without-media"}).setDOMContent(t);s.setPopup(o),l&&!c&&window.setTimeout(function(){s.togglePopup()},1)}),u.push(s)}})}},{key:"renderInfoWindow",value:function(e,t){var n="theme-map-InfoWindowContentContainer";if(Array.isArray(e)){var r=!1,o=document.createElement("div"),i=e.find(function(e){return"link"===e.type});e.forEach(function(e){var t,a;if(void 0!==e.data)switch(e.type){case"media":if("string"!=typeof e.data.url)break;(a=document.createElement("div")).className=e.data.className,a.style.background="linear-gradient(rgba(0, 0, 0, 0.7) 0%, transparent 30%, transparent 100%, rgba(0, 0, 0, 0.8) 100%)"+", url(".concat(e.data.url,")"),o.appendChild(a),"function"==typeof(null==i||null===(t=i.data)||void 0===t?void 0:t.onClick)&&(a.onclick=i.data.onClick,a.style.cursor="pointer"),r=!0;break;case"text":case"headline":if("string"!=typeof e.data.text)break;(a=document.createElement("div")).className=e.data.className,a.innerText=e.data.text,o.appendChild(a);break;case"text-block":var l=e.data.maxWords||5,s=e.data.text;"string"==typeof s?s=[e.data.text]:Array.isArray(s)||(s=[]);var c=document.createElement("div");c.style.display="none",c.className=e.data.className;var u=document.createElement("div");u.style.display="block",u.className=e.data.className;var d,f=lL(s);try{for(f.s();!(d=f.n()).done;){var m=d.value;"string"==typeof m&&((a=document.createElement("p")).innerText=m,c.appendChild(a))}}catch(e){f.e(e)}finally{f.f()}var p=document.createElement("span");p.innerText=e.data.intlReadLess,p.className=e.data.classNameReadLess,p.onclick=function(){u.style.display="block",c.style.display="none"},c.appendChild(p);var y,h=lL(s);try{for(h.s();!(y=h.n()).done;){var v=y.value;if("string"==typeof v){var g=v.split(/ /),b=g.slice(0,l).join(" ");if(a=document.createElement("div"),u.appendChild(a),g.length>l||s.length>1){a.innerText=b+"... ";var j=document.createElement("span");j.innerText=e.data.intlReadMore,j.className=e.data.classNameReadMore,j.onclick=function(){u.style.display="none",c.style.display="block"},a.appendChild(j)}else a.innerText=v;break}}}catch(e){h.e(e)}finally{h.f()}o.appendChild(u),o.appendChild(c);break;case"location":if("object"!==lF(e.data.intl)||"object"!==lF(e.data.location))break;a=document.createElement("div");var _=document.createElement("span"),w=document.createElement("div"),x=document.createElement("span"),S=document.createElement("span"),O=document.createElement("i"),k=rd(lT(lT({},e.data.location),{},{intl:e.data.intl}));a.className=e.data.classNameFacilityLine+" theme-map-InfoWindowFacilityLine",O.className="theme-map-InfoWindowFacilityMarker",x.className=e.data.classNameFacilityName,e.data.name&&(x.innerText=e.data.name,k.length&&(x.innerText+=", ")),S.innerText=k.join(", "),w.appendChild(O),w.appendChild(x),w.appendChild(S),_.appendChild(w),a.appendChild(_),o.appendChild(a);break;case"custom":if(!e.data)break;a=document.createElement("div"),(0,lf.createRoot)(a).render(e.data),o.appendChild(a);break;case"containerClassName":n+=" ".concat(e.data)}}),o.className=n,"function"==typeof t&&t({domContent:o,hasMedia:r})}}},{key:"cleanup",value:(n=lB(lE().mark(function e(t){var n,r,o,i,a=this;return lE().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.layers,r=t.sources,o=t.popups,i=t.markers,e.abrupt("return",new Promise(function(e){window.setTimeout(function(){n&&a.removeLayers(n),r&&a.removeSources(r),o&&a.removePopups(o),i&&a.removeMarkers(i),e()},150)}));case 2:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)})},{key:"updateContainer",value:function(){var e;null==this||null===(e=this.map)||void 0===e||e.resize(),this._lastFitBounds&&this.owner._fitBoundsTo(null,this._lastFitBounds,function(){return null})}}],function(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,lW(r.key),r)}}(a.prototype,t),Object.defineProperty(a,"prototype",{writable:!1}),a}(a9);function lY(e){return(lY="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)}function lJ(e){var t=Math.sin(e*Math.PI/180);return Math.max(Math.min(Math.log((1+t)/(1-t))/2,Math.PI),-Math.PI)/2}function l$(e,t,n){return Math.floor(Math.log(e/t/n)/Math.LN2)}function lQ(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=Math.pow(10,n),o="function"==typeof e.lat?e.lat():e.lat,i="function"==typeof t.lat?t.lat():t.lat,a="function"==typeof e.lng?e.lng():e.lng,l="function"==typeof t.lng?t.lng():t.lng;return Math.floor(o*r)==Math.floor(i*r)&&Math.floor(a*r)==Math.floor(l*r)}function lK(){lK=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==l0(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(l0(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function lX(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function l0(e){return(l0="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)}function l1(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l1=function(){return!!e})()}function l2(){return(l2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!({}).hasOwnProperty.call(e,t)&&null!==(e=l5(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function l5(e){return(l5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l8(e,t){return(l8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var l4=function(e){var t,n,r;function o(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"google",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o);var l=(t=l5(t=o),r=function(e,t){if(t&&("object"==l0(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,l1()?Reflect.construct(t,[],l5(this).constructor):t.apply(this,n)));return l.initialized=!1,l.transitions=!0,l.type=i,l.options=a,l.registeredOnceEvents=[],l.registeredBounds={},l.boundsMargins={top:0,left:0,bottom:0,right:0},l.initializeMembers(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&l8(e,t)}(o,e),t=[{key:"initializeMembers",value:function(e){var t=this;if(t.map=function(e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"google"){case"google":var r=new ld(e,t,n);if(!r.initialized)throw Error("Google Map could not be initialized.");return r;case"mapbox":var o=new lZ(e,t,n);if(!o.initialized)throw Error("Mapbox could not be initialized.");return o;default:return new a9(e,"unknown",t,n)}}(e,t.type,t,t.options),!t.map.initialized){if("undefined"==typeof window)return;return window.setTimeout(function(){return t.initializeMembers(e)},1e3)}t.initialized=!0}},{key:"destructor",value:function(){l2(l5(o.prototype),"destructor",this).call(this),this.map.destructor()}},{key:"getBounds",value:function(e){var t=this;if(!t.initialized)return console.warn("used getBounds without being initialized"),!1;var n=this.getCoordinatesKey(e);if("object"===l0(this.registeredBounds[n]))return this.registeredBounds[n];var r=t.map.newLatLngBounds();return e.forEach(function(e){t.map.extendLatLngBounds(r,e)}),r}},{key:"getCoordinatesKey",value:function(e){return e.map(function(e){return Array.isArray(e)?e.join(","):e.lat+","+e.lng}).join(";")}},{key:"registerRouteBounds",value:function(e,t){var n=this.getCoordinatesKey(e);this.registeredBounds[n]=t}},{key:"inBounds",value:function(e,t){return e.contains(t.getNorthEast())&&e.contains(t.getSouthWest())}},{key:"registerOneEvent",value:function(e,t){this.registeredOnceEvents[e]&&this.map.removeListener(this.registeredOnceEvents[e]),this.registeredOnceEvents[e]=this.map.addListenerOnce(e,t)}},{key:"areBoundsVisible",value:function(e){var t=this.map.getBounds(),n=!0;return t&&(n=this.inBounds(t,e)),n}},{key:"onClick",value:function(e){var t=this;return t.initialized?t.map.addListener("click",e):(window.setTimeout(function(){return t.onClick(e)},1e3),console.warn("onClick handler without being initialized"),!1)}},{key:"onZoomChanged",value:function(e){var t=this;return t.initialized?t.map.addListener("zoom_changed",function(){e({newZoom:t.map.getZoom()})}):(window.setTimeout(function(){return t.onZoomChanged(e)},1e3),console.warn("onZoomChanged handler without being initialized"),!1)}},{key:"setBoundsMargin",value:function(e){this.boundsMargins=e}},{key:"setTransitions",value:function(e){this.transitions=e}},{key:"reset",value:function(e){this._setZoom(this.map.zoomLevels.Buildings,function(){"function"==typeof e&&e()})}},{key:"setOptions",value:function(e){this.map.setOptions(e)}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"fitBoundsTo",value:function(e,t,n){var r=this;r.addQueue({method:"fitBoundsTo",action:function(){r._fitBoundsTo(e,t,function(e){r.finishQueue(e)})},finish:function(e){e||(e={zoom:r.map.getZoom()}),"function"==typeof n&&n(e)}})}},{key:"panTo",value:function(e,t){var n=this;n.addQueue({method:"panTo",action:function(){n._panTo(e,function(e){n.finishQueue(e)})},finish:t})}},{key:"panToWithZoom",value:function(e,t,n){var r=this;r.addQueue({method:"panToWithZoom",action:function(){r._panToWithZoom(e,t,function(e){r.finishQueue(e)})},finish:n})}},{key:"setBoundsTo",value:function(e,t,n){var r=t.maxMultiZoomLevel,o=t.maxSingleZoomLevel,i=this;i.addQueue({method:"setBoundsTo",action:function(){i._setBoundsTo(e,{maxMultiZoomLevel:r,maxSingleZoomLevel:o},function(e){i.finishQueue(e)})},finish:n})}},{key:"setZoom",value:function(e,t){var n=this;n.addQueue({method:"setZoom",action:function(){n._setZoom(e,function(e){n.finishQueue(e)})},finish:t})}},{key:"zoomIn",value:function(e,t){var n=this;n.addQueue({method:"zoomIn",action:function(){n._zoomIn(e,function(e){n.finishQueue(e)})},finish:t})}},{key:"zoomOut",value:function(e,t){var n=this;n.addQueue({method:"zoomOut",action:function(){n._zoomOut(e,function(e){n.finishQueue(e)})},finish:t})}},{key:"_fitBoundsTo",value:function(e,t,n){var r=this,o=r.areBoundsVisible(t),i={width:r.map.getDiv().clientWidth-(r.boundsMargins.left+r.boundsMargins.right),height:r.map.getDiv().clientHeight-(r.boundsMargins.top+r.boundsMargins.bottom)};i.width<=r.map.getDiv().clientWidth/2&&(i.width=r.map.getDiv().clientWidth/2),i.height<=r.map.getDiv().clientHeight/2&&(i.height=r.map.getDiv().clientHeight/2);var a=t.getCenter(),l=r.map.getZoom();return lQ(t.getNorthEast(),t.getSouthWest(),8)||(l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:21,r=e.getNorthEast(),o=e.getSouthWest(),i=(lJ(r.lat())-lJ(o.lat()))/Math.PI,a=r.lng()-o.lng();return Math.min(l$(t.height,256,i),l$(t.width,256,(a<0?a+360:a)/360),n)}(t,i)),o?r._panTo(e,function(){return r._zoomIn(l,function(){r._panTo(a,function(){n({zoom:r.map.getZoom()})})})}):r._zoomOut(l,function(){r._panTo(a,function(){n({zoom:r.map.getZoom()})})})}},{key:"_panToWithZoom",value:function(e,t,n){var r=this;r._panTo(e,function(){r._setZoom(t,function(e){n(e)})})}},{key:"_panTo",value:function(e,t){if(lQ(e,this.map.getCenter(),6))return t();this.registerOneEvent("idle",function(){window.setTimeout(function(){t()},33)}),this.map.panTo(e)}},{key:"_setBoundsTo",value:function(e,t,n){var r=t.maxMultiZoomLevel,o=t.maxSingleZoomLevel,i=this;if(0===e.length)return n({zoom:i.map.getZoom(),bounds:i.map.getBounds()}),!1;var a=i.getBounds(e);(function(e){for(var t=null,n=0;n<e.length;n++){if(t&&!lQ(t,e[n]))return!0;t=e[n]}return!1})(e)?i.map.setOptions({maxZoom:r}):i.map.setOptions({maxZoom:o}),i._fitBoundsTo(a.getCenter(),a,function(){n({zoom:i.map.getZoom(),bounds:i.map.getBounds()})})}},{key:"_setZoom",value:function(e,t){if(this.map.getZoom()>e)return this._zoomOut(e,t);this._zoomIn(e,t)}},{key:"_zoomIn",value:function(e,t){var n=this,r=n.map.getZoom();if(r>=e)return window.setTimeout(function(){t({zoom:r})},33);var o=e-r;n.transitions&&o>3&&(o=3),n.registerOneEvent("idle",function(){window.setTimeout(function(){if(n.map.getZoom()!==r+o)return t({zoom:n.map.getZoom()});n._zoomIn(e,t)},33)}),n.map.setZoom(r+o)}},{key:"_zoomOut",value:function(e,t){var n=this,r=n.map.getZoom();if(r<=e)return"undefined"==typeof window?t({zoom:r}):window.setTimeout(function(){t({zoom:r})},33);var o=r-e;n.transitions&&o>3&&(o=3),n.registerOneEvent("idle",function(){window.setTimeout(function(){if(n.map.getZoom()!==r-o)return t({zoom:n.map.getZoom()});n._zoomOut(e,t)},33)}),n.map.setZoom(r-o)}},{key:"fetchDirections",value:(n=lK().mark(function e(t){var n;return lK().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this,e.next=3,n.map.fetchDirections(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}},e,this)}),r=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){lX(i,r,o,a,l,"next",e)}function l(e){lX(i,r,o,a,l,"throw",e)}a(void 0)})},function(e){return r.apply(this,arguments)})},{key:"drawRoute",value:function(e){return this.map.drawRoute(e)}},{key:"drawArrow",value:function(e){return this.map.drawArrow(e)}},{key:"cleanup",value:function(e){return this.map.cleanup(e)}},{key:"updateContainer",value:function(){return this.map.updateContainer()}}],function(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,function(e){var t=function(e,t){if("object"!=l0(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=l0(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l0(t)?t:t+""}(r.key),r)}}(o.prototype,t),Object.defineProperty(o,"prototype",{writable:!1}),o}((dZ=function e(){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.queue=[],this.activeItem=null,this.requeueCount=0,this.initialized=!1,this.destructed=!1},dY=[{key:"addQueue",value:function(e){for(;this.queue.length>0;){var t=this.queue.shift();try{"function"==typeof t.finish&&t.finish()}catch(e){console.error("dev: error occured during onFinish handler in map",e,t)}}this.queue.push(e),this.executeQueue()}},{key:"destructor",value:function(){self.initialized=!1,self.destructed=!0}},{key:"executeQueue",value:function(){var e=this;if(!e.initialized)return console.warn("Queue not initialized, retrying to execute queue"),window.setTimeout(function(){e.destructed||e.executeQueue()},1e3);if(e.activeItem){if(e.requeueCount++,e.requeueCount<75)return void window.setTimeout(function(){e.destructed&&e.executeQueue()},200);console.warn("Force QueueItem End:",e.activeItem.method),e.finishQueue(null)}0!==e.queue.length&&(e.requeueCount=0,e.activeItem=e.queue.shift(),e.activeItem.action())}},{key:"finishQueue",value:function(e){if(null!==this.activeItem){try{"function"==typeof this.activeItem.finish&&this.activeItem.finish(e)}catch(e){console.error("dev: error occured during onFinish handler in map",e,this.activeItem)}this.activeItem=null}}}],function(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,function(e){var t=function(e,t){if("object"!=lY(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lY(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lY(t)?t:t+""}(r.key),r)}}(dZ.prototype,dY),Object.defineProperty(dZ,"prototype",{writable:!1}),dZ));function l3(e){return(l3="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)}function l6(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l9(e,t);var n=({}).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)?l9(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l7(){l7=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==l3(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(l3(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function se(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var st=lP.debug,sn=(dJ=l7().mark(function e(t){var n,r,o,i,a;return l7().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.props,r=t.state,o=t.ref,i=t.coordinates,r.setFetching(!0),e.prev=2,e.next=5,n.map.fetchDirections(i);case 5:if(a=e.sent,o.current){e.next=8;break}return e.abrupt("return");case 8:r.setDirectionsRoute(a),e.next=17;break;case 11:if(e.prev=11,e.t0=e.catch(2),o.current){e.next=15;break}return e.abrupt("return");case 15:r.setDirectionsRoute(null),r.setCalculating(!1);case 17:r.setFetching(!1);case 18:case"end":return e.stop()}},e,null,[[2,11]])}),d$=function(){var e=this,t=arguments;return new Promise(function(n,r){var o=dJ.apply(e,t);function i(e){se(o,n,r,i,a,"next",e)}function a(e){se(o,n,r,i,a,"throw",e)}i(void 0)})},function(e){return d$.apply(this,arguments)});let sr=function(e){var t=e.destinationFacility,n=e.index,r=e.infoWindowContentHandler,o=e.infoWindowOpen,i=e.map,a=e.onInfoWindowClickHandler,l=e.onInfoWindowCloseHandler,s=e.onTransportClickHandler,u=e.transportArrowZoomLevel,d=e.selected,f=e.sourceFacility,m=e.mapOptions,p=e.directions,y=(0,v.useIntl)(),h=l6((0,c.useState)(!1),2),g=h[0],b=h[1],j=l6((0,c.useState)(!0),2),_=j[0],w=j[1],x=l6((0,c.useState)(null),2),S=x[0],O=x[1],k=l6((0,c.useState)(m.geodesic),2),C=k[0],M=k[1],P=(0,c.useRef)(!1),I={fetching:g,setFetching:b,directionsRoute:S,setDirectionsRoute:O,calculating:_,setCalculating:w},N={map:i},T=n===d,L=l6((0,c.useMemo)(function(){return[y.locale,y.locale.indexOf("US")>0?"imperial":"metric"]},[y]),2),E=L[0],z=L[1];8&st&&console.log("mapTransportLine",n,null==f?void 0:f.id,null==t?void 0:t.id);var A=(0,c.useMemo)(function(){var e,n;return[null==f||null===(e=f.location)||void 0===e?void 0:e.coordinates[0],null==t||null===(n=t.location)||void 0===n?void 0:n.coordinates[0]]},[f,t]),F=(0,c.useMemo)(function(){return 8&st&&console.log("mapTransportLine:distanceInM:useMemo:",n,S?"routed":"simple"),A[0]&&A[1]?ob(S?S.features[0].geometry.coordinates:[[A[0].lng,A[0].lat],[A[1].lng,A[1].lat]]):0},[A,S]),D=(0,c.useMemo)(function(){return 8&st&&console.log("mapTransportLine:infoWindowContent:useMemo:",n,T,o,Math.round(F/1e3)),T&&o?r({index:n,distanceWithUnit:og(F,E,z),close:l}):null},[T,n,F,o,r]),B=(0,c.useMemo)(function(){if(!i||"mapbox"!==i.type)return 8&st&&console.log("mapTransportLine:route:useMemo:simple path"),A;var e=i.map.getRoute({origin:A[0],destination:A[1],geodesic:C});return 8&st&&console.log("mapTransportLine:route:useMemo:",n,A,e?e.features[0].geometry.coordinates.length:"no route"),e},[i,A,C]);return(0,c.useEffect)(function(){return P.current=!0,function(){P.current=!1}},[]),(0,c.useEffect)(function(){if(8&st&&console.log("mapTransportLine:geodesic:effect:",n,m.geodesic,F,S?"complex":"simple"),w(!1),S)return M(!1);M(!!m.geodesic&&F<1e7)},[F,S]),(0,c.useEffect)(function(){if(m.directions&&p&&!g&&!S&&B&&Array.isArray(B.features)&&i&&"mapbox"===i.type)return 8&st&&console.log("mapTransportLine:directionsRoute:effect:",n,B.features[0].geometry.coordinates.length),w(!0),sn({props:N,state:I,ref:P,coordinates:B.features[0].geometry.coordinates}),function(){I.removed=!0}},[B]),(0,c.useEffect)(function(){if(i&&B&&!_&&!g&&"mapbox"===i.type){var e=null!=S?S:B;8&st&&console.log("mapTransportLine::effect: ",n,"drawing Route with ",e.features[0].geometry.coordinates.length,"elements",S?"complex":"simple");var t=[],r=[],o=[];return m.drawArrows&&i.drawArrow({route:e,isSelected:T,layersRef:t,popupsRef:o,sourcesRef:r,geodesic:C,infoWindowContent:D}),i.drawRoute({route:e,options:m,layersRef:t,sourcesRef:r,isSelected:T,onRouteClickHandler:function(){return s(n)}}),i.registerRouteBounds(A,i.getBounds(e.features[0].geometry.coordinates)),function(){i.cleanup({layers:t,sources:r,popups:o})}}},[i,B,C,_,g,S,T,s]),(0,c.useMemo)(function(){return A[0]&&A[1]&&i&&"google"===i.type?i.drawRoute({route:A,index:n,geodesic:C,isSelected:T,transportArrowZoomLevel:u,infoWindowContent:D,onRouteClickHandler:s,onInfoWindowClickHandler:a,onInfoWindowCloseHandler:l}):null},[i,m,n,T,A,u,D,s,a,l])};var so=lP.debug;let si=function(e){var t,n=e.facility,r=e.index,o=e.infoWindowContentHandler,i=e.infoWindowOpen,a=e.map,l=e.onInfoWindowClickHandler,s=e.onInfoWindowCloseHandler,u=e.onMarkerClickHandler,d=e.selected,f=e.mapOptions;4&so&&console.log("mapFacility::MapFacility ",{id:null==n?void 0:n.id,hyphenatedName:null==n?void 0:n.hyphenatedName,coordinates:null==n||null===(t=n.location)||void 0===t?void 0:t.coordinates});var m=r===d,p=(0,c.useMemo)(function(){var e;return null==n||null===(e=n.location)||void 0===e?void 0:e.coordinates},[n]),y=(0,c.useMemo)(function(){return m&&i?o({index:r,close:s}):null},[r,m,o,i,s]);(0,c.useEffect)(function(){if(a&&"mapbox"===a.type&&p&&0!==p.length){var e=[];return a.map.drawMarker({coordinates:p,options:f,onMarkerClickHandler:function(){return u(r)},markersRef:e,isSelected:!1,infoWindowContent:y}),m&&a.map.drawMarker({coordinates:p,options:f,onMarkerClickHandler:function(){return u(r)},isSelected:!0,infoWindowContent:y,markersRef:e}),function(){a.cleanup({markers:e})}}},[a,p,y,r,m]);var h=(0,c.useMemo)(function(){return a&&"google"===a.type&&p&&0!==p.length?a.map.drawMarker({coordinates:p,index:r,isSelected:m,infoWindowContent:y,onMarkerClickHandler:u,onInfoWindowCloseHandler:s,onInfoWindowClickHandler:l}):null},[a,p,r,m,y,u,l,s]);return p&&0!==p.length?h:(4&so&&console.log("mapFacility::MapFacility no coordinates"),null)};function sa(e){return function(e){if(Array.isArray(e))return sl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return sl(e,void 0);var n=({}).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)?sl(e,void 0):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ss=lP.debug;function sc(e){var t=e.eventType,n=e.eventData,r=e.embedded,o=e.infoWindowContentHandler,i=e.infoWindowOpen,a=e.transportArrowZoomLevel,l=e.map,s=e.onTransportClickHandler,c=e.onMarkerClickHandler,u=e.onInfoWindowCloseHandler,d=e.onInfoWindowClickHandler,f=e.selected,m=e.mapOptions,p=t+n.index;switch(2&ss&&console.log("mapEvents::renderEvent ".concat(p," ").concat(t)),t){case"transport":var h=n.index,v=n.sourceFacility,g=n.destinationFacility,b=n.directions;return(0,y.jsx)(sr,{destinationFacility:g,embedded:r,index:h,infoWindowContentHandler:o,infoWindowOpen:i,transportArrowZoomLevel:a,map:l,onInfoWindowCloseHandler:u,onTransportClickHandler:s,selected:f,sourceFacility:v,mapOptions:m,directions:b},p);case"facility":var j=n.index,_=n.facility;return(0,y.jsx)(si,{embedded:r,facility:_,index:j,infoWindowContentHandler:o,infoWindowOpen:i,transportArrowZoomLevel:a,map:l,onInfoWindowClickHandler:d,onInfoWindowCloseHandler:u,onMarkerClickHandler:c,selected:f,mapOptions:m},p);default:return console.warn("mapEvents::renderEvent(".concat(t,") unsupported eventType")),null}}let su=function(e){var t=e.embedded,n=e.eventChain,r=e.facilities,o=e.infoWindowContentHandler,i=e.infoWindowOpen,a=e.transportArrowZoomLevel,l=e.map,s=e.onInfoWindowClickHandler,u=e.onInfoWindowCloseHandler,d=e.onMarkerClickHandler,f=e.onTransportClickHandler,m=e.selected,p=e.mapOptions;2&ss&&console.log("mapEvents::MapEvents",n,p);var y=(0,c.useMemo)(function(){var e,t,o,i,a,l,s,c;return 2&ss&&console.log("mapEvents::events:useMemo update"),t=(e={eventChain:n,facilities:r,selected:m}).facilities,o=e.selected,i=null,a=!1,l={marker:{},selected:{},unselected:{}},s=function(e,t,n){var r="marker";"transport"===e&&(r=t?"selected":"unselected"),Array.isArray(l[r][e])||(l[r][e]=[]),l[r][e].push(n)},c=0,e.eventChain.forEach(function(e,n){2&ss&&console.log("mapEvents::collectEvents ".concat(n),a,e.type);var r=_.eventTypes.isTransport(e),l=_.eventTypes.isTransportByTruck(e),u=n===o;if(r){2&ss&&console.log("drawEvents ".concat(n," --> transport"));var d=t[e.sourceFacility],f=t[e.destinationFacility];s("transport",u,{index:c,sourceFacility:d,destinationFacility:f,directions:l}),a=!0,c++}else{if(!a&&i){2&ss&&console.log("mapEvents::collectEvents ".concat(n," --> transport (virtual)"));var m,p,y,h,v=t[i.facility],g=t[e.facility];ob([[null==v||null===(m=v.location)||void 0===m?void 0:m.coordinates[0].lng,null==v||null===(p=v.location)||void 0===p?void 0:p.coordinates[0].lat],[null==g||null===(y=g.location)||void 0===y?void 0:y.coordinates[0].lng,null==g||null===(h=g.location)||void 0===h?void 0:h.coordinates[0].lat]])>0&&(s("transport",!1,{index:c,sourceFacility:v,destinationFacility:g,directions:l}),c++)}2&ss&&console.log("mapEvents::collectEvents ".concat(n," --> facility"));var b=t[e.facility];s("facility",u,{index:c,facility:b}),i=e,a=!1,2&ss&&console.log("mapEvents::collectEvents ".concat(n," << "),a),c++}}),l},[n,r,m]);return(0,c.useMemo)(function(){2&ss&&console.log("mapEvents::components:useMemo update");var e=Object.keys(y.unselected).map(function(e){return y.unselected[e].map(function(n){return sc({eventType:e,eventData:n,embedded:t,infoWindowContentHandler:o,infoWindowOpen:i,map:l,onTransportClickHandler:f,onMarkerClickHandler:d,onInfoWindowCloseHandler:u,onInfoWindowClickHandler:s,transportArrowZoomLevel:a,mapOptions:p})})}),n=Object.keys(y.selected).map(function(e){return y.selected[e].map(function(n){return sc({eventType:e,eventData:n,embedded:t,infoWindowContentHandler:o,infoWindowOpen:i,map:l,onTransportClickHandler:f,onMarkerClickHandler:d,onInfoWindowCloseHandler:u,onInfoWindowClickHandler:s,selected:m,transportArrowZoomLevel:a,mapOptions:p})})}),r=Object.keys(y.marker).map(function(e){return y.marker[e].map(function(n){return sc({eventType:e,eventData:n,embedded:t,infoWindowContentHandler:o,infoWindowOpen:i,map:l,onTransportClickHandler:f,onMarkerClickHandler:d,onInfoWindowCloseHandler:u,onInfoWindowClickHandler:s,selected:m,transportArrowZoomLevel:a,mapOptions:p})})});return[].concat(sa(e),sa(n),sa(r))},[y,t,o,i,a,l,f,d,u,s,m,p])},sd=JSON.parse('[{"elementType":"geometry","stylers":[{"color":"#f5f5f5"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#f5f5f5"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.land_parcel","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"administrative.neighborhood","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"poi","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"road","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"color":"#ffffff"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#dadada"}]},{"featureType":"road.highway","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#e5e5e5"}]},{"featureType":"transit.station","elementType":"geometry","stylers":[{"color":"#eeeeee"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#c9c9c9"}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#95a3c3"}]},{"featureType":"water","elementType":"labels.text","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]}]');function sf(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 sm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sf(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==sp(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}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})(e)}function sy(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return sh(e,t);var n=({}).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)?sh(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var sv=5,sg=null,sb=function(e){var t=e.options,n=e.state;t&&"number"==typeof t.zoom&&((sv=t.zoom)<10&&(sv=10),n.setFacilityZoomLevel(sv))},sj=function(e){var t=e.rawMap,n=e.state,r=e.props;try{var o=new l4(t,r.mapOptions.type,r.mapOptions);"function"==typeof r.onLoad&&r.onLoad(o,r.mapOptions.type),n.setCurrentMap(o),"function"==typeof r.onMapClick&&o.onClick(r.onMapClick),o.onZoomChanged(function(e){var t,o,i;return o=(t={newZoom:e.newZoom,state:n,type:r.mapOptions.type}).newZoom,i=t.state,void("google"===t.type&&"number"==typeof o&&o!==i.transportArrowZoomLevel&&(clearTimeout(sg),sg=setTimeout(function(){i.setTransportArrowZoomLevel(o),sg=null},lP.zoomAnimationTime)))}),o.setBoundsMargin({top:lP.maxInfoWindowHeight,bottom:0,left:lP.maxInfoWindowWidth/2,right:lP.maxInfoWindowWidth/2}),o.setBoundsTo(n.allCoordinates,{maxMultiZoomLevel:lP.maxFacilityZoomLevel,maxSingleZoomLevel:lP.maxSingleFacilityZoomLevel},function(e){return sb({options:e,state:n})})}catch(e){console.error("error to initialize map",e)}},s_=function(e,t){t&&t.currentMap&&(t.currentMap.destructor(),t.setCurrentMap(null))},sw=function(e){var t=e.center,n=e.mapClassName,r=e.withMediaClass,o=e.withoutMediaClass,i=e.hasInfoWindowMedia,a=e.currentMapStyles,l=e.state,s=e.props,c=e.children;return(0,a2.useJsApiLoader)({id:"google-map-script",googleMapsApiKey:"AIzaSyD99Of4KlrAVikW2k3NJgSoERcWzFgbFXg"}).isLoaded?(0,y.jsx)(a2.GoogleMap,{id:"origin-map",mapContainerClassName:"".concat(n," ").concat(i?r:o," ").concat("originsMap_googleMapsWrapClass__thqja"),mapContainerStyle:lP.mapContainerStyle,zoom:lP.defaultZoomLevel,center:t,options:{styles:a,disableDefaultUI:!0,restriction:{latLngBounds:{north:85,south:-85,west:-180,east:180},strictBounds:!0}},onLoad:function(e){return sj({rawMap:e,state:l,props:s})},onUnmount:function(e){return s_()},children:c}):null};let sx=function(e){var t=e.embedded,n=e.eventChain,r=e.facilities,o=e.containerClassName,i=e.mapClassName,a=e.infoWindowContentHandler,l=e.mapStyles,s=void 0===l?sd:l,u=e.onInfoWindowClick,d=e.onInfoWindowCloseClick,f=e.onLoad,m=e.onMapClick,p=e.onMarkerClick,h=void 0===p?function(){return!0}:p,v=e.onTransportClick,g=void 0===v?function(){return!1}:v,b=e.openInfoWindowOnFacilityClick,j=void 0===b||b,w=e.openInfoWindowOnTransportClick,x=void 0!==w&&w,S=e.selected,O=e.selectedOrigin,k=e.withMediaClass,C=e.withoutMediaClass,M=e.mapOptions,P=sy((0,c.useState)([]),2),I=P[0],N=P[1];(0,c.useEffect)(function(){var e=JSON.stringify(n),t=JSON.stringify(I);Array.isArray(I)&&e!==t&&N(JSON.parse(e))},[n,I]);var T=(0,c.useContext)(er),L=sy((0,c.useState)(10),2),E=L[0],z=L[1],A=sy((0,c.useState)(lP.defaultTransportArrowZoomLevel),2),F=A[0],D=A[1],B=sy((0,c.useState)("number"==typeof S),2),W=B[0],R=B[1],U=sy((0,c.useState)(!1),2),H=U[0],q=U[1],G=sy((0,c.useState)(null),2),V=G[0],Z=G[1],Y=sy((0,c.useState)(-1),2),J=Y[0],$=Y[1],Q=sy((0,c.useState)(null),2),X=Q[0],ee=Q[1],en=sy((0,c.useState)(S),2),eo=en[0],ei=en[1],ea=(0,c.useRef)(null),el=(0,c.useMemo)(function(){var e;return e=[],I&&0!==I.length&&I.forEach(function(t){var n=r[t.facility];n&&n.location&&Array.isArray(n.location.coordinates)&&n.location.coordinates.forEach(function(t){void 0!==t.lat&&void 0!==t.lng&&e.push(t)})}),e},[I,r]),es=(0,c.useMemo)(function(){var e,t;return null===(e=r[null===(t=I[0])||void 0===t?void 0:t.facility])||void 0===e||null===(e=e.location)||void 0===e?void 0:e.coordinates[0]},[r,I]),ec={allCoordinates:el,facilityZoomLevel:E,setFacilityZoomLevel:z,transportArrowZoomLevel:F,setTransportArrowZoomLevel:D,infoWindowOpen:W,setInfoWindowOpen:R,hasInfoWindowMedia:H,setHasInfoWindowMedia:q,currentMap:X,setCurrentMap:ee,lastSelection:V,setLastSelection:Z,lastFitBoundsIndex:J,setLastFitBoundsIndex:$,currentSelected:eo,setCurrentSelected:ei},eu={onLoad:f,onMapClick:void 0===m?function(){return!0}:m,eventChain:I,facilities:r},ed=(0,c.useMemo)(function(){return T?function(e){if(!(0>Object.keys(K).indexOf(e)))return K[e].map}(T):s},[T,s]),ef=(0,c.useMemo)(function(){var e=Object.assign({},lP.defaultMapOptions),t=et(T);return t&&Object.keys(t).forEach(function(n){e[n]=t[n]}),M&&Object.keys(M).forEach(function(t){e[t]=M[t]}),e},[T,M]),em=(0,c.useMemo)(function(){if(null===eo||!I||!r)return{isTransport:!1,facility:null,sourceFacility:null,destinationFacility:null};var e=I[eo];if("object"!==sp(e))return{isTransport:!1,facility:null,sourceFacility:null,destinationFacility:null};var t=_.eventTypes.isTransport(e);return t?{isTransport:t,facility:null,sourceFacility:r[e.sourceFacility],destinationFacility:r[e.destinationFacility]}:{isTransport:t,facility:r[e.facility],sourceFacility:null,destinationFacility:null}},[I,r,eo]),ep=em.isTransport,ey=em.facility,eh=em.sourceFacility,ev=em.destinationFacility;if((0,c.useEffect)(function(){X&&(X.setTransitions(!1),X.reset(function(){X.setBoundsTo(el,{maxMultiZoomLevel:lP.maxFacilityZoomLevel,maxSingleZoomLevel:lP.maxSingleFacilityZoomLevel},function(e){X.setTransitions(!0),sb({options:e,state:ec})}),Z(null)}))},[O,I]),(0,c.useEffect)(function(){ei(S)},[S]),(0,c.useEffect)(function(){Z(eo),null===eo&&X&&null!==V&&X.setBoundsTo(el,{maxMultiZoomLevel:lP.maxFacilityZoomLevel,maxSingleZoomLevel:lP.maxSingleFacilityZoomLevel},function(e){X.setTransitions(!0),sb({options:e,state:ec})})},[eo]),(0,c.useEffect)(function(){var e,t;if(ep&&eh&&ev&&ec.currentMap){var n=[null==eh||null===(e=eh.location)||void 0===e?void 0:e.coordinates[0],null==ev||null===(t=ev.location)||void 0===t?void 0:t.coordinates[0]],r=ec.currentMap.getBounds(n),o=r.getCenter();ec.currentMap.fitBoundsTo(o,r)}},[eh,ev,ep]),(0,c.useEffect)(function(){var e;if(ey&&eu.eventChain&&!ep&&ec.currentMap){for(var t=null==ey||null===(e=ey.location)||void 0===e?void 0:e.coordinates,n=null,r=null,o=0;o<eu.eventChain.length;o++){var i=eu.eventChain[o];if((null==i?void 0:i.sourceFacility)==ey.id||(null==i?void 0:i.destinationFacility)==ey.id){n=i,r=o;break}(null==i?void 0:i.facility)==ey.id&&(r=o)}if(n){var a,l,s=eu.facilities[n.sourceFacility],c=eu.facilities[n.destinationFacility],u=[null==s||null===(a=s.location)||void 0===a?void 0:a.coordinates[0],null==c||null===(l=c.location)||void 0===l?void 0:l.coordinates[0]];if(!u[0]||!u[1])return null;var d=ec.currentMap.getBounds(u),f=d.getCenter();ec.currentMap.fitBoundsTo(f,d),ec.setLastFitBoundsIndex(r),ec.setLastSelection(r)}else V!==r&&(ec.currentMap.panToWithZoom(t[0],ec.facilityZoomLevel),ec.setLastFitBoundsIndex(1))}},[I,ey,ep]),(0,c.useEffect)(function(){if("mapbox"===ef.type&&ea.current){if(a8().accessToken="pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A",a8().supported()){var e=new(a8()).Map({container:ea.current,style:ef.mapboxStyleUrl,center:es,zoom:lP.defaultZoomLevel,renderWorldCopies:!0,cooperativeGestures:!0});return e.on("load",function(){sj({rawMap:e,state:ec,props:sm(sm({},eu),{},{mapOptions:ef})})}),function(){s_(),e.remove()}}console.warn("WebGL is not supported. Interactive map not loaded.")}},[es,ef]),lP.mock)return(0,y.jsx)("div",{className:o});var eg=X?(0,y.jsx)(su,{map:X,eventChain:I,facilities:r,selected:eo,onInfoWindowCloseHandler:function(e){"function"==typeof d&&d(e),ei(null),R(!1)},onInfoWindowClickHandler:function(e){u&&u(e)},onTransportClickHandler:function(e){ei(e),R(g?g(e):x)},onMarkerClickHandler:function(e){ei(e),R(h?h(e):j)},infoWindowContentHandler:void 0===a?function(){return null}:a,infoWindowOpen:W,transportArrowZoomLevel:F,embedded:void 0!==t&&t,mapOptions:ef}):null;return"mapbox"===ef.type?(0,y.jsx)("div",{className:o,children:(0,y.jsx)("div",{ref:ea,className:"".concat(i," ").concat("originsMap_mapboxMap__thqja"),children:eg})}):"google"===ef.type?(0,y.jsx)("div",{className:o,children:(0,y.jsx)(sw,{mapClassName:i,withMediaClass:void 0===k?"":k,withoutMediaClass:void 0===C?"":C,center:es,currentMapStyles:ed,state:ec,props:sm(sm({},eu),{},{mapOptions:ef}),children:eg})}):(console.warn("no map-type configured"),null)},sS=n(85518);var sO=function(){eU("select_carousel_blog_item",{})};let sk=function(e){var t=e.post,n=t.date,r=t.link,o=t.postExcerpt,i=t.title,a=t.mediumImage,l=t.mediumLargeImage,s=a||l;return(0,y.jsxs)("div",{className:"organizationStoryCard_storyContainer__xdy7b",children:[s&&(0,y.jsx)("a",{href:r,rel:"noopener noreferrer",target:"_blank",onClick:sO,style:{backgroundImage:"url(".concat(sS.isMobileOnly?a:l,")")},className:"organizationStoryCard_storyImg__xdy7b"}),(0,y.jsxs)("div",{className:"".concat("organizationStoryCard_body__xdy7b"," ").concat(s?"":"organizationStoryCard_noThumbnail__xdy7b"),children:[(0,y.jsx)("p",{className:"organizationStoryCard_storyDate__xdy7b",children:b()(n).format("MMMM Do, YYYY")}),(0,y.jsx)("a",{href:r,rel:"noopener noreferrer",target:"_blank",onClick:sO,children:(0,y.jsx)("div",{className:"organizationStoryCard_title__xdy7b",children:i.replace(/(&#(\d+);)/g,function(e,t,n){return String.fromCharCode(n)})})}),(0,y.jsxs)("p",{className:"".concat("organizationStoryCard_description__xdy7b"," ").concat(sS.isMobileOnly?"organizationStoryCard_small__xdy7b":""),children:[o," ",(0,y.jsx)("a",{className:"organizationStoryCard_linkArrow__xdy7b",href:r,rel:"noopener noreferrer",target:"_blank",onClick:sO,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organization-story-card-read-more",defaultMessage:"Read more",description:"Read more link to blog story"})})]})]})]})};function sC(e){return(sC="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)}var sM=["currentSlide","slideCount"],sP=["currentSlide","slideCount"];function sI(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 sN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=sC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==sC(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sT(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var sL=function(e){var t,n,r=e.id,o=e.date,i=e._embedded["wp:featuredmedia"],a=e.link,l=e.post_excerpt,s=e.title,c=i&&(null===(t=i[0])||void 0===t||null===(t=t.media_details)||void 0===t||null===(t=t.sizes)||void 0===t||null===(t=t.medium)||void 0===t?void 0:t.source_url),u=i&&(null===(n=i[0])||void 0===n||null===(n=n.media_details)||void 0===n||null===(n=n.sizes)||void 0===n||null===(n=n.medium_large)||void 0===n?void 0:n.source_url),d={id:r,date:o,link:a,postExcerpt:l,title:s.rendered,mediumImage:c,mediumLargeImage:u};return(0,y.jsx)(sk,{post:d},d.id)},sE={dots:!1,prevArrow:(0,y.jsx)(function(e){var t=e.currentSlide,n=e.slideCount,r=sT(e,sM);return(0,y.jsx)("button",sN(sN({},r),{},{className:"organizationStoriesCarousel_slickPrev__tsukh","data-current":t,"data-total":n,children:(0,y.jsx)("i",{onClick:function(){eU("carousel_blogItem_previous_arrow",{category:"carousel",label:"Org Stories"})},className:"organizationStoriesCarousel_arrowLeftLgGold__tsukh"})}))},{}),nextArrow:(0,y.jsx)(function(e){var t=e.currentSlide,n=e.slideCount,r=sT(e,sP);return(0,y.jsx)("button",sN(sN({},r),{},{className:"organizationStoriesCarousel_slickNext__tsukh","data-current":t,"data-total":n,children:(0,y.jsx)("i",{onClick:function(){eU("carousel_blogItem_next_arrow",{category:"carousel",label:"Org Stories"})},className:"organizationStoriesCarousel_arrowRightLgGold__tsukh"})}))},{}),infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1,arrows:!0,draggable:!0,responsive:[{breakpoint:768,settings:{arrows:!1,centerMode:!0,centerPadding:100}},{breakpoint:576,settings:{arrows:!1,centerMode:!0,centerPadding:70}},{breakpoint:480,settings:{arrows:!1,centerMode:!0,centerPadding:30}}]};let sz=function(e){var t=e.stories,n=e.withTitle;return 1===t.length&&(sE.responsive[0].settings.centerPadding=0,sE.responsive[0].settings.centerMode=!1),(0,y.jsxs)(y.Fragment,{children:[(void 0===n||n)&&(0,y.jsx)("h1",{className:"organizationStoriesCarousel_title__tsukh",children:(0,y.jsx)(v.FormattedMessage,{id:"misc.words.stories",defaultMessage:"Stories",description:"Stories title"})}),(0,y.jsx)(j.Carousel,sN(sN({className:"organizationStoriesCarousel_carousel__tsukh",onSwipe:function(){eU("carousel_blogItem_swipe",{category:"carousel",label:"Org Stories"})}},sE),{},{children:t.map(sL)}))]})},sA=function(e){var t=e.productName;return(0,y.jsx)("div",{className:"productCardName_name__g44z9",children:t||(0,y.jsx)(v.FormattedMessage,{id:"component-product-card-name-unnamed",description:"name of a product if no name is present",defaultMessage:"Unnamed Product"})})},sF=function(e){var t,n=e.product,r=e.mode,o=e.onProductCardClick,i=void 0===o?function(){}:o,a=e.customClass,l=void 0===a?null:a,s=e.routerParam,u=void 0===s?null:s,d=e.index,f=void 0===d?null:d,m=(0,v.useIntl)().locale,p=n.organization,h=null!==(t=null==p?void 0:p.name)&&void 0!==t?t:null==n?void 0:n.organizationName,g=(0,c.useCallback)(function(){return i({productId:n.id,index:f})},[f,n.id,i]),b=(0,c.useMemo)(function(){return iY({hyphenatedName:n.hyphenatedName,id:n.id,itemType:iZ.product})},[n.hyphenatedName,n.id]),j=(0,c.useMemo)(function(){return"".concat("productCard_productGridItem__gr32z"," ").concat("featured-products-card"===l?"productCard_featuredProductsCard__gr32z":"featured-products-carousel"===l?"productCard_featuredProductsCarousel__gr32z":"")},[l]);return(0,y.jsx)("div",{className:j,children:(0,y.jsxs)("div",{className:"productCard_content__gr32z",children:[(0,y.jsx)(aa,{item:n,itemLinkPath:b,itemType:iZ.product,handleImageClick:g,mode:void 0===r?iV:r,routerParam:u}),(0,y.jsxs)("div",{className:"productCard_body__gr32z",children:[(0,y.jsx)("h4",{className:"productCard_orgName__gr32z",children:h}),(0,y.jsx)(ou,{locale:m,to:b,onClick:g,routerParam:u,children:(0,y.jsx)(sA,{productName:null==n?void 0:n.name})}),(0,y.jsx)(ay,{facility:null==p?void 0:p.facility,showOriginText:!0})]})]})})},sD="smallFarmerCard_productTypeWrapper__rmaj6",sB=function(e){var t=e.smallFarmer,n=e.customClass,r=void 0===n?null:n,o=e.mode,i=na().productTypes.enumValues,a=(0,c.useMemo)(function(){return"".concat("smallFarmerCard_smallFarmerGridItem__rmaj6"," ").concat("featured-smallfarmers-card"===r?"smallFarmerCard_featuredSmallFarmersCard__rmaj6":"infowindow-small-farmer"===r?"smallFarmerCard_infowindowSmallFarmer__rmaj6":"")},[r]),l=(0,c.useMemo)(function(){var e;return(null==t||null===(e=t.productTypes)||void 0===e?void 0:e.length)>0&&(null==t?void 0:t.productCount)>0&&i&&"function"==typeof(null==i?void 0:i.filter)},[t,i]);return(0,y.jsx)("div",{className:a,children:(0,y.jsxs)("div",{className:"smallFarmerCard_content__rmaj6",children:[(0,y.jsx)(aa,{item:t,itemType:iZ.smallFarmer,mode:void 0===o?iV:o}),(0,y.jsxs)("div",{className:"smallFarmerCard_body__rmaj6",children:[(0,y.jsx)("div",{className:"smallFarmerCard_name__rmaj6",children:t.name}),(0,y.jsx)(ay,{facility:t.facility}),t.hectares&&(0,y.jsxs)("div",{className:sD,children:[(0,y.jsxs)("b",{children:[(0,y.jsx)(v.FormattedMessage,{id:"card-farmer-growing-area",defaultMessage:"Total Growing Area"}),":"]})," ",(0,y.jsx)("span",{children:t.hectares}),(0,y.jsxs)("span",{children:[" ",(0,y.jsx)(v.FormattedMessage,{id:"card-farmer-label-hectares",defaultMessage:"hectares"})]})]}),l&&(0,y.jsxs)("div",{className:sD,children:[(0,y.jsxs)("b",{children:[(0,y.jsx)(v.FormattedMessage,{id:"card-farmer-product-count",defaultMessage:"Products {productCount}",values:{productCount:(0,y.jsxs)("span",{className:"smallFarmerCard_countHighlight__rmaj6",children:["(",t.productCount,")"]})}}),":"]})," ",(0,y.jsx)(ah,{itemProductTypes:t.productTypes})]})]})]})})};function sW(e){return(sW="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)}function sR(e){if(!e||"object"!==sW(e))return[];var t=[];return Object.keys(e).forEach(function(n){var r=e[n];r&&("enums"===n&&Object.keys(r).forEach(function(r){var o;t=t.concat("function"!=typeof(null==(o=e[n][r])?void 0:o.list)?[]:o.list(["id"]).map(function(e){return o.media(e.id).url}))}),Object.keys(r).forEach(function(e){var n;t=t.concat(Array.isArray(null==(n=r[e])?void 0:n.media)?n.media.map(function(e){return e.mediaType!==m.mediaTypes.image?null:e.url}).filter(function(e){return"string"==typeof e}):[])}))}),t.filter(function(e,t,n){return n.indexOf(e)===t})}var sU=a(353),sH=a.n(sU);function sq(e){return(sq="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)}var sG=(dQ=function e(){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.queue=[]},dK=[{key:"info",value:function(){return"".concat(this.queue.length," items queued")}},{key:"run",value:function(e){var t=this,n=this.queue;this.queue=[],n.forEach(function(n){if("function"==typeof e&&e())return t.queue.push(n);try{n.action()}catch(e){console.error("failed to execute a scroll end action:",e)}})}},{key:"push",value:function(e,t){if(null!=t&&t.clear&&(this.queue=[]),null!=t&&t.unique){var n=!1;if(this.queue.forEach(function(r){var o;(null===(o=r.options)||void 0===o?void 0:o.unique)===t.unique&&(r.action=e,n=!0)}),n)return}this.queue.push({options:t,action:e})}}],function(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,function(e){var t=function(e,t){if("object"!=sq(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sq(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sq(t)?t:t+""}(r.key),r)}}(dQ.prototype,dK),Object.defineProperty(dQ,"prototype",{writable:!1}),dQ);function sV(e){return(sV="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)}var sZ=(dX=function e(t,n){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,e),this.transitions=t,this.state=n},d0=[{key:"changeTo",value:function(e){var t=this,n=this.transitions[this.state];if(void 0===n)throw Error('invalid state name "'.concat(e,'"'));Object.keys(this.transitions).forEach(function(r){if(e===r){if(0>t.transitions[r].from.indexOf(t.state))throw Error("invalid state transition: from ".concat(t.state," to ").concat(e));"function"==typeof n.actionLeave&&n.actionLeave()}}),this.state=e,Object.keys(this.transitions).forEach(function(n){if(e===n){var r=t.transitions[n];"function"==typeof r.actionEnter&&r.actionEnter()}})}},{key:"isIdle",value:function(){return this.state.indexOf("idle")>=0}},{key:"isActive",value:function(){return!this.isIdle()}},{key:"isScrolling",value:function(){return this.state.indexOf("Scrolling")>=0}}],function(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,function(e){var t=function(e,t){if("object"!=sV(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sV(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==sV(t)?t:t+""}(r.key),r)}}(dX.prototype,d0),Object.defineProperty(dX,"prototype",{writable:!1}),dX);let sY={infoWindowContentContainer:"originsStickyMap_infoWindowContentContainer__xax7h",picture:"originsStickyMap_picture__xax7h",organizationName:"originsStickyMap_organizationName__xax7h",facilityLine:"originsStickyMap_facilityLine__xax7h",facilityName:"originsStickyMap_facilityName__xax7h",distance:"originsStickyMap_distance__xax7h",originsMap:"originsStickyMap_originsMap__xax7h",mapLoading:"originsStickyMap_mapLoading__xax7h",loaderGif:"originsStickyMap_loaderGif__xax7h",zoomPlus:"originsStickyMap_zoomPlus__xax7h",zoomMinus:"originsStickyMap_zoomMinus__xax7h",originsMapEmbedded:"originsStickyMap_originsMapEmbedded__xax7h",withNavSlider:"originsStickyMap_withNavSlider__xax7h",mapContainer:"originsStickyMap_mapContainer__xax7h",originsMapEmbeddedSwap:"originsStickyMap_originsMapEmbeddedSwap__xax7h",originsMap__inner:"originsStickyMap_originsMap__inner__xax7h",opened:"originsStickyMap_opened__xax7h",mapOnly:"originsStickyMap_mapOnly__xax7h",closed:"originsStickyMap_closed__xax7h",originsMapShowBtn:"originsStickyMap_originsMapShowBtn__xax7h",originsMapShowBtnOpened:"originsStickyMap_originsMapShowBtnOpened__xax7h"};function sJ(e){return(sJ="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)}function s$(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 sQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s$(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=sJ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=sJ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==sJ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let sX=function(e){var t,n=e.eventChain,r=e.facilities,o=e.selected,i=e.setSelectedEvent,a=e.innerContainerRef,l=e.containerRef,s=e.selectedOrigin,u=e.expandMap,d=void 0!==u&&u,m=e.setExpand,p=void 0===m?function(){return null}:m,h=e.stickyTo,v=e.embedded,g=void 0!==v&&v,b=e.stickyOptions,j=void 0===b?{}:b,_=e.enableSticky,w=void 0===_||_,x=e.swap,S=e.onStickyInitDestroy,O=e.withNavSlider,k=e.mapOptions,C=e.dynamicFieldsUpdating,M=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(!1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return sK(e,2);var n=({}).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)?sK(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),P=M[0],I=M[1],N=(0,c.useRef)(void 0),T=(0,c.useRef)(void 0);return(0,c.useEffect)(function(){if(w){T.current=new(ax())(".".concat(sY.originsMap),sQ(sQ({stickyContainer:h,marginTop:108,marginBottom:0,wrap:!0,stickyClass:sY.fixedToTop},j),{},{onChange:function(e){var t=e.sticky,n=e.bottom;t||p(!1),I(t),j.onChange&&j.onChange({bottom:n,sticky:t})}})),S&&S(T.current);var e,t,n,r=document.getElementsByClassName(sY.originsMap);if(null!=r&&r.length){var o=r[0];n=o.addEventListener("transitionend",function(){N.current&&N.current.updateContainer()}),t=o.addEventListener("transitionrun",function(e){var t;e.target===e.currentTarget&&(null===(t=T.current)||void 0===t||t.update())})}return function(){var e;null!=r&&r.length&&(r[0].removeEventListener("transitionrun",t),r[0].removeEventListener("transitionend",n)),null===(e=T.current)||void 0===e||e.destroy(),T.current=void 0,S&&S()}}null==T||null===(e=T.current)||void 0===e||e.destroy(),T.current=void 0,S&&S()},[w]),(0,y.jsx)("div",{className:"".concat(sY.originsMap," ").concat(g?sY.originsMapEmbedded:""," ").concat(g&&void 0!==x&&x?sY.originsMapEmbeddedSwap:""," ").concat(d?sY.opened:sY.closed," ").concat(O?sY.withNavSlider:sY.mapOnly),ref:l,onTransitionEnd:function(){var e;null===(e=T.current)||void 0===e||e.update()},children:(0,y.jsxs)("div",{className:sY.originsMap__inner,ref:a,children:[C?(0,y.jsx)("div",{className:sY.mapLoading,children:(0,y.jsx)("div",{className:sY.loaderGif,children:(0,y.jsx)(f(),{src:ng,height:187,width:187,alt:"loader"})})}):(0,y.jsx)(sx,{eventChain:n,facilities:r,selected:o,selectedOrigin:s,mapOptions:k,onLoad:function(e){N.current=e,N.current.updateContainer()},mapClassName:sY.map,containerClassName:sY.mapContainer,infoWindowContentHandler:function(e){e.index;var t=e.distanceWithUnit;if(t){var n=[];return n.push({type:"text",data:{text:t,className:sY.distance}}),n.push({type:"containerClassName",data:sY.infoWindowContentContainer}),n}return null},onMapClick:function(){p(),eU("Clicked map",{category:"Engagement",label:"Product profile"})},onMarkerClick:function(e){return eU("Clicked map marker",{category:"Engagement",label:"Product profile"}),i(e,!0),!(!d&&P&&(p(),1))},onTransportClick:function(e){return eU("Clicked transport line",{category:"Engagement",label:"Product profile"}),i(e,!0),!(!d&&P&&(p(),1))},onInfoWindowClick:function(){eU("Clicked map infowindow",{category:"Engagement",label:"Product profile"}),!d&&P&&p()},onInfoWindowCloseClick:function(){return eU("Clicked map infowindow close",{category:"Engagement",label:"Product profile"}),!(!d&&P&&(p(),1))}}),(0,y.jsx)("button",{className:"".concat(sY.originsMapShowBtn," ").concat(d?sY.originsMapShowBtnOpened:sY.originsMapShowBtnClosed),onClick:function(){p(!1),eU("Clicked map expand",{category:"Engagement",label:"Product profile"})},type:"button"}),!C&&(0,y.jsxs)(ea,{styles:sY,owner:"OriginsStickyMap",children:[(0,y.jsx)("div",{onClick:function(){var e;null===(e=N.current)||void 0===e||e.setZoom(N.current.getZoom()+1),eU("Clicked map zoom (more)",{category:"Engagement",label:"Product profile"})},className:sY.zoomPlus,children:(0,y.jsx)(f(),{src:"/images/icon-plus.svg",height:30,width:30,alt:"plus icon"})}),(0,y.jsx)("div",{onClick:function(){var e,t;null==N||null===(e=N.current)||void 0===e||e.setZoom((null==N||null===(t=N.current)||void 0===t?void 0:t.getZoom())-1),eU("Clicked map zoom (less)",{category:"Engagement",label:"Product profile"})},className:sY.zoomMinus,children:(0,y.jsx)(f(),{src:"/images/icon-minus.svg",height:30,width:30,alt:"minus icon"})})]})]})})},s0={originsSection:"originsSection_originsSection__kmh4x",originsMapStepsWrapper:"originsSection_originsMapStepsWrapper__kmh4x",container:"originsSection_container__kmh4x",content:"originsSection_content__kmh4x",embedNavModal:"originsSection_embedNavModal__kmh4x",originStepsWrapper:"originsSection_originStepsWrapper__kmh4x",originsSectionEmbedded:"originsSection_originsSectionEmbedded__kmh4x",withNavSlider:"originsSection_withNavSlider__kmh4x",originNavSlider:"originsSection_originNavSlider__kmh4x"};function s1(e){return(s1="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)}function s2(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s2=function(){return!!e})()}function s5(e){return(s5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s8(e,t){return(s8=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s4=eQ.fromTabletWithoutMobileLandscape,s3=function(e){var t;function n(e){var t,r,o;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),(r=n,o=[e],r=s5(r),t=function(e,t){if(t&&("object"==s1(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,s2()?Reflect.construct(r,o||[],s5(this).constructor):r.apply(this,o))).state={selectedOrigin:null!=e&&e.origins?e.origins[0]:null,selectedEvent:null,expandMap:!1,showAllSteps:!1,isDesktopViewState:!1},t.stickyOptions={onChange:function(){return t.updateStickyMargins()}},t.__numberOfEvents=0,t._stateMachine=new sZ({idle:{from:["snapScrolling","externScrolling","mapExpanding","updateStickyNav","updateStickyMap"],actionEnter:function(){t._stateMachineIdleQueue.run(function(){return t._stateMachine.isActive()})}},externScrolling:{from:["idle"]},userScrolling:{from:"idle"},snapScrolling:{from:["userScrolling"],actionEnter:function(){return t.state.selectedEvent,t._stateMachine.changeTo("idle")}},mapExpanding:{from:["idle"],actionEnter:function(){setTimeout(function(){t.updateSnapPadding(),"mapExpanding"===t._stateMachine.state&&t._stateMachine.changeTo("idle")},500)}},updateStickyMap:{from:["idle"],actionEnter:function(){t._stickyMap&&t._stickyMap.update(),setTimeout(function(){t.updateSnapPadding(),t._stateMachine.changeTo("idle")},100)}},updateStickyNav:{from:["idle"],actionEnter:function(){t._stickyNav&&t._stickyNav.update(),setTimeout(function(){t.updateSnapPadding(),t._stateMachine.changeTo("idle")},100)}}},"idle"),t._scrollEndQueue=new sG,t._stateMachineIdleQueue=new sG,t._scrollEndTimer=null,t._lastScrolledEventIndex=null,t._lastScrollTop=0,t._minScrollToUnselectAll=10,t._section=(0,c.createRef)(),t._innerMapContainer=(0,c.createRef)(),t._mapContainer=(0,c.createRef)(),t._originStepContainer=(0,c.createRef)(),t._navSlider=(0,c.createRef)(),t.onWindowScroll=t.onWindowScroll.bind(t),t.setExpandMap=t.setExpandMap.bind(t),t.setSelectedEvent=t.setSelectedEvent.bind(t),t.setExternSelectElement=t.setExternSelectElement.bind(t),t.onDesktopScroll=t.onDesktopScroll.bind(t),t.onOriginSelect=t.onOriginSelect.bind(t),t.onStickyNavSliderInitDestroy=t.onStickyNavSliderInitDestroy.bind(t),t.onStickyMapInitDestroy=t.onStickyMapInitDestroy.bind(t),t.updateStickyMargins=t.updateStickyMargins.bind(t),t.scrollLock=t.scrollLock.bind(t),t.scrollLockReleaseCheck=t.scrollLockReleaseCheck.bind(t),t.updateDesktopViewState=t.updateDesktopViewState.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw 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&&s8(e,t)}(n,e),t=[{key:"isDesktopView",value:function(){var e=this.props,t=e.windowWidth,n=e.windowHeight,r=e.portrait;return!!e.embedded||!!s4({width:t,height:n,portrait:r})}},{key:"updateDesktopViewState",value:function(){var e=this.isDesktopView();this.state.isDesktopViewState!=e&&this.setState({isDesktopViewState:e})}},{key:"updateSnapPadding",value:function(){var e,t,n,r,o=null!==(e=null===(t=this._innerMapContainer)||void 0===t||null===(t=t.current)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0,i=(null!==(n=null===(r=this._navSlider)||void 0===r||null===(r=r.current)||void 0===r?void 0:r.clientHeight)&&void 0!==n?n:0)+o+"px";document.body.parentElement.style.scrollPaddingTop=i}},{key:"bindEventListeners",value:function(){var e,t;window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),null===(e=this._innerMapContainer.current)||void 0===e||e.addEventListener("transitionrun",this.updateStickyMargins,{passive:!0}),null===(t=this._innerMapContainer.current)||void 0===t||t.addEventListener("transitionend",this.updateStickyMargins,{passive:!0}),this._navSlider.current&&(this._navSlider.current.addEventListener("transitionend",this.updateStickyMargins,{passive:!0}),this._navSlider.current.addEventListener("transitionrun",this.updateStickyMargins,{passive:!0}))}},{key:"unbindEventListeners",value:function(){var e,t;window.removeEventListener("scroll",this.onWindowScroll,{passive:!0}),null===(e=this._innerMapContainer.current)||void 0===e||e.removeEventListener("transitionrun",this.updateStickyMargins),null===(t=this._innerMapContainer.current)||void 0===t||t.removeEventListener("transitionend",this.updateStickyMargins),this._navSlider.current&&(this._navSlider.current.removeEventListener("transitionrun",this.updateStickyMargins),this._navSlider.current.removeEventListener("transitionend",this.updateStickyMargins))}},{key:"runWhenIdle",value:function(e,t){var n=this;this._stateMachineIdleQueue.push(e,t),this._stateMachine.isActive()||this._stateMachineIdleQueue.run(function(){return n._stateMachine.isActive()})}},{key:"ensureStepContainerInView",value:function(){}},{key:"getStepElement",value:function(e){return document.getElementById("supply-step-".concat(e))}},{key:"getSelectFocusOffset",value:function(){if(this.isDesktopView()){var e=this._originStepContainer.current.getBoundingClientRect().height;return Math.min(this._minScrollToUnselectAll,e/10)}return Math.min(this._minScrollToUnselectAll,0)}},{key:"setExpandMap",value:function(e){var t=this;return this.runWhenIdle(function(){return t._stateMachine.changeTo("mapExpanding"),void t.setState({expandMap:"boolean"==typeof e?e:!t.state.expandMap})},{unique:"setExpandMap",origin:"setExpandMap"})}},{key:"storeScrollDirection",value:function(e){this._lastScrollTop<e?this._scrollDirection="down":this._scrollDirection="up",this._lastScrollTop=e}},{key:"onOriginSelect",value:function(e){var t=this,n=this.props.router;n.push(n.pathname,n.asPath.replace(/\/(organization|facility|ingredient|certification|value|recipe|blockchain-info|storyClaim)\/[^/?#]*(?!.*(organization|facility|ingredient|certification|value|recipe|blockchain-info|storyClaim))/,""),{scroll:!1}),this.setState({selectedOrigin:e},function(){t.setExternSelectElement(null,!0,"auto")})}},{key:"scrollToEventDesktop",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth";if(null===e){var n=-this._originStepContainer.current.scrollTop;return this._originStepContainer.scrollY==n&&this._stateMachine.changeTo("idle"),this._lastScrolledEventIndex=e,this._originStepContainer.current.scrollBy(0,n)}var r=this._originStepContainer.current.getBoundingClientRect(),o=r.top,i=r.height,a=this.getStepElement(e),l=a?a.getBoundingClientRect():{top:0,height:0},s=l.top,c=l.height,u=l.bottom,d=this.getSelectFocusOffset(),f=i-d,m=s-o-d;this._lastScrolledEventIndex==e&&c>f&&(s<0||u>f)||this._lastScrolledEventIndex==e&&s<0&&Math.abs(s)>c/3||(0===e&&(m+=d),this._originStepContainer.current.scrollBy({left:0,top:m,behavior:t}),this._lastScrolledEventIndex=e)}},{key:"scrollToEventMobile",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth",r=this.state.showAllSteps;this.props.windowHeight,r||(r=e+1>3),this.setState({showAllSteps:r},function(){var r,o,i,a,l=null!==(r=null===(o=t._innerMapContainer)||void 0===o||null===(o=o.current)||void 0===o?void 0:o.clientHeight)&&void 0!==r?r:0,s=(null!==(i=null===(a=t._navSlider)||void 0===a||null===(a=a.current)||void 0===a?void 0:a.clientHeight)&&void 0!==i?i:0)+l,c=t._originStepContainer.current.getBoundingClientRect(),u=c.top,d=(c.bottom,0);if(null===e)d=u-s+10;else{var f=t.getStepElement(e),m=f?f.getBoundingClientRect():{top:0,height:0,bottom:0},p=m.top,y=m.height,h=m.bottom;if(0===p&&0===y&&0===h)return void setTimeout(function(){return t.scrollToEventMobile(e,n)},1);d=p-s-10-t.getSelectFocusOffset(),0===e&&p-s>0&&(d=u-s+10)}Math.abs(d)>=12&&(window.scrollBy({left:0,top:d,behavior:n}),t._lastScrolledEventIndex=e)})}},{key:"scrollToSelectedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"smooth",t=this.state.selectedEvent;this.checkScrollEnd(),this.scrollToEvent(t,e)}},{key:"scrollToEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"smooth";this._scrollEndQueue.push(function(){t._stateMachine.isScrolling()&&t._stateMachine.changeTo("idle")},{unique:"transitionIdle",origin:"scrollToEvent"}),this.isDesktopView()?this.scrollToEventDesktop(e,n):this.scrollToEventMobile(e,n)}},{key:"setSelectedEvent",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.setState(function(t){return t.selectedEvent!==e?{selectedEvent:e}:null},function(){n&&t.scrollToEvent(e),"function"==typeof r&&r()})}},{key:"setExternSelectElement",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"smooth";return this.runWhenIdle(function(){t.setSelectedEvent(e,!1,function(){n&&(t._scrollEndQueue.push(function(){t._stateMachine.isScrolling()&&t._stateMachine.changeTo("idle")},{unique:"setExternSelectElement",origin:"setExternSelectElement"}),t._stateMachine.changeTo("externScrolling"),t._lastScrolledEventIndex=null,t.scrollToSelectedEvent(r))})},{origin:"setExternSelectElement"})}},{key:"checkScrollEnd",value:function(){var e=this;this._scrollEndTimer&&clearTimeout(this._scrollEndTimer);var t=50;"userScrolling"===this._stateMachine.state&&(t=500),this._scrollEndTimer=setTimeout(function(){e._scrollEndTimer=null,e._scrollEndQueue.run(),e._scrollEndQueue.queue.length&&e.checkScrollEnd()},t)}},{key:"onDesktopScroll",value:function(){var e=this;if(this.isDesktopView()&&!(this.__numberOfEvents<=0)){this.ensureStepContainerInView(),this._stateMachine.isScrolling()||(this._scrollEndQueue.push(function(){return e._stateMachine.changeTo("snapScrolling")},{origin:"onDesktopScroll"}),this._stateMachine.changeTo("userScrolling"));var t=this._originStepContainer.current.scrollTop;if(this.storeScrollDirection(t),this.checkScrollEnd(),this._originStepContainer.current.offsetHeight+t>=this._originStepContainer.current.scrollHeight)return this.setSelectedEvent(this.__numberOfEvents-1,!1);if(t<this._minScrollToUnselectAll-42)return this.setSelectedEvent(null,!1);for(var n=this._originStepContainer.current.scrollTop,r=this._originStepContainer.current.getBoundingClientRect().top,o=0;o<this.__numberOfEvents;o++){var i=this.getStepElement(o).getBoundingClientRect(),a=i.top,l=i.height,s=a+n-r-this.getSelectFocusOffset()-42;if(!(n<s||n>s+l+12)){this.setSelectedEvent(o,!1);break}}}}},{key:"onMobileScroll",value:function(){var e,t,n=this;if(!this.isDesktopView()&&(!this._stateMachine.isActive()||this._stateMachine.isScrolling())&&"externScrolling"!=this._stateMachine.state){this._stateMachine.isScrolling()||(this._scrollEndQueue.push(function(){return n._stateMachine.changeTo("snapScrolling")},{origin:"onMobileScroll"}),this._stateMachine.changeTo("userScrolling")),this.storeScrollDirection(window.scrollY),this.checkScrollEnd();var r=null==this||null===(e=this.__stickyStatus)||void 0===e?void 0:e.sticky,o=null==this||null===(t=this.__stickyStatus)||void 0===t?void 0:t.bottom,i=this.state.selectedEvent;if(!(this.__numberOfEvents<=0)){if(!r&&!o)return null!==i?this.setSelectedEvent(null,!1):void 0;if(r||o)for(var a=this._mapContainer.current.getBoundingClientRect(),l=a.top,s=a.height,c=window.scrollY,u=0;u<this.__numberOfEvents;u++){var d=this.getStepElement(u).getBoundingClientRect(),f=d.top,m=d.height,p=l+s;if(!(c>f+c-this.getSelectFocusOffset()+m-12-p-.25*m)){this.setSelectedEvent(u,!1);break}}}}}},{key:"onWindowScroll",value:function(){var e=this;window.requestAnimationFrame(function(){e.onMobileScroll()}),this.__prevBodyHeight!==document.body.scrollHeight&&this.updateStickyMargins(),this.__prevBodyHeight=document.body.scrollHeight}},{key:"componentDidMount",value:function(){this.bindEventListeners(),this.updateStickyMargins(),this.updateEventMargins()}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"componentDidUpdate",value:function(){this.updateDesktopViewState()}},{key:"onStickyNavSliderInitDestroy",value:function(e){this._stickyNav=e}},{key:"onStickyMapInitDestroy",value:function(e){this._stickyMap=e}},{key:"updateEventMargins",value:function(){this._minScrollToUnselectAll=10;var e=this.getStepElement(0);if(e){var t=e.offsetTop;this._minScrollToUnselectAll=Math.max(10,t-12)}}},{key:"updateStickyMargins",value:function(e){var t,n,r=this,o="boolean"==typeof e?e:null!==(t=this.state.showAllSteps)&&void 0!==t&&t;0!==this._stateMachine.state.indexOf("updateSticky")&&(n=o||this.__numberOfEvents<=2?this.getStepElement(this.__numberOfEvents-1):this.getStepElement(2),window.requestAnimationFrame(function(){if(n){var e,t,o,i,a,l,s,c,u,d,f,m=!1,p=null!==(e=null===(t=r._navSlider.current)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0,y=(null===(o=r._section.current)||void 0===o?void 0:o.getBoundingClientRect().bottom)-n.getBoundingClientRect().top,h=(null===(i=r._section.current)||void 0===i?void 0:i.getBoundingClientRect().bottom)-n.getBoundingClientRect().top+(null===(a=r._mapContainer.current)||void 0===a?void 0:a.clientHeight);null!==(l=r._stickyNav)&&void 0!==l&&l.elements[0]&&(null===(s=r._stickyNav)||void 0===s||null===(s=s.elements[0])||void 0===s||null===(s=s.sticky)||void 0===s?void 0:s.marginBottom)!==h&&(r._stickyNav.elements[0].sticky.marginBottom=h,r.runWhenIdle(function(){r._stateMachine.changeTo("updateStickyNav")},{unique:"updateStickyNav"})),null!==(c=r._stickyMap)&&void 0!==c&&c.elements&&null!==(u=r._stickyMap.elements[0])&&void 0!==u&&u.sticky&&r._stickyMap.elements[0].sticky.marginBottom!==y&&(r._stickyMap.elements[0].sticky.marginBottom=y,m=!0),null!==(d=r._stickyMap)&&void 0!==d&&d.elements&&null!==(f=r._stickyMap.elements[0])&&void 0!==f&&f.sticky&&r._stickyMap.elements[0].sticky.marginTop!==p&&(r._stickyMap.elements[0].sticky.marginTop=p,m=!0),m&&r.runWhenIdle(function(){r._stateMachine.changeTo("updateStickyMap")},{unique:"updateStickyMap"})}}))}},{key:"scrollLock",value:function(){var e=this;window.requestAnimationFrame(function(){window.scrollTo(0,e._scrollLockY+e._scrollLockYOffset)})}},{key:"scrollLockBind",value:function(){var e=this;this._scrollStopperActive=!0,window.addEventListener("scroll",this.scrollLock),setTimeout(function(){window.removeEventListener("scroll",e.scrollLock),window.addEventListener("scroll",e.scrollLockReleaseCheck)},500)}},{key:"scrollLockReleaseCheck",value:function(){var e=window.pageYOffset||document.documentElement.scrollTop;Math.abs(this._scrollLockY-e)<window.innerHeight||(this._scrollStopperActive=!1,window.removeEventListener("scroll",this.scrollLockReleaseCheck))}},{key:"lockStickyScroll",value:function(){}},{key:"render",value:function(){var e=this,t=this.props,n=t.customCertifications,r=t.origins,o=t.facilities,i=t.organizations,a=t.products,l=t.events,s=t.ingredientDescriptions,c=t.nutritionFacts,u=t.recipes,d=t.hideFacilityName,f=t.hideJourneySummary,p=t.blockchainType,h=t.blockchainStatus,v=t.embedded,g=t.embeddedFull,b=t.swap,j=t.mapOptions,_=t.dynamicFieldsUpdating,w=t.claims,x=this.state,S=x.selectedOrigin,O=x.selectedEvent,k=x.expandMap,C=x.showAllSteps,M=x.isDesktopViewState,P=(0,m.constructChainsfromOrigin)({origin:S,products:a,events:l,cache:!1}),I=P.productChain,N=P.eventChain;if(!I||!N)return console.error("fatal: unable to construct chains from origin. check story data"),null;this.__numberOfEvents=N.length;var T=r.length>1;return(0,y.jsx)(ea,{styles:s0,owner:"OriginsSection",children:(0,y.jsxs)("section",{className:"".concat(s0.originsSection," ").concat(v?s0.originsSectionEmbedded:""),ref:this._section,children:[T?(0,y.jsx)(aP,{origins:r,products:a,onChange:this.onOriginSelect,selectedOrigin:S,expandMap:k,stickyOptions:this.stickyOptions,enableSticky:!M,stickyTo:".".concat(s0.originsSection),containerRef:this._navSlider,onStickyInitDestroy:this.onStickyNavSliderInitDestroy,embedded:v}):null,(0,y.jsx)("div",{className:s0.originsMapStepsWrapper,children:(0,y.jsx)("div",{className:"containerWrapper "+s0.containerWrapper,children:(0,y.jsx)("div",{className:"container "+s0.container,children:(0,y.jsxs)("div",{className:"".concat(s0.content," ").concat(T?s0.withNavSlider:""),children:[(0,y.jsx)(sX,{withNavSlider:T,selectedOrigin:S,eventChain:N,facilities:o,setSelectedEvent:this.setExternSelectElement,expandMap:k,embedded:v,selected:O,mapOptions:j,setExpand:this.setExpandMap,innerContainerRef:this._innerMapContainer,containerRef:this._mapContainer,enableSticky:!M,stickyTo:".".concat(s0.originsSection),stickyOptions:{marginTop:108,onChange:function(t){e.__stickyStatus=t,e.updateStickyMargins(),e.lockStickyScroll()}},onStickyInitDestroy:this.onStickyMapInitDestroy,swap:b,dynamicFieldsUpdating:_}),(0,y.jsxs)("div",{className:"".concat(s0.originStepsWrapper," ").concat(T?s0.withNavSlider:""),children:[(0,y.jsx)(a1,{selected:O,productChain:I,organizations:i,facilities:o,events:l,storyClaims:w,embeddedFull:g,embedded:v,withNavSlider:T,containerRef:this._originStepContainer,showAllSteps:C,minimumStepsShown:3,onScroll:this.onDesktopScroll,hideFacilityName:d,hideJourneySummary:f,blockchainType:p,blockchainStatus:h,dynamicFieldsUpdating:_,afterHideShowSteps:function(t){t!==C&&e.setState({showAllSteps:t},function(){e.updateStickyMargins()})}}),(0,y.jsx)(iW,{customCertifications:n,className:s0.originsSectionNavModals,organizations:i,facilities:o,ingredientDescriptions:s,nutritionFacts:c,recipes:u,embedded:v,storyClaims:w})]})]})})})}),v?(0,y.jsx)(aK,{blockchainStatus:h,blockchainType:p}):null]})})}}],function(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,function(e){var t=function(e,t){if("object"!=s1(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=s1(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==s1(t)?t:t+""}(r.key),r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}(c.Component);let s6=e4((0,S.withRouter)(s3)),s9=function(e){var t=e.organizations,n=(0,c.useMemo)(function(){if(!_||!_.certificationTypes)return[];var e=[];return t&&Object.keys(t).forEach(function(n){var r=t[n];Array.isArray(null==r?void 0:r.certifications)&&r.certifications.forEach(function(t){e.indexOf(t)>=0||e.push(t)})}),_.certificationTypes.list(["id","media"]).filter(function(t){return e.includes(t.id)})},[t]);return n?(0,y.jsx)(y.Fragment,{children:n.map(function(e,t){return(0,y.jsx)("span",{style:{position:"absolute",width:0,height:0,overflow:"hidden",zIndex:-1,backgroundImage:"url(".concat(null==e?void 0:e.imagePath)}},t)})}):null},s7={removeUntilTablet:"organizationProfileModalContent_removeUntilTablet__wykxh",orgDetails:"organizationProfileModalContent_orgDetails__wykxh",detailsContainer:"organizationProfileModalContent_detailsContainer__wykxh",typeLine:"organizationProfileModalContent_typeLine__wykxh",yearEstablished:"organizationProfileModalContent_yearEstablished__wykxh",goldDotSeparator:"organizationProfileModalContent_goldDotSeparator__wykxh",orgBanner:"organizationProfileModalContent_orgBanner__wykxh",hasOrganizationTag:"organizationProfileModalContent_hasOrganizationTag__wykxh",lineContainer:"organizationProfileModalContent_lineContainer__wykxh",orgName:"organizationProfileModalContent_orgName__wykxh",countryFlag:"organizationProfileModalContent_countryFlag__wykxh",locationText:"organizationProfileModalContent_locationText__wykxh",orgBody:"organizationProfileModalContent_orgBody__wykxh",bodyContentContainer:"organizationProfileModalContent_bodyContentContainer__wykxh",story:"organizationProfileModalContent_story__wykxh",panelHeader:"organizationProfileModalContent_panelHeader__wykxh",seeMoreLink:"organizationProfileModalContent_seeMoreLink__wykxh",socialSection:"organizationProfileModalContent_socialSection__wykxh",socialLinkContainer:"organizationProfileModalContent_socialLinkContainer__wykxh",socialSectionTitle:"organizationProfileModalContent_socialSectionTitle__wykxh",values:"organizationProfileModalContent_values__wykxh"};function ce(e){return(ce="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)}function ct(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 cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=ce(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ce(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ce(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let cr=function(e){var t,n=e.organization,r=e.organizations,o=e.mainFacility,i=e.hideLocationText,a=e.hideMedia,l=e.hideInfos,s=e.hideCertifications,u=n.type,d=n.organizationType,f=n.yearEstablished,m=(n.facilities,n.values),p=n.valuesSorted,h=n.certifications,g=n.certificationsSorted,b=n.social,j=(0,c.useMemo)(function(){return null!=h&&h.length?n.certifications:null},[h]),_=(0,c.useMemo)(function(){return null!=g&&g.length?n.certificationsSorted:[]},[g]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("section",{className:s7.orgBanner,children:!(void 0!==a&&a)&&(0,y.jsx)(ro,{mediaItemsClass:"fromOrganizationModalContent",media:n.media,placeholderImage:"/images/image-placeholder--grey.svg",slug:"organization",modalProps:{zIndex:1015}})}),(0,y.jsx)("section",{className:s7.orgDetails,children:(0,y.jsxs)("div",{className:s7.detailsContainer,children:[(0,y.jsx)("div",{className:s7.hasOrganizationTag,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationSection-organization-tag",defaultMessage:"Organization"})}),(0,y.jsx)("div",{className:s7.lineContainer,children:(0,y.jsx)("h1",{className:s7.orgName,children:n.name})}),!(void 0!==i&&i)&&(0,y.jsxs)("div",{className:s7.lineContainer,children:[(0,y.jsx)("span",{className:s7.countryFlag,children:(0,y.jsx)(o0(),{countryCode:o.location.countryCode,svg:!0})}),(0,y.jsx)("span",{className:s7.locationText,children:(0,y.jsx)(rm,cn(cn({hideIcon:!0},o.location),{},{hideFacilityName:!0,customClass:"orgSectionPlace"}))})]}),(0,y.jsxs)("div",{className:"".concat(s7.lineContainer," ").concat(s7.typeLine),children:[(0,y.jsx)(o4,{type:null!=d?d:u}),f&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{className:s7.goldDotSeparator,children:" • "}),(0,y.jsx)("span",{className:s7.yearEstablished,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationSection-established",defaultMessage:"Established {yearEstablished}",values:{yearEstablished:f}})})]})]})]})}),(0,y.jsx)("section",{className:s7.orgBody,children:(0,y.jsxs)("div",{className:s7.bodyContentContainer,children:[(0,y.jsx)("div",{className:s7.story,children:(0,y.jsx)(aq,{content:null!==(t=n.description)&&void 0!==t?t:n.story,type:"link",name:"product section",maxCharLength:400})}),!(void 0!==l&&l)&&(0,y.jsx)("div",{className:s7.infos,children:(0,y.jsxs)(tY,{children:[!(void 0!==s&&s)&&null!=j&&j.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s9,{organizations:r}),(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:s7.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-producer-profile-modal-certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(nv,{certifications:j,certificationsSorted:_})},"certifications")]}):null,(null==m?void 0:m.length)>0&&(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:s7.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-producer-profile-modal-value-title",defaultMessage:"Values"})}),forceRender:!0,children:(0,y.jsx)("div",{className:s7.values,children:(0,y.jsx)(ic,{values:m,valuesSorted:p})})},"values")]})})]})}),Array.isArray(b)&&b.length?(0,y.jsx)("section",{className:s7.socialSection,children:(0,y.jsxs)("div",{className:s7.socialLinkContainer,children:[(0,y.jsx)("div",{className:s7.socialSectionTitle,children:(0,y.jsx)(v.FormattedMessage,{id:"component-producer-profile-modal-connect",defaultMessage:"connect"})}),(0,y.jsx)(rk,{fromComponentClass:"producerProfileModalContent",social:b})]})}):null]})},co={ingredient:"ingredient_ingredient__hrceu",verboseIngredientReadMore:"ingredient_verboseIngredientReadMore__hrceu",displayName:"ingredient_displayName__hrceu",arrowIcon:"ingredient_arrowIcon__hrceu"},ci=function(e){var t=e.ingredientDescription,n=e.verboseIngredientReadMore,r=null==t?void 0:t.name;return null!=t&&t.hyphenatedName||console.warn("No ingredientDescription or hyphenatedName for: ",r),(0,y.jsx)(ea,{styles:co,owner:"Ingredient",children:(0,y.jsx)("div",{className:co.ingredient,onClick:function(){var e;return e=t.hyphenatedName,void eU("Opened ".concat(e," ingredient popup"),{category:"Engagement",label:"Product profile"})},children:null!=t&&t.hyphenatedName?(0,y.jsx)(F,{path:"/ingredient/".concat(t.hyphenatedName),onTop:!0,children:(0,y.jsxs)("a",{children:[(0,y.jsx)(ea,{styles:co,owner:"ingredient",children:(0,y.jsx)("span",{className:co.displayName,children:r})}),"\xa0",n?(0,y.jsx)(ea,{styles:co,owner:"ingredient",children:(0,y.jsx)("span",{className:co.verboseIngredientReadMore,children:(0,y.jsx)(v.FormattedMessage,{id:"component-verbose-ingredient-read_more",defaultMessage:"Read More"})})}):null,(0,y.jsx)(ea,{styles:co,owner:"ingredient",children:(0,y.jsx)("i",{className:co.arrowIcon})})]})}):r})})};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})(e)}function cl(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 cs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cl(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ca(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let cc=function(e){var t=e.ingredients,n=e.verboseIngredientReadMore;return t.map(function(e,t){return(0,c.createElement)(ci,cs(cs({},e),{},{verboseIngredientReadMore:n,key:t}))})},cu={recipe:"recipe_recipe__t3vys",recipeImage:"recipe_recipeImage__t3vys",recipeMetaTitle:"recipe_recipeMetaTitle__t3vys",timeToPrepare:"recipe_timeToPrepare__t3vys",historyIcon:"recipe_historyIcon__t3vys",withoutLink:"recipe_withoutLink__t3vys"};function cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let cf=e4(function(e){var t,n=e.id,r=e.title,o=e.hyphenatedName,i=e.timeToPrepare,a=e.media,l=e.windowWidth,s=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)("/images/image-placeholder--grey.svg"))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return cd(e,2);var n=({}).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)?cd(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=s[0],d=s[1];(0,c.useEffect)(function(){Array.isArray(a)&&a.length&&(a[0].mediaType===m.mediaTypes.video?nT(a[0].url,l).then(function(e){d(e.thumbnail)}).catch(console.error):d(a[0].url))},[]);var f=(0,c.useMemo)(function(){return(0,y.jsx)(j.List.Item.Meta,{avatar:(0,y.jsx)(j.Avatar,{className:cu.recipeImage,shape:"square",src:u}),title:(0,y.jsx)(ea,{styles:cu,owner:"Recipe",children:(0,y.jsx)("a",{className:cu.recipeMetaTitle,children:r})}),description:(0,y.jsx)(ea,{styles:cu,owner:"Recipe",children:(0,y.jsxs)("a",{className:cu.timeToPrepare,children:[(0,y.jsx)("i",{className:cu.historyIcon}),b().duration(i,"minutes").humanize({h:24,m:90})]})})})},[n,u,r]);return(0,y.jsx)(j.List.Item,{className:cu.recipe,onClick:function(){eU("Opened ".concat(o," recipe popup"),{category:"Engagement",label:"Product profile"})},children:o?(0,y.jsx)(F,{path:"/recipe/".concat(o),onTop:!0,children:f}):(0,y.jsx)("div",{className:cu.withoutLink,children:f})},n)});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})(e)}function cp(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cy(e,t);var n=({}).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)?cy(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ch(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}var cv={name:"recipes",label:"Product Profile"},cg=function(e){return(0,y.jsx)(cf,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ch(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==cm(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ch(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e))};let cb=function(e){var t=e.recipes,n=cp((0,c.useState)(!1),2),r=n[0],o=n[1],i=cp((0,c.useState)([]),2),a=i[0],l=i[1],s=cp((0,c.useState)(0),2),u=s[0],d=s[1];(0,c.useEffect)(function(){(d(t.length-3),!r&&t.length>3)?l(Object.assign([],t).slice(0,3)):l(t)},[t,r]);var f=u&&!r?(0,y.jsx)(ny,{subject:cv,showAll:r,numberOfHiddenElements:u,onClick:function(){o(!0)}}):null;return(0,y.jsx)(j.List,{itemLayout:"horizontal",dataSource:a,renderItem:cg,loadMore:f})};function cj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let c_=e4(function(e){var t,n=e.id,r=e.title,o=e.hyphenatedName,i=e.shortDescription,a=e.media,l=e.windowWidth,s=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)("/images/image-placeholder--grey.svg"))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return cj(e,2);var n=({}).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)?cj(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=s[0],d=s[1];(0,c.useEffect)(function(){Array.isArray(a)&&a.length&&(a[0].mediaType===m.mediaTypes.video?nT(a[0].url,l).then(function(e){d(e.thumbnail)}).catch(console.error):d(a[0].url))},[]);var f=(0,c.useMemo)(function(){return(0,y.jsxs)("a",{children:[(0,y.jsx)(j.Avatar,{className:"customCertification_customCertificationImage__bqx9z",shape:"circle",src:u}),(0,y.jsx)("span",{className:"customCertification_title__bqx9z",children:r}),(0,y.jsx)("span",{className:"customCertification_customCertificationShortDescription__bqx9z",children:i}),(0,y.jsx)(rC.ArrowRightOutlined,{})]})},[r,i,u]);return(0,y.jsx)(j.List.Item,{className:"customCertification_customCertification__bqx9z",onClick:function(){eU("Opened ".concat(o," custom certification popup"),{category:"Engagement",label:"Product profile"})},children:o?(0,y.jsx)(F,{path:"/customCertification/".concat(o),onTop:!0,children:f}):(0,y.jsx)("div",{className:"customCertification_withoutLink__bqx9z",children:f})},n)});function cw(e){return(cw="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)}function cx(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cS(e,t);var n=({}).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)?cS(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cO(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}var ck=function(e){return(0,y.jsx)(c_,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cO(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=cw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=cw(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==cw(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e))},cC=function(){return(0,y.jsx)(v.FormattedMessage,{id:"component-custom-certifications-showAllLink",defaultMessage:"Read More"})};let cM=function(e){var t=e.customCertifications,n=cx((0,c.useState)([]),2),r=n[0],o=n[1],i=cx((0,c.useState)(!1),2),a=i[0],l=i[1],s=cx((0,c.useState)(0),2),u=s[0],d=s[1];return(0,c.useEffect)(function(){(d(t.length-5),!a&&t.length>5)?o(Object.assign([],t).slice(0,5)):o(t)},[t,a]),(0,y.jsx)("div",{className:"customCertifications_customCertificationsWrapper__d8px6",children:(0,y.jsx)(j.List,{itemLayout:"horizontal",dataSource:r,renderItem:ck,loadMore:!a&&u>0&&(0,y.jsx)(ny,{showAll:a,numberOfHiddenElements:u,onClick:function(){l(!0)},showAllLink:(0,y.jsx)(cC,{})})})})},cP={productSection:"productSection_productSection__kz7mg",containerWrapper:"productSection_containerWrapper__kz7mg",content:"productSection_content__kz7mg",productOrganization:"productSection_productOrganization__kz7mg",orgBannerImage:"productSection_orgBannerImage__kz7mg",orgBody:"productSection_orgBody__kz7mg",orgName:"productSection_orgName__kz7mg",lineContainer:"productSection_lineContainer__kz7mg",iconmapMarker:"productSection_iconmapMarker__kz7mg",learnMoreText:"productSection_learnMoreText__kz7mg",mediaCarouselWrapper:"productSection_mediaCarouselWrapper__kz7mg",productInfoWrapper:"productSection_productInfoWrapper__kz7mg",headlineWrapper:"productSection_headlineWrapper__kz7mg",headline:"productSection_headline__kz7mg",subheading:"productSection_subheading__kz7mg",subheadingLogos:"productSection_subheadingLogos__kz7mg",productValues:"productSection_productValues__kz7mg",productAccordion:"productSection_productAccordion__kz7mg",productDescription:"productSection_productDescription__kz7mg",productDescriptionDesktop:"productSection_productDescriptionDesktop__kz7mg",productDescriptionMobile:"productSection_productDescriptionMobile__kz7mg",notFilled:"productSection_notFilled__kz7mg",panelHeader:"productSection_panelHeader__kz7mg",producerModal:"productSection_producerModal__kz7mg",closeIcon:"productSection_closeIcon__kz7mg",closeIconContainer:"productSection_closeIconContainer__kz7mg"},cI={mapboxMap:"facilityMap_mapboxMap__ra6rz",productSection:"facilityMap_productSection__ra6rz"},cN=function(e){var t,n,r=e.facility,o=(e.mapStyles,e.mapOptions),i=void 0===o?null:o,a=e.zoom,l=void 0===a?5:a,s=e.customClass,u=void 0===s?null:s,d=(0,c.useRef)(null),f=(0,c.useRef)(null),m=(0,c.useContext)(er),p=null!=r&&null!==(t=r.location)&&void 0!==t&&t.coordinates.length?null==r||null===(n=r.location)||void 0===n?void 0:n.coordinates[0]:null,h=(0,c.useMemo)(function(){var e=Object.assign({},lP.defaultMapOptions),t=et(m);return t&&Object.keys(t).forEach(function(n){e[n]=t[n]}),i&&Object.keys(i).forEach(function(t){e[t]=i[t]}),e},[m,i]);return(0,c.useEffect)(function(){if(!d.current){if(a8().accessToken="pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A",a8().supported()){d.current=new(a8()).Map({container:f.current,style:h.mapboxStyleUrl,zoom:l,center:p,cooperativeGestures:!0});var e=new(a8()).NavigationControl({showCompass:!1});d.current.addControl(e,"bottom-right");var t=document.createElement("div");t.className="marker",t.style.backgroundImage="url(".concat(h.mapMarkerSelectedPath,")"),t.style.width="33px",t.style.height="45px",t.style.backgroundSize="contain",t.style.backgroundRepeat="no-repeat",t.style.className="marker",new(a8()).Marker(t).setLngLat(p).addTo(d.current)}else console.warn("WebGL is not supported. Interactive map not loaded.")}},[]),(0,y.jsx)("div",{className:u?cI[u]:null,children:(0,y.jsx)("div",{ref:f,className:cI.mapboxMap})})},cT={subheadingPoweredBy:"poweredByStoryBird_subheadingPoweredBy__5wuaj",storyBirdIcon:"poweredByStoryBird_storyBirdIcon__5wuaj"},cL=function(){return(0,y.jsx)(ea,{styles:cT,children:(0,y.jsxs)("div",{className:cT.subheadingPoweredBy,children:[(0,y.jsx)("i",{className:cT.storyBirdIcon}),(0,y.jsx)("span",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection-poweredBy",defaultMessage:"powered by StoryBird"})})]})})},cE={subheadingPartnerLogo:"partnerLogo_subheadingPartnerLogo__q6w7z",partnerLogoLink:"partnerLogo_partnerLogoLink__q6w7z",partnerLogoTitle:"partnerLogo_partnerLogoTitle__q6w7z",partnerLogoImg:"partnerLogo_partnerLogoImg__q6w7z"};var cz=function(e){var t=e.className,n=e.children;return(0,y.jsx)("div",{className:t,children:n})};let cA=function(e){var t,n=e.partnerLogo,r=(0,c.useMemo)(function(){return function(e){var t;try{t=new URL(e)}catch(e){console.warn("Invalid partner logo")}return t}(null==n?void 0:n.targetUrl)},[null==n?void 0:n.targetUrl]),o=(0,c.useMemo)(function(){return r?eZ:cz},[r]);return(0,y.jsx)(ea,{styles:cE,children:(0,y.jsx)("div",{className:cE.subheadingPartnerLogo,children:(0,y.jsxs)(o,{href:r,className:cE.partnerLogoLink,children:[(null==n?void 0:n.title)&&(0,y.jsx)("span",{className:cE.partnerLogoTitle,children:n.title}),(null==n||null===(t=n.media)||void 0===t?void 0:t.url)&&(0,y.jsx)("div",{className:cE.partnerLogoImg,children:(0,y.jsx)(f(),{src:n.media.url,width:160,height:35,alt:"Partner Logo",style:{objectFit:"contain"}})})]})})})};function cF(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cD(e,t);var n=({}).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)?cD(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cB=[],cW=cG();function cR(e,t){var n;return function(){clearTimeout(n),n=setTimeout(function(){n=null,e()},t)}}var cU=cR(function(){cW=cG(),cB.forEach(function(e){e(cW)})},100),cH=function(e){cB.push(e),1===cB.length&&window.addEventListener("resize",cU,{passive:!0})},cq=function(e){0===(cB=cB.filter(function(t){return t!==e})).length&&window.removeEventListener("resize",cU)};function cG(){return"undefined"==typeof window?{width:void 0,height:void 0}:{width:window.innerWidth&&document.documentElement.clientWidth?Math.min(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,height:window.innerHeight&&document.documentElement.clientHeight?Math.min(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight}}function cV(e){var t=e.children,n=e.condition,r=e.elseChildren,o=cF((0,c.useState)(cG()),2),i=o[0],a=o[1];return(0,c.useEffect)(function(){return cH(a),function(){return cq(a)}},[]),(void 0===n?function(){return console.warn("No condition specified."),!0}:n)(i)?t:void 0===r?null:r}var cZ={xs:480,sm:576,md:768,ad:810,lg:992,xl:1200,xxl:1600,unlimited:Number.MAX_SAFE_INTEGER},cY=["xs","sm","md","ad","lg","xl","xxl","unlimited"],cJ=function(e){return function(t){var n=t.width;return n>=cZ[e]&&n<cZ[cY[cY.indexOf(e)+1]]}},c$=function(e){return function(t){return t.width>=cZ[e]}},cQ=function(e){return function(t){return t.width<cZ[cY[cY.indexOf(e)+1]]}};function cK(e){var t=e.size,n=e.children;return(0,y.jsx)(cV,{condition:cJ(t),children:n})}function cX(e){var t=e.size,n=e.children;return(0,y.jsx)(cV,{condition:c$(t),children:n})}function c0(e){var t=e.size,n=e.children;return(0,y.jsx)(cV,{condition:cQ(t),children:n})}function c1(e){return cV({children:!0,elseChildren:!1,condition:e.condition})}function c2(e){return c1({condition:cJ(e)})}function c5(e){return c1({condition:c$(e)})}function c8(e){return c1({condition:cQ(e)})}function c4(){var e=cF((0,c.useState)(cY[0]),2),t=e[0],n=e[1];return(0,c.useEffect)(function(){var e=function(e){var t=e.width;n(cY.find(function(e,n){return cY.length-1!=n&&cJ(e)({width:t})}))};return e(cG()),cH(e),function(){return cq(e)}},[]),t}function c3(e){return(c3="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)}var c6=["id"];function c9(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 c7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c9(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=c3(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=c3(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==c3(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ue(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ut(e,t);var n=({}).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)?ut(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var un=function e(t){void 0===e.lastOpenPanels&&(e.lastOpenPanels=[]),Array.isArray(t)&&0!==t.length&&(t.includes("1")&&!e.lastOpenPanels.includes("1")&&eU("Clicked open certifications",{category:"Engagement",label:"Product profile"}),e.lastOpenPanels=t)};let ur=function(e){var t,n,r,o,i=e.product,a=e.events,l=e.ingredientDescriptions,s=e.facilities,u=e.organizations,d=e.organization,f=e.nutritionFacts,m=e.recipes,p=void 0===m?[]:m,h=e.isBasic,g=void 0!==h&&h,b=e.hideMedia,_=void 0!==b&&b,w=e.hideInfos,x=void 0!==w&&w,S=e.hideCertifications,O=void 0!==S&&S,k=e.hideIngredients,C=void 0!==k&&k,M=e.hideRecipes,P=void 0!==M&&M,I=e.hideCustomCertifications,N=void 0!==I&&I,T=e.hidePartnerLogo,L=e.hidePoweredBy,E=e.hideMainOrganizationDetail,z=void 0!==E&&E,A=e.verboseIngredientReadMore,D=(e.embedded,e.customCertifications),B=void 0===D?[]:D,W=e.customCertificationsSectionTitle,R=e.storyClaims,U=e.claimsSectionTitle,H=e.partnerLogo,q=ue((0,c.useState)(!1),2),G=q[0],V=q[1],Z=ue((0,c.useState)(400),2),Y=Z[0],J=Z[1],$=ue((0,c.useState)(null),2),Q=$[0],K=$[1],X=ue((0,c.useState)(!1),2),ee=X[0],et=X[1],en=(0,c.useRef)(null),er=(0,c.useRef)(null),eo=(0,c.useMemo)(function(){var e;return null!=i&&null!==(e=i.events)&&void 0!==e&&e.length&&a?a[i.events[i.events.length-1]]:null},[i,a]),ei=(0,c.useMemo)(function(){return null!=eo&&eo.facility?s[eo.facility]:null},[eo,s]),el=(0,c.useMemo)(function(){return null!=d?d:null!=ei&&ei.organization?u[null==ei?void 0:ei.organization]:null},[ei,d,u]),es=(0,c.useMemo)(function(){return ie({facilities:s,organization:el})},[s,el]),ec=null==es||null===(t=es.location)||void 0===t||null===(t=t.coordinates)||void 0===t||!t.length||!es.location.countryCode,eu=(0,c.useMemo)(function(){var e,t;return null!=i&&null!==(e=i.certifications)&&void 0!==e&&e.length?i.certifications:null!=el&&null!==(t=el.certifications)&&void 0!==t&&t.length?(console.warn("productSection: falling back to productOrganization certifications"),el.certifications):(console.warn("productSection: no certifications defined for product or productOrganization"),[])},[el,i]),ed=(0,c.useMemo)(function(){var e,t;return null!=i&&null!==(e=i.certificationsSorted)&&void 0!==e&&e.length?i.certificationsSorted:null!=el&&null!==(t=el.certificationsSorted)&&void 0!==t&&t.length?(console.warn("productSection: falling back to productOrganization certificationsSorted"),el.certificationsSorted):(console.warn("productSection: no certificationsSorted defined for product or productOrganization"),[])},[el,i]),ef=(0,c.useMemo)(function(){var e;return null!==(e=null==el?void 0:el.values)&&void 0!==e?e:[]},[el]),em=(0,c.useMemo)(function(){var e;return null!==(e=null==el?void 0:el.valuesSorted)&&void 0!==e?e:[]},[el]),ep=(0,c.useMemo)(function(){return null!=i&&i.ingredients?i.ingredients.map(function(e){var t=e.id;return c7(c7({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,c6)),{},{ingredientDescription:l[t]})}):[]},[i,l]),ey=(0,c.useMemo)(function(){var e;return null!==(e=(null==H?void 0:H.media)||(null==H?void 0:H.title))&&void 0!==e?e:null},[H]),eh=(0,c.useMemo)(function(){var e=[];return e.push("storyClaims"),N||e.push("customCertifications"),O||e.push("certifications"),O&&!C&&e.push("ingredients"),O&&C&&!P&&e.push("recipes"),O&&C&&P&&!N&&e.push("customCertifications"),e},[O,C,P,N]),ev=(0,c.useMemo)(function(){return rR({storyClaims:R}).length>0},[R]),eg=(0,c.useMemo)(function(){return!(!Array.isArray(ef)||!ef.length)},[ef]),eb=(0,c.useMemo)(function(){return!O&&!(!Array.isArray(eu)||!eu.length)},[eu,O]),ej=(0,c.useMemo)(function(){return!N&&!(!Array.isArray(B)||!B.length)},[N,B]),e_=(0,c.useMemo)(function(){return!C&&!(!Array.isArray(ep)||!ep.length)},[C,ep]),ew=(0,c.useMemo)(function(){return!P&&!(!Array.isArray(p)||!p.length)},[P,p]),ex=(0,c.useMemo)(function(){return!!(eb||e_||ew||ev||ej)},[eb,e_,ew,ej,ev]),eS=(0,c.useMemo)(function(){return!z&&!(!Array.isArray(null==el?void 0:el.media)||!el.media.length)},[z,el]),eO=(0,c.useMemo)(function(){var e="string"==typeof(null==W?void 0:W.title)&&W.title.trim().length;return(0,y.jsx)("h3",{className:cP.panelHeader,children:e?W.title:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--custom-certifications-title",defaultMessage:"Custom Certifications"})})},[W]),ek=(0,c.useMemo)(function(){var e="string"==typeof(null==U?void 0:U.title)&&U.title.trim().length;return(0,y.jsx)("h3",{className:cP.panelHeader,children:e?U.title:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--claim-section-title",defaultMessage:"MRV+ Claims"})})},[U]),eC=(0,c.useMemo)(function(){var e;return!!g&&!(!Array.isArray(null==es||null===(e=es.location)||void 0===e?void 0:e.coordinates)||!es.location.coordinates.length)},[g,es]);return(0,c.useEffect)(function(){if(!ee){if(!1!==Q){if(null!==(null==en?void 0:en.current)&&null!==(null==er?void 0:er.current)){var e=en.current,t=er.current,n=cR(function(){var n,r,o=null!==(n=null==e?void 0:e.clientHeight)&&void 0!==n?n:null,a=null!==(r=null==t?void 0:t.clientHeight)&&void 0!==r?r:null;if(null!==o&&null!==a){var l=a-o;if(l>60)J(Y+parseInt(l));else{var s,c,u=function(e,t){for(var n,r,o=r3(e),i=0,a=0;a<o.length;a++){var l=o[a],s=l.split(/ /);if(!(i+l.length<=t)){for(var c=0;c<s.length;c++){var u=s[c];if(i+u.length>=t){n=s[c-1],r=u;break}i+=u.length+1}break}n=s.at(-1),i+=l.length}return{lastWord:n,nextWord:r}}(null==i?void 0:i.description,Y),d=u.lastWord,f=u.nextWord;o>a&&(J(Y-(null!==(s=null==d?void 0:d.length)&&void 0!==s?s:0)),et(!0)),o<=a&&J(Y+(null!==(c=null==f?void 0:f.length)&&void 0!==c?c:0))}}},100);return e.addEventListener("resize",n),t.addEventListener("resize",n),n(),function(){e.removeEventListener("resize",n),t.removeEventListener("resize",n)}}}else et(!0)}},[Y,Q,ee,null==i?void 0:i.description,null==en||null===(n=en.current)||void 0===n?void 0:n.clientHeight,null==er||null===(r=er.current)||void 0===r?void 0:r.clientHeight]),(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("section",{className:cP.productSection,children:(0,y.jsx)("div",{className:"containerWrapper "+cP.containerWrapper,children:(0,y.jsx)("div",{className:"container "+cP.container,children:(0,y.jsxs)(ea,{styles:cP,owner:"ProductSection",children:[(0,y.jsxs)("div",{className:cP.content,children:[_?(0,y.jsx)("div",{className:"logoPadding"}):(0,y.jsxs)("div",{className:cP.mediaCarouselWrapper,ref:en,children:[(0,y.jsx)(n9,{mediaCarouselClass:"fromProductSection",dotsTypeStyle__mobile:"rounded",media:null!=i&&null!==(o=i.media)&&void 0!==o&&o.length?i.media:[{url:"/images/image-placeholder--grey.svg",mediaType:"image"}],videoAsOverlay:!1,clickOpensFullscreenCarousel:!0,slug:"product"}),(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("div",{className:"".concat(cP.productDescription," ").concat(cP.productDescriptionDesktop," ").concat(ee?"":cP.notFilled),children:(0,y.jsx)(aq,{content:null==i?void 0:i.description,type:"link",name:"product section",maxCharLength:Y,handleShortenedContent:K})})})]}),(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsxs)("div",{className:cP.productInfoWrapper,ref:er,children:[(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsxs)("div",{className:cP.headlineWrapper,children:[(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("h1",{className:cP.headline,children:null==i?void 0:i.name})}),(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsxs)("div",{className:cP.subheading,children:[(0,y.jsx)(v.FormattedMessage,{id:"component-productSection-by",defaultMessage:"by"})," ",null!=el&&el.hyphenatedName?(0,y.jsx)(F,{path:"/organization/".concat(null==el?void 0:el.hyphenatedName),children:(0,y.jsx)("a",{children:null==el?void 0:el.name})}):(0,y.jsx)("a",{children:null==el?void 0:el.name})]})}),(0,y.jsxs)("div",{className:cP.subheadingLogos,children:[void 0!==L&&L?null:(0,y.jsx)(cL,{}),void 0!==T&&T||!ey?null:(0,y.jsx)(cA,{partnerLogo:H})]})]})}),x?null:(0,y.jsxs)(y.Fragment,{children:[eg&&(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("div",{className:cP.productValues,children:(0,y.jsx)(ic,{valuesClass:"fromProductSection",values:null==el?void 0:el.values,valuesSorted:em})})}),(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("div",{className:"".concat(cP.productDescription," ").concat(cP.productDescriptionMobile),children:(0,y.jsx)(aq,{content:null==i?void 0:i.description,type:"link"})})}),(0,y.jsx)(s9,{organizations:u}),eS&&(0,y.jsxs)("div",{className:cP.productOrganization,children:[(0,y.jsx)("div",{style:{backgroundImage:"url(".concat(el.media[0].url,")")},className:cP.orgBannerImage}),(0,y.jsxs)("div",{className:cP.orgBody,children:[(0,y.jsx)("div",{className:cP.lineContainer,children:(0,y.jsx)("h1",{className:cP.orgName,children:el.name})}),ec?null:(0,y.jsxs)("div",{className:cP.lineContainer,children:[(0,y.jsx)("span",{className:cP.iconmapMarker}),(0,y.jsx)(rm,c7(c7({hideIcon:!0},es.location),{},{hideFacilityName:!0,customClass:"orgSectionPlace"}))]}),(0,y.jsx)("a",{onClick:function(){return V(!0)},className:cP.learnMoreText,children:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection-learn-more",defaultMessage:"learn more\xbb"})})]}),(0,y.jsxs)(j.Modal,{className:cP.producerModal,open:G,centered:!0,footer:null,closable:!1,onCancel:function(){return V(!1)},width:"100%",bodyStyle:{padding:0,maxHeight:"100vh"},zIndex:1012,children:[(0,y.jsx)("div",{className:cP.closeIconContainer,onClick:function(){return V(!1)},children:(0,y.jsx)(ea,{styles:cP,owner:"NavModal",children:(0,y.jsx)("i",{className:cP.closeIcon})})}),(0,y.jsx)("div",{className:cP.producerModalContainer,children:(0,y.jsx)(cr,{organization:el,organizations:u,mainFacility:es,hideLocationText:ec,hideMedia:_,hideInfos:x,hideCertifications:O})})]})]}),ex&&(0,y.jsx)(ea,{styles:cP,owner:"ProductSection",children:(0,y.jsx)("div",{className:cP.productAccordion,children:(0,y.jsxs)(tY,{onChange:un,defaultOpenPanels:eh,children:[ej&&(0,y.jsx)(tV,{header:eO,children:(0,y.jsx)(cM,{customCertifications:B})},"customCertifications"),ev&&(0,y.jsx)(tV,{header:ek,children:(0,y.jsx)(rX,{storyClaims:R,featured:!0})},"storyClaims"),eb&&(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:cP.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(nv,{certifications:eu,certificationsSorted:ed})},"certifications"),e_&&(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:cP.panelHeader,children:f?(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--ingredients-and-nutritionfacts-title",defaultMessage:"Ingredients & Nutrition"}):(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--ingredients-title",defaultMessage:"Ingredients"})}),children:(0,y.jsx)(cc,{verboseIngredientReadMore:void 0===A||A,ingredients:ep})},"ingredients"),ew&&(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:cP.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-productSection--recipes-title",defaultMessage:"Recipes"})}),children:(0,y.jsx)(cb,{recipes:p})},"recipes")]})})})]})]})})]}),eC&&(0,y.jsx)("div",{className:cP.facilityMap,children:(0,y.jsx)(cN,{facility:es,customClass:"productSection"})})]})})})})})};function uo(e){return(uo="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)}function ui(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 ua(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ui(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=uo(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uo(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==uo(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ui(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ul(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return us(e,void 0);var n=({}).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)?us(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function us(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uc(e){var t,n=e.pageResponsiveness,r=e.windowWidth,o=e.windowHeight,i=e.portrait,a=(e.pageCols,e.pageRows,e.items),l=e.onSelect,s=e.onUnselect,u=e.selected,d=e.getCardStyles,f=void 0===d?function(){return{}}:d,m=e.currentPage,p=[[]],h=(0,c.useMemo)(function(){return eQ.fromDesktop({width:r})?"desktop":eQ.fromTabletWithoutMobileLandscape({width:r,height:o,portrait:i})?"tablet":"mobile"},[r,o,i]),v=(0,c.useMemo)(function(){return n[h].pageCols*n[h].pageRows},[h,n]),g=(0,c.useMemo)(function(){return a.length<=n[h].pageCols?1:n[h].pageRows},[h,n,a]),b=(0,c.useMemo)(function(){return[m-1,m,m+1]},[m]),j=function(){var e,t="key_".concat(p.length),r=ul(p[p.length-1]);try{for(r.s();!(e=r.n()).done;){var o=e.value;t+="_card_".concat(o.key)}}catch(e){r.e(e)}finally{r.f()}p[p.length-1]={key:t,pageWrapper:function(e){return(0,y.jsx)("div",{style:{gridTemplate:"repeat(".concat(g,", 1fr) / repeat(").concat(n[h].pageCols,", 1fr)")},className:"carouselSlides_slideRowContainer__xqa9h",children:e},t)},items:p[p.length-1]}},_=ul(a);try{for(_.s();!(t=_.n()).done;)(function(){var e=t.value,n=p[p.length-1];n.length>=v&&(j(),p.push([]),n=p[p.length-1]),n.push({key:e.id,itemWrapper:function(t){return(0,y.jsx)("div",{style:f({media:h,windowWidth:r}),children:t},e.id)},itemParams:ua(ua({},e),{},{key:e.id,onSelect:l,onUnselect:s,selected:u})})})()}catch(e){_.e(e)}finally{_.f()}j();var w="number"==typeof m;return p.map(function(e,t){return{key:e.key,slideWrapper:function(n){return(0,y.jsx)("div",{className:"carouselSlides_slide__xqa9h",children:(0,y.jsx)("div",{className:"carouselSlides_slideInner__xqa9h",children:w&&b.includes(t)||!w?e.pageWrapper(n):(0,y.jsx)("p",{children:"\xa0"})})},t)},items:e.items}})}function uu(e){var t=e.pageResponsiveness,n=e.media,r=e.windowWidth,o=e.containerMaxWidth,i=t[n].pageCols,a=null!=o?o:1260<r?1260:r;return i>1&&(a-="16"*(i-1)),{maxWidth:a/i}}function ud(e,t){if(e){if("string"==typeof e)return uf(e,t);var n=({}).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)?uf(e,t):void 0}}function uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let um=function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)({width:500,height:500}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||ud(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=(0,c.useMemo)(function(){return new ResizeObserver(function(t){if(null!=e&&e.current&&window&&Array.isArray(t)){var n,r=0===window.getComputedStyle(e.current).getPropertyValue("writing-mode").indexOf("horizontal"),i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ud(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;a.contentBoxSize&&(a.contentBoxSize[0]?o({width:r?a.contentBoxSize[0].inlineSize:a.contentBoxSize[0].blockSize,height:r?a.contentBoxSize[0].blockSize:a.contentBoxSize[0].inlineSize}):o({width:r?a.contentBoxSize.inlineSize:a.contentBoxSize.blockSize,height:r?a.contentBoxSize.blockSize:a.contentBoxSize.inlineSize}))}}catch(e){i.e(e)}finally{i.f()}}})},[window,null==e?void 0:e.current]);return(0,c.useEffect)(function(){if(null!=e&&e.current&&window){var t=e.current;return i.observe(e.current),function(){return i.unobserve(t)}}},[e,null==e?void 0:e.current,window,i]),r},up={desktopCarousel:"cardCarousel_desktopCarousel__mu57k",controls:"cardCarousel_controls__mu57k",singleControl:"cardCarousel_singleControl__mu57k",heading:"cardCarousel_heading__mu57k",counter:"cardCarousel_counter__mu57k",organizationAffiliates:"cardCarousel_organizationAffiliates__mu57k",filterContainer:"cardCarousel_filterContainer__mu57k",sortIcon:"cardCarousel_sortIcon__mu57k",customSuffixIcon:"cardCarousel_customSuffixIcon__mu57k",selectDropdown:"cardCarousel_selectDropdown__mu57k",actions:"cardCarousel_actions__mu57k",disabled:"cardCarousel_disabled__mu57k",paginationPage:"cardCarousel_paginationPage__mu57k",paginationIcon:"cardCarousel_paginationIcon__mu57k",iconPageNext:"cardCarousel_iconPageNext__mu57k",iconPagePrev:"cardCarousel_iconPagePrev__mu57k",currentPage:"cardCarousel_currentPage__mu57k",searchInputContainer:"cardCarousel_searchInputContainer__mu57k",noResutls:"cardCarousel_noResutls__mu57k"};function uy(e){return(uy="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)}function uh(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 uv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uh(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=uy(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uy(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==uy(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ug(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ub(e,t);var n=({}).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)?ub(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ub(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let uj=e4(function(e){var t,n=e.parentContainer,r=e.customSearchPlaceholder,o=e.items,i=e.heading,a=e.customHeadingStyle,l=e.itemComponent,s=e.pageRows,u=e.pageCols,d=e.pageResponsiveness,f=e.ssrSize,m=e.windowWidth,p=e.windowHeight,h=e.landscape,g=e.portrait,b=e.withFilter,_=void 0!==b&&b,w=e.withSortOrder,x=void 0===w||w,S=e.initialSortOrder,O=void 0===S?"most-recent":S,k=e.sortItems,C=void 0===k?function(e){return e.a,e.b,e.sortOrder,0}:k,M=e.filterItems,P=void 0===M?function(e){return e.item,e.filter,!0}:M,I=e.onSelect,N=e.onUnselect,T=e.selected,L=e.setDisplayItems,E=void 0===L?function(){}:L,z=e.showSizeChanger,A=(0,v.useIntl)(),F=um(n).width,D=(0,c.useRef)(null),B=ug((0,c.useState)(0),2),W=B[0],R=B[1],U=ug((0,c.useState)(""),2),H=U[0],q=U[1],G=ug((0,c.useState)(O),2),V=G[0],Z=G[1],Y=ug((0,c.useState)(""),2),J=Y[0],$=Y[1],Q=(0,c.useMemo)(function(){if(!Array.isArray(o))return[];var e=o;x&&V&&(e=o.sort(function(e,t){return C({a:e,b:t,sortOrder:V})}));var t=e;return _&&(t=e.filter(function(e){return P({item:e,filter:H})})),t},[o,_,x,H,V,P,C]),K=(0,c.useMemo)(function(){return _||x},[_,x]),X=uc({getCardStyles:(0,c.useCallback)(function(e){return uu({pageResponsiveness:d,media:e.media,windowWidth:e.windowWidth,containerMaxWidth:null!=n&&n.current?F:void 0})},[d,null==n?void 0:n.current,F]),pageCols:void 0===u?4:u,pageRows:void 0===s?1:s,pageResponsiveness:d,ssrSize:f,windowWidth:m,windowHeight:p,landscape:h,portrait:g,items:Q,onSelect:I,onUnselect:N,selected:T,currentPage:W}),ee=(0,c.useCallback)(function(e){$(e.target.value),q(e.target.value)},[]);(0,c.useEffect)(function(){if(null!=D&&D.current&&T)for(var e=0;e<X.length;e++){var t=X[e],n=null==t?void 0:t.key;if("string"==typeof n&&-1!==n.indexOf(T)){R(e);break}}},[D,T,X]),(0,c.useEffect)(function(){null!=D&&D.current&&D.current.goTo(W)},[D,W]),(0,c.useEffect)(function(){R(0),E(Q)},[Q]);var et=(0,c.useCallback)(function(e,t,n){return"prev"===t?(0,y.jsx)("i",{className:"".concat(up.paginationIcon," ").concat(up.iconPagePrev," ").concat(0===W?up.disabled:"")}):"next"===t?(0,y.jsx)("i",{className:"".concat(up.paginationIcon," ").concat(up.iconPageNext," ").concat(W>=Math.round(X.length)-1?up.disabled:"")}):(0,y.jsx)("span",{className:up.paginationPage,children:n})},[W,X]),en=(0,c.useCallback)(function(e){null!=D&&D.current&&W!==e-1&&("function"==typeof N&&N(T),R(e-1))},[D,W,N]),er=(0,c.useCallback)(function(e){R(e)},[W]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"".concat(up.controls," ").concat(_^x?up.singleControl:""),children:[(0,y.jsxs)("h2",{className:"".concat(up.heading," ").concat(null!==(t=up[a])&&void 0!==t?t:""),children:[i,(0,y.jsxs)("span",{className:up.counter,children:["(",Q.length,")"]})]}),K&&(0,y.jsxs)("div",{className:up.filterContainer,children:[_&&(0,y.jsx)("div",{className:up.searchInputContainer,children:(0,y.jsx)(j.Input,{className:up.input,placeholder:null!=r?r:A.formatMessage({id:"card-carousel-search-input-placeholder",defaultMessage:"search"}),value:J,onChange:ee})}),x&&(0,y.jsx)("div",{className:up.sortIcon,children:(0,y.jsxs)(j.Select,{placeholder:"sort",popupClassName:up.selectDropdown,onChange:Z,suffixIcon:(0,y.jsx)("div",{className:up.customSuffixIcon}),showArrow:!0,defaultValue:O,children:[(0,y.jsx)(j.Select.Option,{value:"name",children:(0,y.jsx)(v.FormattedMessage,{id:"story-list-sort-order-by-name",defaultMessage:"Sort by name"})}),(0,y.jsx)(j.Select.Option,{value:"most-recent",children:(0,y.jsx)(v.FormattedMessage,{id:"story-list-sort-order-by-most-recent",defaultMessage:"Sort by most recent"})})]})})]})]}),(0,y.jsxs)("div",{className:up.desktopCarousel,style:{minHeight:_?350:0},children:[(0,y.jsx)(j.Carousel,{dots:!1,ref:D,afterChange:er,children:X.map(function(e){return(0,e.slideWrapper)(e.items.map(function(e){var t=e.key,n=e.itemWrapper,r=e.itemParams;return n((0,c.createElement)(l,uv(uv({},r),{},{key:t})))}))})}),0===Q.length?(0,y.jsx)("div",{className:up.noResutls,children:(0,y.jsx)(v.FormattedMessage,{defaultMessage:"No results found",id:"component-card-carosuel-no-results-found"})}):null]}),X.length>1?(0,y.jsx)(j.Row,{className:up.actions,children:(0,y.jsx)(j.Pagination,{current:W+1,total:X.length,defaultPageSize:1,hideOnSinglePage:!0,responsive:!0,showSizeChanger:void 0===z||z,onChange:en,itemRender:et,size:F<=500?"small":"default"})}):null]})}),u_={organizationListItem:"organizationListItem_organizationListItem__d9xza",selected:"organizationListItem_selected__d9xza",image:"organizationListItem_image__d9xza",details:"organizationListItem_details__d9xza",title:"organizationListItem_title__d9xza",location:"organizationListItem_location__d9xza",locationIcon:"organizationListItem_locationIcon__d9xza"};function uw(e){return(uw="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)}let ux=function(e){var t,n=e.id,r=e.media,o=e.name,i=e.type,a=e.organizationType,l=e.yearEstablished,s=e.supplyChainRoles,c=e.story,u=e.ownedFacilities,d=(e.withSupHeadline,e.withStory),f=e.onSelect,m=e.onUnselect,p=e.selected,h=e.facilities,v=Array.isArray(r)&&r.length>0&&null!==(t=r[0])&&void 0!==t&&t.url?r[0].url:r&&"object"===uw(r)&&"string"==typeof r.url?r.url:"/images/image-placeholder--grey.svg",g=p===n;return(0,y.jsx)(ea,{styles:u_,owner:"OrganizationListItem",children:(0,y.jsxs)("div",{className:"".concat(u_.organizationListItem," ").concat(g?u_.selected:""),onClick:function(){eU("Opened ".concat(n," ingredient popup"),{category:"Engagement",label:"OrganizationListItem profile"}),g?"function"==typeof m&&m(n):"function"==typeof f&&f(n)},children:[(0,y.jsx)("div",{className:u_.image,style:{backgroundImage:"url(".concat(v,")")}}),(0,y.jsx)(ea,{styles:u_,owner:"OrganizationListItem",children:(0,y.jsx)("div",{className:u_.details,children:(0,y.jsx)(ii,{name:o,type:i,organizationType:a,yearEstablished:l,supplyChainRoles:s,story:void 0!==d&&d?c:null,ownedFacilities:u,withSupHeadline:!1,withFlag:!0,customClass:"orgListItem",disableFacilityLink:!0,facilities:h})})})]})})},uS={section:"organizationList_section__e7sd6",containerWrapper:"organizationList_containerWrapper__e7sd6",container:"organizationList_container__e7sd6",organizationListDesktopCarousel:"organizationList_organizationListDesktopCarousel__e7sd6",organizationListSlide:"organizationList_organizationListSlide__e7sd6",organizationListSlideInner:"organizationList_organizationListSlideInner__e7sd6",organizationListMobileRow:"organizationList_organizationListMobileRow__e7sd6",farmers:"organizationList_farmers__e7sd6",controls:"organizationList_controls__e7sd6",heading:"organizationList_heading__e7sd6",counter:"organizationList_counter__e7sd6",actions:"organizationList_actions__e7sd6",paginationIcon:"organizationList_paginationIcon__e7sd6",iconPageNext:"organizationList_iconPageNext__e7sd6",iconPagePrev:"organizationList_iconPagePrev__e7sd6",featuredOrganizationsList:"organizationList_featuredOrganizationsList__e7sd6"};function uO(e){return(uO="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)}function uk(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 uC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uk(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=uO(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uO(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==uO(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uM={desktop:{pageCols:2,pageRows:2},tablet:{pageCols:2,pageRows:2},mobile:{pageCols:1,pageRows:2}};function uP(e){var t,n,r,o,i,a,l=e.sortOrder,s=e.a,c=e.b,u="",d="";switch(l){case"name":return(u=null!==(t=s.name)&&void 0!==t?t:"")===(d=null!==(n=c.name)&&void 0!==n?n:"")?0:u>d?1:-1;case"most-recent":return(u=null!==(r=null!==(o=s.publishedAt)&&void 0!==o?o:s.updatedAt)&&void 0!==r?r:"")===(d=null!==(i=null!==(a=c.publishedAt)&&void 0!==a?a:c.updatedAt)&&void 0!==i?i:"")?0:u>d?-1:1;default:console.warn("[dev] unknown sort order",{sortOrder:l})}return 0}function uI(e){var t,n=e.item,r=e.filter,o=null!==(t=null==n?void 0:n.name)&&void 0!==t?t:"";return"string"!=typeof r||""===r||-1!==o.toLowerCase().indexOf(r.toLowerCase())}let uN=function(e){var t=e.organizationIdList,n=e.organizations,r=e.facilities,o=e.heading,i=e.pageCols,a=e.pageRows,l=e.withFilter,s=e.withSortOrder,u=e.customClass,d=void 0===u?null:u,f=e.onSelect,m=e.onUnselect,p=e.selected,h=(0,c.useRef)(),v=(0,c.useMemo)(function(){return t.map(function(e){var t=n[e],o=t.facilities.map(function(e){return r[e]});return uC(uC({},t),{},{ownedFacilities:o,facilities:r})})},[t,n,r]);return(0,y.jsx)(ea,{styles:uS,owner:"StoryList",children:(0,y.jsx)("div",{className:d?uS[d]:null,ref:h,children:(0,y.jsx)(ea,{styles:uS,owner:"StoryList",children:(0,y.jsx)(uj,{parentContainer:h,pageCols:void 0===i?2:i,pageRows:void 0===a?2:a,heading:o,items:v,itemComponent:ux,pageResponsiveness:uM,withFilter:void 0!==l&&l,withSortOrder:void 0!==s&&s,filterItems:uI,sortItems:uP,selected:void 0===p?null:p,onSelect:f,onUnselect:m,showSizeChanger:!1})})})})},uT={mapboxMap:"organizationListMap_mapboxMap__8kqd7",readMore:"organizationListMap_readMore__8kqd7",readLess:"organizationListMap_readLess__8kqd7",infoWindowContentContainer:"organizationListMap_infoWindowContentContainer__8kqd7",picture:"organizationListMap_picture__8kqd7",organizationName:"organizationListMap_organizationName__8kqd7",facilityLine:"organizationListMap_facilityLine__8kqd7",facilityName:"organizationListMap_facilityName__8kqd7",distance:"organizationListMap_distance__8kqd7",story:"organizationListMap_story__8kqd7",fullHeight:"organizationListMap_fullHeight__8kqd7",productSection:"organizationListMap_productSection__8kqd7"};function uL(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=uE(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function uE(e,t){if(e){if("string"==typeof e)return uz(e,t);var n=({}).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)?uz(e,t):void 0}}function uz(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let uA=function(e){var t,n,r=e.organizationIdList,o=e.organizations,i=e.facilities,a=e.mapStyles,l=e.mapOptions,s=void 0===l?null:l,u=e.zoom,d=void 0===u?3:u,f=e.customClass,m=void 0===f?null:f,p=e.selected,h=void 0===p?null:p,g=e.onInfoWindowHide,b=e.onInfoWindowShow,j=e.onUnselect,w=e.onSelect,x=(0,v.useIntl)(),S=(0,c.useRef)(null),O=(0,c.useRef)(null),k=(0,c.useContext)(er),C=function(e){if(Array.isArray(e))return e}(n=(0,c.useState)({}))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,0)||uE(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),M=C[0],P=C[1],I=(0,c.useMemo)(function(){var e=0;return null!=O&&O.current&&(e=O.current.clientHeight),e?Math.round(e/4):215},[null==O||null===(t=O.current)||void 0===t?void 0:t.clientHeight]),N=(0,c.useMemo)(function(){var e=Object.assign({},lP.defaultMapOptions),t=et(k);return t&&Object.keys(t).forEach(function(n){e[n]=t[n]}),s&&Object.keys(s).forEach(function(t){e[t]=s[t]}),e},[k,s]);return(0,c.useEffect)(function(){var e;if(!S.current){if(a8().accessToken="pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A",a8().supported()){var t=new(a8()).Map({container:O.current,style:N.mapboxStyleUrl,zoom:d,center:void 0,cooperativeGestures:!0}),n=new(a8()).NavigationControl({showCompass:!1});t.addControl(n,"bottom-right"),S.current=new l4(t,"mapbox",N);var a,l=S.current.map.newLatLngBounds(),s=[],c=null===(e=_.facilityTypes)||void 0===e?void 0:e.getByRefId("3"),u={},f=uL(r);try{for(f.s();!(a=f.n()).done;)(function(){var e,t,n,r=a.value,d=o[r];if(!d)return console.warn("bad id in organizationIdList",{organizationId:r});var f=d.facilities;if(!Array.isArray(f)||!f.length)return console.log("no facilities");var m,p=null,y=uL(f);try{for(y.s();!(m=y.n()).done;){var h=m.value,v=i[h];if(v){if(v.type===(null==c?void 0:c.refId)){p=v;break}}else console.warn("bad id in facilities",{facilityId:h})}}catch(e){y.e(e)}finally{y.f()}p||(p=i[f[0]]);var _=null!==(e=p)&&void 0!==e&&null!==(e=e.location)&&void 0!==e&&e.coordinates.length?null===(t=p)||void 0===t||null===(t=t.location)||void 0===t?void 0:t.coordinates:[];if(_.length){var O=[];Array.isArray(d.media)&&d.media.length?O.push({type:"media",data:{url:d.media[0].url,className:uT.picture}}):O.push({type:"media",data:{url:"/images/image-placeholder--grey.svg",className:uT.picture}}),d.name&&O.push({type:"headline",data:{text:d.name,className:uT.organizationName}}),null!==(n=p)&&void 0!==n&&null!==(n=n.location)&&void 0!==n&&n.countryCode&&O.push({type:"location",data:{location:p.location,intl:x,classNameFacilityLine:uT.facilityLine,classNameFacilityName:uT.facilityName}}),O.push({type:"containerClassName",data:uT.infoWindowContentContainer}),O.push({type:"text-block",data:{text:d.story,className:uT.story,maxWords:10,intlReadMore:x.formatMessage({id:"component-readMoreReadLess-read_more",defaultMessage:"Read More"}),classNameReadMore:uT.readMore,intlReadLess:x.formatMessage({id:"component-readMoreReadLess-read_less",defaultMessage:"Read Less"}),classNameReadLess:uT.readLess}}),S.current.map.extendLatLngBounds(l,_[0]),S.current.map.drawMarker({coordinates:_,options:N,onMarkerClickHandler:function(){var e,t=M[d.id];null!=t&&null!==(e=t.getPopup())&&void 0!==e&&e.isOpen()?("function"==typeof g&&g(d.id),"function"==typeof j&&j(d.id)):("function"==typeof b&&b(d.id),"function"==typeof w&&w(d.id),S.current.map.panTo(_[0]))},markersRef:s,isSelected:!0,hideSelectedInitial:!0,infoWindowContent:O});var k=s[s.length-1];u[d.id]=k}})()}catch(e){f.e(e)}finally{f.f()}return P(u),S.current.fitBoundsTo(null,l),function(){P({}),S.current.destructor(),S.current||t.remove(),S.current=null}}console.warn("WebGL is not supported. Interactive map not loaded.")}},[o,void 0===a?sd:a,N,O.current]),(0,c.useEffect)(function(){var e;if(S.current){for(var t=0,n=Object.keys(M);t<n.length;t++){var r,o=n[t],i=M[o];o!==h&&null!=i&&null!==(r=i.getPopup())&&void 0!==r&&r.isOpen()&&(M[o].togglePopup(),"function"==typeof j&&j(o),"function"==typeof g&&g(o))}M[h]&&!1===(null===(e=M[h])||void 0===e||null===(e=e.getPopup())||void 0===e?void 0:e.isOpen())&&(M[h].togglePopup(),"function"==typeof b&&b(h),S.current.map.panTo(M[h].getLngLat(),{offset:[0,I]}))}},[h,M]),(0,y.jsx)("div",{className:m?uT[m]:null,children:(0,y.jsx)("div",{ref:O,className:uT.mapboxMap})})};(0,c.createContext)({});let uF={storyListItem:"storyListItem_storyListItem__ee9re",image:"storyListItem_image__ee9re",certContainer:"storyListItem_certContainer__ee9re",certAvatar:"storyListItem_certAvatar__ee9re",certMore:"storyListItem_certMore__ee9re",unpublishedContainer:"storyListItem_unpublishedContainer__ee9re",details:"storyListItem_details__ee9re",productTitle:"storyListItem_productTitle__ee9re",orgTitle:"storyListItem_orgTitle__ee9re",location:"storyListItem_location__ee9re",locationText:"storyListItem_locationText__ee9re",productTypes:"storyListItem_productTypes__ee9re",growingArea:"storyListItem_growingArea__ee9re",label:"storyListItem_label__ee9re",value:"storyListItem_value__ee9re"},uD=function(e){var t,n,r,o,i,a,l,s,c,u=e.certifications,d=e.targetUrl,f=e.countryCode,m=e.productMediaUrl,p=e.organizationMediaUrl,h=e.product,g=e.organization,b=(e.publishedAt,e.published),j=(0,v.useIntl)(),w=null!==(n=null!=m?m:p)&&void 0!==n?n:!h&&g?"/images/image-placeholder--grey.svg":"/images/image-placeholder-product.svg";return null!==(r=null==h?void 0:h.title)&&void 0!==r||null==g||g.title,null!==(o=null==h?void 0:h.title)&&void 0!==o||null==g||g.title,null!==(i=null==h?void 0:h.title)&&void 0!==i||null==g||g.title,null!==(a=null==h?void 0:h.title)&&void 0!==a||null==g||g.title,null!==(l=null==h?void 0:h.title)&&void 0!==l||null==g||g.title,t="".concat(null!==(s=null==h?void 0:h.title)&&void 0!==s?s:null==g?void 0:g.title," has no published field."),(0,y.jsx)(ea,{styles:uF,owner:"StoryListItem",children:(0,y.jsx)("div",{className:uF.storyListItem,onClick:function(){eU("Opened ".concat(d," ingredient popup"),{category:"Engagement",label:"StoryListItem profile"})},children:(0,y.jsxs)("a",{href:d,target:"_blank",rel:"noreferrer",children:[(0,y.jsxs)("div",{className:uF.image,style:{backgroundImage:"url(".concat(w,")")},children:[null!=u&&u.length?(0,y.jsx)("div",{className:uF.certContainer,children:(0,y.jsxs)(y.Fragment,{children:[u.slice(0,3).map(function(e){var t,n=null===(t=_.certificationTypes)||void 0===t?void 0:t.getByRefId(e);return n?(0,y.jsx)(ns,{certification:n.refId,hideLabel:!0},e):null}),u.length>3?(0,y.jsxs)("div",{className:uF.certMore,children:["+",u.length-3]}):null]})}):null,"boolean"==typeof b&&!1===b?(0,y.jsx)("div",{className:uF.unpublishedContainer,children:(0,y.jsx)(v.FormattedMessage,{id:"story-unpublished",defaultMessage:"Unpublished"})}):null]}),(0,y.jsx)(ea,{styles:uF,owner:"StoryListItem",children:(0,y.jsx)("div",{className:uF.details,children:(0,y.jsxs)(ea,{styles:uF,owner:"StoryListItem",children:[(0,y.jsx)("div",{className:uF.productTitle,children:null!==(c=null==h?void 0:h.title)&&void 0!==c?c:null==g?void 0:g.title}),(null==h?void 0:h.title)&&(null==g?void 0:g.title)&&(0,y.jsx)("div",{className:uF.orgTitle,children:null==g?void 0:g.title}),f?(0,y.jsxs)("div",{className:uF.location,children:[(0,y.jsx)(ea,{styles:uF,owner:"StoryListItem",children:(0,y.jsx)("span",{className:uF.countryFlag,children:(0,y.jsx)(o0(),{countryCode:f,svg:!0})})}),(0,y.jsx)("span",{className:uF.locationText,children:j.formatDisplayName(f.toUpperCase(),{type:"region"})})]}):null]})})})]})})})};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})(e)}function uW(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 uR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uW(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==uB(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var uU={desktop:{pageCols:3,pageRows:2},tablet:{pageCols:2,pageRows:2},mobile:{pageCols:1,pageRows:1}};function uH(e){var t,n,r,o,i,a,l,s,c,u,d=e.sortOrder,f=e.a,m=e.b,p="",y="";switch(d){case"name":return(p=null!==(t=null!==(n=null===(r=f.product)||void 0===r?void 0:r.title)&&void 0!==n?n:null===(o=f.organization)||void 0===o?void 0:o.title)&&void 0!==t?t:"")===(y=null!==(i=null!==(a=null===(l=m.product)||void 0===l?void 0:l.title)&&void 0!==a?a:null===(s=m.organization)||void 0===s?void 0:s.title)&&void 0!==i?i:"")?0:p>y?1:-1;case"most-recent":return(p=null!==(c=f.publishedAt)&&void 0!==c?c:"")===(y=null!==(u=m.publishedAt)&&void 0!==u?u:"")?0:p>y?1:-1;default:console.warn("[dev] unknown sort order",{sortOrder:d})}return 0}function uq(e){var t,n,r,o,i=e.item,a=e.filter,l=null!==(t=null!==(n=null===(r=i.product)||void 0===r?void 0:r.title)&&void 0!==n?n:null===(o=i.organization)||void 0===o?void 0:o.title)&&void 0!==t?t:"";return"string"!=typeof a||""===a||-1!==l.toLowerCase().indexOf(a.toLowerCase())}let uG=function(e){var t=e.stories,n=e.heading,r=e.pageRows,o=e.pageCols,i=e.withFilter,a=e.withSortOrder,l=(0,c.useRef)();return(0,y.jsx)("section",{ref:l,children:(0,y.jsx)(uj,{parentContainer:l,pageCols:void 0===o?3:o,pageRows:void 0===r?2:r,pageResponsiveness:uU,heading:n,items:t.map(function(e,t){return uR(uR({},e),{},{id:t})}),itemComponent:uD,withFilter:void 0!==i&&i,withSortOrder:void 0!==a&&a,filterItems:uq,sortItems:uH})})},uV={containerWidths:"organizationCommercial_containerWidths__jn5eg",featuredStoriesSection:"organizationCommercial_featuredStoriesSection__jn5eg",featuredStoriesContainer:"organizationCommercial_featuredStoriesContainer__jn5eg",orgBody:"organizationCommercial_orgBody__jn5eg",bodyContentContainer:"organizationCommercial_bodyContentContainer__jn5eg",storyTitle:"organizationCommercial_storyTitle__jn5eg",orgDetails:"organizationCommercial_orgDetails__jn5eg",detailsContainer:"organizationCommercial_detailsContainer__jn5eg",removeUntilTablet:"organizationCommercial_removeUntilTablet__jn5eg",orgBanner:"organizationCommercial_orgBanner__jn5eg",bannerImage:"organizationCommercial_bannerImage__jn5eg",bannerBottomGradient:"organizationCommercial_bannerBottomGradient__jn5eg",detailsColumnContainer:"organizationCommercial_detailsColumnContainer__jn5eg",menuButton:"organizationCommercial_menuButton__jn5eg",orgName:"organizationCommercial_orgName__jn5eg",brandingLogo:"organizationCommercial_brandingLogo__jn5eg",logoContainer:"organizationCommercial_logoContainer__jn5eg",logoContainerMobile:"organizationCommercial_logoContainerMobile__jn5eg",locationLineContainer:"organizationCommercial_locationLineContainer__jn5eg",lineContainer:"organizationCommercial_lineContainer__jn5eg",locationTextContainer:"organizationCommercial_locationTextContainer__jn5eg",countryFlag:"organizationCommercial_countryFlag__jn5eg",locationText:"organizationCommercial_locationText__jn5eg",locationInfo:"organizationCommercial_locationInfo__jn5eg",orgDetailsMobile:"organizationCommercial_orgDetailsMobile__jn5eg",orgNameMobile:"organizationCommercial_orgNameMobile__jn5eg",locationLineMobileContainer:"organizationCommercial_locationLineMobileContainer__jn5eg",featuredStoriesList:"organizationCommercial_featuredStoriesList__jn5eg",featuredOrganizationsContainer:"organizationCommercial_featuredOrganizationsContainer__jn5eg",organizationMap:"organizationCommercial_organizationMap__jn5eg",organizationList:"organizationCommercial_organizationList__jn5eg",producerModal:"organizationCommercial_producerModal__jn5eg",closeIcon:"organizationCommercial_closeIcon__jn5eg",closeIconContainer:"organizationCommercial_closeIconContainer__jn5eg"};function uZ(){uZ=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==uQ(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(uQ(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function uY(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=uX(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function uJ(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?uJ(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=uQ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=uQ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==uQ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uQ(e){return(uQ="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)}function uK(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||uX(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uX(e,t){if(e){if("string"==typeof e)return u0(e,t);var n=({}).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)?u0(e,t):void 0}}function u0(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u1(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function u2(e,t){var n=document.createElement("a"),r=URL.createObjectURL(e);n.download=t,n.href=r,n.click()}function u5(e){return u8.apply(this,arguments)}function u8(){var e;return e=uZ().mark(function e(t){var n,r,o,i;return uZ().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url,r=t.filename,o=t.intl,e.prev=1,e.next=4,(0,tJ.getAPI)(n,{asResponse:!0});case 4:return i=e.sent,e.t0=u2,e.next=8,i.blob();case 8:e.t1=e.sent,e.t2=r,(0,e.t0)(e.t1,e.t2),e.next=16;break;case 13:e.prev=13,e.t3=e.catch(1),j.message.error(o.formatMessage({id:"download-file-error",defaultMessage:"Failure to download, please retry"}));case 16:case"end":return e.stop()}},e,null,[[1,13]])}),(u8=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){u1(i,r,o,a,l,"next",e)}function l(e){u1(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}let u4=function(e){var t,n,r,o,i=e.organization,a=e.organizations,l=e.featuredStories,s=e.featuredOrganizations,u=e.featuredStoriesSectionTitle,d=e.attachments,f=e.mainFacility,m=e.facilities,p=e.brandingLogo,h=e.brandingLogoMobile,g=e.orgBannerImage,b=e.hideLocationText,_=void 0!==b&&b,w=e.hideMedia,x=e.hideInfos,S=e.hideCertifications,O=(0,v.useIntl)(),k=i.name,C=i.media,M=uK((0,c.useState)(!1),2),P=M[0],I=M[1],N=uK((0,c.useState)(null),2),T=N[0],L=N[1],E=uK((0,c.useState)(null),2),z=E[0],A=E[1],F=(0,c.useMemo)(function(){var e=l?Object.keys(l):[];return"object"===uQ(l)&&null!=e&&e.length?u?u.title:(0,y.jsx)(v.FormattedMessage,{id:"component-stories-as-source-heading",defaultMessage:"Sourcing List"}):null},[l,u]),D=(0,c.useMemo)(function(){return null!=s&&s.length?(0,y.jsx)(v.FormattedMessage,{id:"component-organization-as-source-heading",defaultMessage:"Featured Producers"}):null},[null==s?void 0:s.length]),B=(0,c.useMemo)(function(){var e,t;return(0,y.jsx)("div",{className:uV.locationLineMobileContainer,children:(0,y.jsxs)("div",{className:uV.locationTextContainer,children:[null!=f&&null!==(e=f.location)&&void 0!==e&&e.countryCode?(0,y.jsx)("span",{className:uV.countryFlag,children:(0,y.jsx)(o0(),{countryCode:null==f||null===(t=f.location)||void 0===t?void 0:t.countryCode,svg:!0})}):null,(0,y.jsx)("span",{className:uV.locationText,children:(0,y.jsx)(rm,u$(u$({hideIcon:!0},null==f?void 0:f.location),{},{hideFacilityName:!0,customClass:"orgSectionPlace"}))})]})})},[_]),W=(0,c.useMemo)(function(){var e=l?Object.keys(l):[];return"object"===uQ(l)&&e.length?(0,y.jsx)("section",{className:uV.featuredStoriesSection,children:(0,y.jsx)("div",{className:uV.featuredStoriesContainer,children:(0,y.jsx)("div",{className:uV.featuredStoriesList,children:(0,y.jsx)(uG,{stories:l,withFilter:!0,withSortOrder:!0,heading:F})})})}):null},[l]),R=(0,c.useMemo)(function(){if(!Array.isArray(d)||!d.length)return null;var e="string"==typeof d[0].caption&&d[0].caption.length?d[0].caption:(0,y.jsx)(v.FormattedMessage,{id:"component-organization-attachments-default-caption",defaultMessage:"Documents"});if(1===d.length)return(0,y.jsx)("button",{className:uV.menuButton,onClick:function(){u5({url:d[0].url,filename:d[0].filename,intl:O})},children:e});var t=(0,y.jsx)(j.Menu,{onClick:function(e){var t,n;u5({url:null==e||null===(t=e.item)||void 0===t||null===(t=t.props)||void 0===t?void 0:t.url,filename:null==e||null===(n=e.item)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.filename,intl:O})},items:d.map(function(e,t){return{label:e.caption,url:e.url,filename:e.filename,key:t}})});return(0,y.jsx)(j.Dropdown,{overlay:t,className:uV.menuButton,children:(0,y.jsx)(j.Button,{children:e})})},[d]),U=(0,c.useMemo)(function(){var e;if(p){var t,n=uY(p);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!r.startsWith("TEXT"))return r}}catch(e){n.e(e)}finally{n.f()}}return C&&C.length&&C[0]&&C[0].url?null===(e=C[0])||void 0===e?void 0:e.url:"/images/image-placeholder--grey.svg"},[p,C]),H=(0,c.useMemo)(function(){var e;if(h){var t,n=uY(h);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(!r.startsWith("TEXT"))return r}}catch(e){n.e(e)}finally{n.f()}}return C&&C.length&&C[0]&&C[0].url?null===(e=C[0])||void 0===e?void 0:e.url:"/images/image-placeholder--grey.svg"},[h,C]),q=(0,c.useMemo)(function(){if(p){var e,t=uY(p);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.startsWith("TEXT"))return n.replace(/^TEXT:/,"")}}catch(e){t.e(e)}finally{t.f()}}return k},[p,k]),G=(0,c.useMemo)(function(){if(h){var e,t=uY(h);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.startsWith("TEXT"))return n.replace(/^TEXT:/,"")}}catch(e){t.e(e)}finally{t.f()}}return k},[h,k]),V=(0,c.useMemo)(function(){return ie({facilities:m,organization:a[z]})},[z]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("section",{className:uV.orgBanner,children:[(0,y.jsx)("div",{className:uV.bannerImage,style:{backgroundImage:"url(".concat(g,")")}}),(0,y.jsx)("div",{className:uV.bannerBottomGradient})]}),(0,y.jsxs)("section",{className:uV.orgDetails,children:[(0,y.jsxs)("div",{className:uV.detailsContainer,children:[(0,y.jsxs)("div",{className:uV.brandingLogo,children:[(0,y.jsx)("div",{className:uV.logoContainer,style:{backgroundImage:"url(".concat(U,")")}}),(0,y.jsx)("div",{className:uV.logoContainerMobile,style:{backgroundImage:"url(".concat(H,")")}})]}),(0,y.jsxs)("div",{className:uV.detailsColumnContainer,children:[(0,y.jsx)("h1",{className:uV.orgName,children:q}),(0,y.jsxs)("div",{className:uV.locationLineContainer,children:[(0,y.jsxs)("div",{className:uV.locationTextContainer,children:[null!=f&&null!==(t=f.location)&&void 0!==t&&t.countryCode?(0,y.jsx)("span",{className:uV.countryFlag,children:(0,y.jsx)(o0(),{countryCode:null==f||null===(n=f.location)||void 0===n?void 0:n.countryCode,svg:!0})}):null,(0,y.jsx)("span",{className:uV.locationText,children:(0,y.jsx)(rm,u$(u$({hideIcon:!0},null==f?void 0:f.location),{},{hideFacilityName:!0,customClass:"orgSectionPlace"}))})]}),R]})]})]}),(0,y.jsxs)("div",{className:uV.orgDetailsMobile,children:[(0,y.jsx)("h1",{className:uV.orgNameMobile,children:G}),B,R]})]}),(0,y.jsxs)("section",{className:uV.orgBody,children:[(0,y.jsx)("h2",{className:uV.storyTitle,children:(0,y.jsx)(v.FormattedMessage,{id:"component-orgSection-our-story",defaultMessage:"Our Story"})}),(0,y.jsx)("div",{className:uV.bodyContentContainer,children:(0,y.jsx)("div",{className:uV.sourceStory,children:(0,y.jsx)(aq,{content:null!==(r=i.description)&&void 0!==r?r:i.story,type:"link",name:"product section",maxCharLength:400})})})]}),null!=s&&s.length?(0,y.jsxs)("section",{className:uV.facilityMapSection,children:[(0,y.jsxs)("div",{className:uV.featuredOrganizationsContainer,children:[(0,y.jsx)("div",{className:uV.organizationMap,children:(0,y.jsx)(uA,{organizationIdList:s,organizations:a,facilities:m,customClass:"fullHeight",onSelect:function(e){e===T&&L(null),L(e)},onUnselect:function(e){e===T&&L(null)},selected:T})}),(0,y.jsx)("div",{className:uV.organizationList,children:(0,y.jsx)(uN,{organizationIdList:s,organizations:a,facilities:m,heading:D,withSortOrder:!0,withFilter:!1,customClass:"featuredOrganizationsList",onSelect:function(e){A(e),I(!0)},onUnselect:function(){A(null),I(!1)},selected:z})})]}),(0,y.jsxs)(j.Modal,{className:uV.producerModal,open:P,centered:!0,footer:null,closable:!1,onCancel:function(){return I(!1)},width:"100%",zIndex:1012,children:[(0,y.jsx)("div",{className:uV.closeIconContainer,onClick:function(){return I(!1)},children:(0,y.jsx)("div",{children:(0,y.jsx)("i",{className:uV.closeIcon})})}),(0,y.jsx)("div",{className:uV.producerModalContainer,children:(0,y.jsx)(cr,{organization:null!==(o=a[z])&&void 0!==o?o:null,organizations:a,mainFacility:null!=V?V:[],hideLocationText:_,hideMedia:void 0!==w&&w,hideInfos:void 0!==x&&x,hideCertifications:void 0!==S&&S})})]})]}):null,W]})},u3={containerWidths:"organizationBasic_containerWidths__ujywc",orgBody:"organizationBasic_orgBody__ujywc",bodyContentContainer:"organizationBasic_bodyContentContainer__ujywc",storyTitle:"organizationBasic_storyTitle__ujywc",orgDetails:"organizationBasic_orgDetails__ujywc",detailsContainer:"organizationBasic_detailsContainer__ujywc",bannerNameContainer:"organizationBasic_bannerNameContainer__ujywc",removeUntilTablet:"organizationBasic_removeUntilTablet__ujywc",typeLine:"organizationBasic_typeLine__ujywc",yearEstablished:"organizationBasic_yearEstablished__ujywc",goldDotSeparator:"organizationBasic_goldDotSeparator__ujywc",orgBanner:"organizationBasic_orgBanner__ujywc",bannerImage:"organizationBasic_bannerImage__ujywc",bannerOrgName:"organizationBasic_bannerOrgName__ujywc",bannerBottomGradient:"organizationBasic_bannerBottomGradient__ujywc",lineContainer:"organizationBasic_lineContainer__ujywc",orgNameMobile:"organizationBasic_orgNameMobile__ujywc",countryFlag:"organizationBasic_countryFlag__ujywc",locationText:"organizationBasic_locationText__ujywc",locationInfo:"organizationBasic_locationInfo__ujywc",story:"organizationBasic_story__ujywc",infos:"organizationBasic_infos__ujywc",panelHeader:"organizationBasic_panelHeader__ujywc",values:"organizationBasic_values__ujywc",seeMoreLink:"organizationBasic_seeMoreLink__ujywc",commercial:"organizationBasic_commercial__ujywc",brandingLogo:"organizationBasic_brandingLogo__ujywc"};function u6(e){return(u6="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)}function u9(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 u7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u9(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=u6(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=u6(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==u6(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let de=function(e){var t,n,r=e.organization,o=e.certifications,i=e.certificationsSorted,a=e.organizations,l=e.hideMedia,s=e.hideInfos,c=e.hideCertifications,u=e.mainFacility,d=e.hideLocationText,f=e.orgBannerImage,m=r.name,p=r.type,h=r.organizationType,g=r.yearEstablished,b=r.media,j=(r.facilities,r.values);return r.certifications,(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("section",{className:u3.orgBanner,children:[(0,y.jsx)("div",{className:u3.bannerImage,style:{backgroundImage:"url(".concat(f,")")},children:(0,y.jsxs)("div",{className:u3.bannerNameContainer,children:[(0,y.jsx)("div",{className:u3.bannerOrgName,children:m}),(null==b?void 0:b.length)>1&&!(void 0!==l&&l)&&(0,y.jsx)(nV,{slug:"organization",index:0,mediaItemClass:"fromOrganizationSection",mediaSectionBtn:"orgSectionBtn",mediaType:"image",carouselCount:b.length,embedded:!1,embeddedFull:!1,videoOverlay:!1,modalContent:(0,y.jsx)(n9,{className:u3.mediaCarousel,mediaCarouselClass:"fromMediaItems",slideClass:"fromMediaItems",dotsTypeStyle__mobile:"",media:b,type:"fullscreen",slug:"organization",current:0,videoAsOverlay:!1,fromMediaItems:!0,embedded:!1,embeddedFull:!1})})]})}),(0,y.jsx)("div",{className:u3.bannerBottomGradient})]}),(0,y.jsx)("section",{className:u3.orgDetails,children:(0,y.jsxs)("div",{className:u3.detailsContainer,children:[(0,y.jsx)("div",{className:u3.lineContainer,children:(0,y.jsx)("h1",{className:u3.orgNameMobile,children:r.name})}),!d&&null!=u&&u.location?(0,y.jsxs)("div",{className:u3.lineContainer,children:[u.location.countryCode?(0,y.jsx)("span",{className:u3.countryFlag,children:(0,y.jsx)(o0(),{countryCode:u.location.countryCode,svg:!0})}):null,(0,y.jsx)("span",{className:u3.locationText,children:(0,y.jsx)(rm,u7(u7({hideIcon:!0},u.location),{},{hideFacilityName:!0,customClass:"orgSectionPlace"}))})]}):null,(0,y.jsxs)("div",{className:"".concat(u3.lineContainer," ").concat(u3.typeLine),children:[(0,y.jsx)(o4,{type:null!=h?h:p}),g&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{className:u3.goldDotSeparator,children:" • "}),(0,y.jsx)("span",{className:u3.yearEstablished,children:(0,y.jsx)(v.FormattedMessage,{id:"component-organizationSection-established",defaultMessage:"Established {yearEstablished}",values:{yearEstablished:g}})})]})]})]})}),(0,y.jsxs)("section",{className:u3.orgBody,children:[(0,y.jsx)("h2",{className:u3.storyTitle,children:(0,y.jsx)(v.FormattedMessage,{id:"component-orgSection-our-story",defaultMessage:"Our Story"})}),(0,y.jsxs)("div",{className:u3.bodyContentContainer,children:[(0,y.jsx)("div",{className:u3.story,children:(0,y.jsx)(aq,{content:null!==(t=r.description)&&void 0!==t?t:r.story,type:"link",name:"product section",maxCharLength:800})}),!(void 0!==s&&s)&&(0,y.jsx)("div",{className:u3.infos,children:(0,y.jsxs)(tY,{children:[!(void 0!==c&&c)&&null!=o&&o.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s9,{organizations:a}),(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:u3.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-orgSection-certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(nv,{certifications:o,certificationsSorted:i})},"certifications")]}):null,j.length?(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:u3.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-orgSection-value-title",defaultMessage:"Values"})}),forceRender:!0,children:(0,y.jsx)("div",{className:u3.values,children:(0,y.jsx)(ic,{values:r.values,valuesSorted:r.valuesSorted})})},"values")}):null]})})]})]}),null!=u&&null!==(n=u.location)&&void 0!==n&&null!==(n=n.coordinates)&&void 0!==n&&n.length?(0,y.jsx)("section",{className:u3.facilityMapSection,children:(0,y.jsx)(cN,{facility:u})}):null]})},dt=e4(function(e){var t,n=e.organization,r=e.organizations,o=e.featuredStories,i=e.featuredOrganizations,a=e.featuredStoriesSectionTitle,l=e.facilities,s=e.attachments,u=e.brandingLogo,d=e.brandingLogoMobile,f=e.brandingLogoLink,m=e.hideMedia,p=e.hideInfos,h=e.hideCertifications,g=e.isCommercial,b=e.windowWidth,j=(0,v.useIntl)(),_=(0,c.useMemo)(function(){var e,t,r,o;return r=(t={url:null===(e=n.media[0])||void 0===e?void 0:e.url,width:b}).url,o=t.width,r&&"string"==typeof r?-1===r.indexOf("w=")&&-1===r.indexOf("width=")?r:r.replace(/w=[0-9]*/,"w=".concat(o)).replace(/width=[0-9]*/,"width=".concat(o)):"/images/image-placeholder--grey.svg"},[n.media,b]),w=(0,c.useMemo)(function(){return ie({facilities:l,organization:n})},[l,n]),x=null==w||null===(t=w.location)||void 0===t||null===(t=t.coordinates)||void 0===t||!t.length||!w.location.countryCode,S=(0,c.useMemo)(function(){var e;return null!==(e=n.certifications)&&void 0!==e&&e.length?n.certifications:null},[n.certifications]),O=(0,c.useMemo)(function(){var e;return null!==(e=n.certificationsSorted)&&void 0!==e&&e.length?n.certificationsSorted:[]},[n.certificationsSorted]);return void 0!==g&&g?(0,y.jsx)(u4,{organization:n,organizations:r,featuredStories:o,featuredOrganizations:i,featuredStoriesSectionTitle:a,attachments:s,hideLocationText:x,mainFacility:w,facilities:l,brandingLogo:u,brandingLogoMobile:d,brandingLogoLink:f,orgBannerImage:_}):(0,y.jsx)(de,{organization:n,organizations:r,certifications:S,certificationsSorted:O,hideCertifications:void 0!==h&&h,hideInfos:void 0!==p&&p,hideMedia:void 0!==m&&m,hideLocationText:x,intl:j,mainFacility:w,orgBannerImage:_})}),dn={socialLinkSection:"socialLinkSection_socialLinkSection__eaku2",containerWrapper:"socialLinkSection_containerWrapper__eaku2",container:"socialLinkSection_container__eaku2",headline:"socialLinkSection_headline__eaku2",socialLink:"socialLinkSection_socialLink__eaku2",content:"socialLinkSection_content__eaku2"};function dr(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 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})(e)}let da=function(e){var t,n,r=e.organization,o=e.customHeadlineStyle;return r&&"object"===di(r)&&Array.isArray(r.social)&&r.social.length?(0,y.jsx)("section",{className:dn.socialLinkSection,children:(0,y.jsx)("div",{className:"containerWrapper "+dn.containerWrapper,children:(0,y.jsxs)("div",{className:"container "+dn.container,children:[(0,y.jsx)("h2",{className:"".concat(dn.headline," ").concat(null!==(t=dn[o])&&void 0!==t?t:""),children:(0,y.jsx)(v.FormattedMessage,{id:"follow-organization-name",defaultMessage:"Follow {organizationName}",values:{organizationName:null==r?void 0:r.name}})}),(0,y.jsx)("div",{className:dn.content,children:null==r||null===(n=r.social)||void 0===n?void 0:n.map(function(e,t){return(0,y.jsx)(rw,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==di(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e),t)})})]})})}):null},dl=n(12945),ds={iconsContainer:"shareLink_iconsContainer__6fwqx",iconLinkContainer:"shareLink_iconLinkContainer__6fwqx",iconLinkButton:"shareLink_iconLinkButton__6fwqx",fromHeader:"shareLink_fromHeader__6fwqx"};function dc(e){return(dc="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)}function du(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 dd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?du(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=dc(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=dc(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==dc(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let df=function(e){var t=e.organization,n=e.shareLinkClass,r=(0,v.useIntl)();if(null==t||!t.name)return null;var o=r.formatMessage({id:"share-link-copy-success",defaultMessage:"URL copied to clipboard"}),i=r.formatMessage({id:"share-email-subject",defaultMessage:"Check out this {organizationName} StoryBird"},{organizationName:t.name}),a=r.formatMessage({id:"share-email-body",defaultMessage:"Hey there! I loved this story from {organizationName}, and I thought you might too. Check it out!"},{organizationName:t.name}),l="https://storybird.io:443",s=[{type:"facebook",icon:null,reactShareElement:"FacebookShareButton",reactShareProps:{url:l=window.location.href}},{type:"twitter",icon:null,reactShareElement:"TwitterShareButton",reactShareProps:{url:l}},{type:"copy",icon:null,reactShareElement:null,reactShareProps:{},onClick:function(){var e,t;e=l,(t=document.createElement("textarea")).innerText=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove(),j.message.success(o)}},{type:"email",icon:null,reactShareElement:"EmailShareButton",reactShareProps:{subject:i,body:a,separator:"\n",url:l}}];return(0,y.jsx)(ea,{styles:ds,owner:"ShareLink",children:(0,y.jsx)("div",{className:"".concat(ds.iconsContainer," ").concat(n?ds["".concat(n)]:""),children:s.map(function(e,t){var r=dl[e.reactShareElement];return void 0===r&&(r="button"),(0,y.jsx)("div",{className:ds.iconLinkContainer,onClick:function(){eU("Clicked Share ".concat(e.type),{category:"Engagement",label:"Product profile"}),"function"==typeof e.onClick&&e.onClick()},children:(0,y.jsx)(r,dd(dd({},e.reactShareProps),{},{className:ds.iconLinkButton,children:(0,y.jsx)(rj,{socialIconClass:n,type:e.type})}))},t)})})})},dm=function(e){var t=e.className,n=e.shareIconClassName,r=e.organization,o=e.hideMedia;return(0,y.jsx)(j.Popover,{content:(0,y.jsx)(df,{organization:r,shareLinkClass:"fromHeader"}),trigger:"click",placement:"bottomRight",children:(0,y.jsx)("button",{className:"".concat("shareLinkButton_iconLinkButton__254ks"," ").concat(t),children:(0,y.jsx)("i",{className:"".concat(void 0===n?"shareLinkButton_shareIcon__254ks":n," ").concat(void 0!==o&&o?"shareLinkButton_hideMedia__254ks":"")})})})},dp={header:"storyHeaderSection_header__j5shz",storybirdLogoImage:"storyHeaderSection_storybirdLogoImage__j5shz",containerWrapper:"storyHeaderSection_containerWrapper__j5shz",content:"storyHeaderSection_content__j5shz",logo:"storyHeaderSection_logo__j5shz",organizationName:"storyHeaderSection_organizationName__j5shz",image:"storyHeaderSection_image__j5shz",default:"storyHeaderSection_default__j5shz",hideMedia:"storyHeaderSection_hideMedia__j5shz",brandedMultiItems:"storyHeaderSection_brandedMultiItems__j5shz",brandedLogoText:"storyHeaderSection_brandedLogoText__j5shz",brandedLogoImage:"storyHeaderSection_brandedLogoImage__j5shz",brandingMobile:"storyHeaderSection_brandingMobile__j5shz",brandingDesktop:"storyHeaderSection_brandingDesktop__j5shz",headerShareButton:"storyHeaderSection_headerShareButton__j5shz",commercialHeader:"storyHeaderSection_commercialHeader__j5shz",commercialShareIcon:"storyHeaderSection_commercialShareIcon__j5shz",defaultStorybirdLogoImage:"storyHeaderSection_defaultStorybirdLogoImage__j5shz"};function dy(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dh(e,t);var n=({}).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)?dh(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let dv=function(e){var t=e.hideLogo,n=e.hideShareButton,r=e.hideMedia,o=void 0!==r&&r,i=e.brandingLogo,a=void 0===i?null:i,l=e.brandingLogoMobile,s=void 0===l?null:l,u=e.brandingLogoWidth,d=void 0===u?null:u,m=e.brandingLogoHeight,p=void 0===m?null:m,h=e.brandingLogoLink,v=void 0===h?null:h,g=e.organization,b=void 0===g?null:g,j=e.isCommercial,_=void 0!==j&&j,w=dy((0,c.useMemo)(function(){return function(e){var t=e.brandingLogo,n=e.brandingLogoMobile,r=e.brandingLogoWidth,o=e.brandingLogoHeight,i=e.hideMedia,a=(t||n)&&r&&o,l=(0,y.jsx)("div",{className:"".concat(dp.logo," ").concat(i?dp.hideMedia:""," branded")}),s="",c=null,u=".branded {\n background-size: contain !important; \n background-repeat: no-repeat !important; \n"+" background-image: url(".concat(t,") !important;\n")+" width: ".concat(r," !important; \n")+" height: ".concat(o," !important; \n")+"}\n",d=n?"@media (max-width: 767px) and (orientation: portrait), (max-width: 824px) and (max-height: 514px) and (orientation: landscape){\n .branded {\n background-size: contain !important; \n background-repeat: no-repeat !important; \n"+"  background-image: url(".concat(n,") !important;\n")+"  width: ".concat(r," !important; \n")+"  height: ".concat(o," !important; \n")+" }\n}\n":"";if(Array.isArray(t)&&Array.isArray(n)&&t.length===n.length){s=".branded {\n background-image: initial !important; \n background-size: contain !important; \n background-repeat: no-repeat !important; \n"+" width: ".concat(r," !important; \n")+" height: ".concat(o," !important; \n")+"}\n";var m=function(e,t,n){var r=(0,y.jsx)("div",{className:"".concat(dp.brandedLogoImage," ").concat(n),children:(0,y.jsx)(f(),{src:e,alt:"logo",fill:!0,layout:"fill",style:{objectFit:"contain"}})},t),o=(0,y.jsx)("div",{className:"".concat(dp.brandedLogoText," ").concat(n),children:e.replace(/^TEXT:/,"")},t);return 0===e.indexOf("TEXT:")?o:r};c=(0,y.jsxs)("div",{className:"".concat(dp.logo," ").concat(i?dp.hideMedia:""," ").concat(dp.brandedMultiItems," branded"),children:[t.map(function(e,t){return m(e,t,dp.brandingDesktop)}),n.map(function(e,t){return m(e,t,dp.brandingMobile)})]})}else s=u+d,c=l;return[a,s,c]}({brandingLogo:a,brandingLogoMobile:s,brandingLogoHeight:p,brandingLogoWidth:d,hideMedia:o})},[a,s,p,d,o]),3),S=w[0],O=w[1],k=w[2],C=dy((0,c.useMemo)(function(){var e,t,n;return t=!1,n=null,Array.isArray(null==b?void 0:b.media)&&null!=b&&null!==(e=b.media)&&void 0!==e&&e.length&&(t=!0,n=(0,y.jsx)(ea,{styles:dp,owner:"HeaderSection",children:(0,y.jsxs)("div",{className:dp.logo,children:[(0,y.jsx)("div",{className:dp.image,style:{backgroundImage:"url(".concat(b.media[0].url,")")}}),(0,y.jsx)("div",{className:dp.organizationName,children:b.name})]})})),[t,n]},[b]),2),M=C[0],P=C[1],I=(0,c.useMemo)(function(){return(0,y.jsx)(x(),{href:tk().consumerUrl,target:"_blank",children:(0,y.jsx)(f(),{className:dp.defaultStorybirdLogoImage,src:"/images/logos/logo-storybird--black.svg",alt:"storybird logo",style:{objectFit:"contain"},width:164,height:55})})},[]),N=(0,c.useMemo)(function(){return(0,y.jsxs)("div",{className:"".concat(dp.logo," ").concat(dp.default," ").concat(o?dp.hideMedia:""),children:[(0,y.jsx)("div",{className:dp.image}),(0,y.jsx)("div",{className:dp.organizationName,children:null==b?void 0:b.name})]})},[b,o]),T=(0,c.useMemo)(function(){return"string"==typeof v&&0===v.indexOf("https://")?{href:v}:null},[v]),L=(0,c.useMemo)(function(){return _?I:S?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("style",{scoped:!0,children:O}),k]}):M?P:N},[S,O,k,M,P,N,_,I]),E=(0,c.useMemo)(function(){return T?(0,y.jsx)(x(),{href:T.href,as:T.as,shallow:T.shallow,children:L}):L},[L,T]),z=(0,c.useMemo)(function(){return(0,y.jsx)("div",{className:dp.headerShareButton,children:(0,y.jsx)(dm,{className:dp.shareButton,shareIconClassName:_?dp.commercialShareIcon:void 0,hideMedia:o,organization:b})})},[b,o,_]);return(0,y.jsx)("header",{className:"".concat(_?dp.commercialHeader:dp.header),children:(0,y.jsx)("div",{className:"containerWrapper ".concat(dp.containerWrapper),children:(0,y.jsx)(ea,{styles:dp,owner:"storyHeaderSection",children:(0,y.jsx)("div",{className:"container ".concat(dp.container),children:(0,y.jsxs)("div",{className:dp.content,children:[void 0!==t&&t?null:E,void 0!==n&&n?null:z]})})})})})},dg={storySection:"storySection_storySection__ypfpx",containerWrapper:"storySection_containerWrapper__ypfpx",container:"storySection_container__ypfpx",headline:"storySection_headline__ypfpx",storyContainer:"storySection_storyContainer__ypfpx"},db=function(e){var t=e.story;return t?(0,y.jsx)("section",{className:dg.storySection,children:(0,y.jsx)("div",{className:"containerWrapper "+dg.containerWrapper,children:(0,y.jsxs)("div",{className:"container "+dg.container,children:[(0,y.jsx)("div",{className:dg.headlineWrapper,children:(0,y.jsx)("h2",{className:dg.headline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-storySection-title",defaultMessage:"Story"})})}),(0,y.jsx)("div",{className:dg.content,children:(0,y.jsx)("div",{className:dg.storyContainer,children:(0,y.jsx)(aq,{content:t,type:"link",parent:"storySection",name:"story section"})})})]})})}):null},dj={farmer:"farmer_farmer__qgn7f",image:"farmer_image__qgn7f",details:"farmer_details__qgn7f",name:"farmer_name__qgn7f",location:"farmer_location__qgn7f",locationIcon:"farmer_locationIcon__qgn7f",productTypes:"farmer_productTypes__qgn7f",growingArea:"farmer_growingArea__qgn7f",label:"farmer_label__qgn7f",value:"farmer_value__qgn7f"};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})(e)}let dw=function(e){var t=e.name,n=e.hyphenatedName,r=e.growingArea,o=e.countryCode,i=e.countryRegion,a=e.productTypes,l=e.media,s=(0,v.useIntl)(),u=l.length?l[0].url:"/images/image-placeholder--grey.svg",d=(0,c.useMemo)(function(){return"object"!==d_(_.productTypes)?null:a.map(function(e){return _.productTypes.getByRefId(e,!0).name})},[a,_.productTypes]);return(0,y.jsx)(ea,{styles:dj,owner:"Farmer",children:(0,y.jsxs)("div",{className:dj.farmer,onClick:function(){eU("Opened ".concat(n," ingredient popup"),{category:"Engagement",label:"Farmer profile"})},children:[(0,y.jsx)("div",{className:dj.image,style:{backgroundImage:"url(".concat(u,")")}}),(0,y.jsx)(ea,{styles:dj,owner:"Farmer",children:(0,y.jsx)("div",{className:dj.details,children:(0,y.jsxs)(ea,{styles:dj,owner:"Farmer",children:[(0,y.jsx)("div",{className:dj.name,children:t}),(0,y.jsxs)("div",{className:dj.location,children:[i||o?(0,y.jsx)(ea,{styles:dj,owner:"Farmer",children:(0,y.jsx)("i",{className:dj.locationIcon})}):null,i?i+", ":"",o&&s.formatDisplayName(o.toUpperCase(),{type:"region"})]}),r?(0,y.jsxs)("div",{className:dj.growingArea,children:[(0,y.jsx)("span",{className:dj.label,children:(0,y.jsx)(v.FormattedMessage,{id:"farmer-total-growing-area",defaultMessage:"Total Growing Area"})}),(0,y.jsx)("span",{className:dj.value,children:s.formatNumber(r,{style:"unit",unit:"hectare",unitDisplay:"narrow"})})]}):null,(null==d?void 0:d.length)>0?(0,y.jsxs)("div",{className:dj.productTypes,children:[(0,y.jsxs)("span",{className:dj.label,children:[(0,y.jsx)(v.FormattedMessage,{id:"farmer-productTypes",defaultMessage:"Products"})," ","(",d.length,")"]}),(0,y.jsx)("span",{className:dj.value,children:d.join(", ")})]}):null]})})})]})})},dx={section:"farmers_section__qqbpx",containerWrapper:"farmers_containerWrapper__qqbpx",container:"farmers_container__qqbpx",farmersDesktopCarousel:"farmers_farmersDesktopCarousel__qqbpx",farmersSlide:"farmers_farmersSlide__qqbpx",farmersSlideInner:"farmers_farmersSlideInner__qqbpx",farmersMobileRow:"farmers_farmersMobileRow__qqbpx",farmers:"farmers_farmers__qqbpx",controls:"farmers_controls__qqbpx",heading:"farmers_heading__qqbpx",counter:"farmers_counter__qqbpx",actions:"farmers_actions__qqbpx",paginationIcon:"farmers_paginationIcon__qqbpx",iconPageNext:"farmers_iconPageNext__qqbpx",iconPagePrev:"farmers_iconPagePrev__qqbpx"};function dS(e){return(dS="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)}function dO(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 dk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dO(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=dS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=dS(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==dS(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let dC=function(e){var t=e.farmers,n=(0,c.useRef)(null),r={refCarousel:n,numFarmers:t.length,numPages:t.length/4-1},o=[[]];return t.forEach(function(e,t){var n=o[o.length-1];n.length>=4&&(o.push([]),n=o[o.length-1]),n.push((0,c.createElement)(dw,dk(dk({},e),{},{key:t})))}),(0,y.jsx)(ea,{styles:dx,owner:"Farmers",children:(0,y.jsx)("section",{className:dx.section,children:(0,y.jsx)("div",{className:dx.containerWrapper,children:(0,y.jsx)("div",{className:"container ".concat(dx.container),children:(0,y.jsxs)(ea,{styles:dx,owner:"Farmers",children:[(0,y.jsxs)(j.Row,{className:dx.controls,children:[(0,y.jsx)(j.Col,{children:(0,y.jsxs)("h2",{className:dx.heading,children:[(0,y.jsx)(v.FormattedMessage,{id:"farmers-heading",defaultMessage:"Featured Farmers"}),(0,y.jsxs)("span",{className:dx.counter,children:["(",t.length,")"]})]})}),o.length>1?(0,y.jsxs)(j.Col,{className:dx.actions,children:[(0,y.jsx)("i",{className:"".concat(dx.paginationIcon," ").concat(dx.iconPagePrev),onClick:function(){return function(e){e.refCarousel.current.prev()}(r)}}),(0,y.jsx)("i",{className:"".concat(dx.paginationIcon," ").concat(dx.iconPageNext),onClick:function(){return function(e){e.refCarousel.current.next()}(r)}})]}):null]}),(0,y.jsx)(j.Row,{className:dx.farmersDesktopCarousel,children:(0,y.jsx)(j.Carousel,{dots:!1,ref:n,children:o.map(function(e,t){return(0,y.jsx)("div",{className:dx.farmersSlide,children:(0,y.jsx)("div",{className:dx.farmersSlideInner,children:e})},t)})})}),(0,y.jsx)(j.Row,{className:"".concat(dx.farmers," ").concat(dx.farmersMobileRow),children:t.map(function(e,t){return(0,c.createElement)(dw,dk(dk({},e),{},{key:t}))})})]})})})})})};function dM(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 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})(e)}let dI=function(e){var t,n,r,o=e.products,i=e.claims,a=e.claimsSectionTitle,l=e.currentProduct,s=e.customCertifications,u=e.customCertificationsSectionTitle,d=e.origins,f=e.events,m=e.ingredientDescriptions,p=e.nutritionFacts,h=e.recipes,g=e.attachments,b=e.featuredFarmers,j=e.featuredOrganizations,w=e.featuredStories,x=e.featuredStoriesSectionTitle,S=e.facilities,O=e.currentOrganization,k=e.organizations,C=e.seoOptions,M=e.mapOptions,P=e.loading,I=e.dynamicFieldsUpdating,N=e.blockchainFetching,T=e.blockchainType,L=e.blockchainStatus,E=e.hide,z=void 0===E?[]:E,A=e.brandingLogo,F=void 0===A?null:A,D=e.brandingLogoMobile,B=void 0===D?null:D,W=e.brandingLogoWidth,R=e.brandingLogoHeight,U=e.brandingLogoLink,H=void 0===U?null:U,q=e.verboseIngredientReadMore,G=e.buyActionLink,V=void 0===G?null:G,Z=e.buyActionLabel,Y=e.availableLanguages,J=e.privacyLinkDisabled,$=e.termsLinkDisabled,Q=e.partnerLogo;lV();var K=(0,c.useMemo)(function(){try{return o&&l&&Object.keys(o).includes(l)?o[l]:null}catch(e){return null}},[o,l]),X=(0,c.useMemo)(function(){try{return k&&O&&Object.keys(k).includes(O)?k[O]:null}catch(e){return null}},[k,O]),ee=!(!f||!Object.keys(f).length),et=!(null==d||!d.length),en=!ee&&!et,er=!(!j&&!w),eo=!(K||!X),ei="string"==typeof V&&0===V.indexOf("https://")&&V.length>=9,el=z.indexOf("share")>=0,es=z.indexOf("social")>=0,ec=z.indexOf("logo")>=0,eu=z.indexOf("media")>=0,ed=z.indexOf("mainOrganizationDetail")>=0,ef=z.indexOf("infos")>=0,em=z.indexOf("story")>=0,ep=z.indexOf("certifications")>=0,ey=z.indexOf("ingredients")>=0,eh=z.indexOf("customCertifications")>=0,ev=z.indexOf("recipes")>=0,eg=(z.indexOf("feedback"),z.indexOf("facilityName")>=0),eb=z.indexOf("journeySummary")>=0,ej=z.indexOf("partnerLogo")>=0,e_=z.indexOf("poweredBy")>=0,ew=0===(null==K||null===(t=K.media)||void 0===t?void 0:t.length),ex=!!(eo&&w||!eo),eS=(0,c.useMemo)(function(){return _.loaded&&_.eventTypes&&"object"===dP(_.eventTypes)&&"object"===dP(f)&&f?Object.keys(f).map(function(e){return _&&"object"===dP(_)&&_.eventTypes&&"object"===dP(_.eventTypes)&&"function"==typeof _.eventTypes.iconClassDefinition?_.eventTypes.iconClassDefinition(f[e]):(console.error("failed to read enum.eventTypes"),sH().notifyError({context:{name:"Event icon class definition",cause:"failed to read enum.eventTypes"},error:"StoryBird enums not populated when they should be."}),"")}).join(""):""},[f,_.eventTypes]),eO=(0,c.useMemo)(function(){return sR({products:o,organizations:k,facilities:S,events:f,ingredientDescriptions:m,enums:_})},[o,k,S,f,m]);return P||N?(0,y.jsx)(nj,{loaderMessage:N?(0,y.jsx)(v.FormattedMessage,{id:"loader-waiting-for-blockchain",defaultMessage:"Waiting for blockchain data"}):null}):X||K?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(tx(),{children:eO.map(function(e,t){return(0,y.jsx)("link",{rel:"prefetch",href:e},t)})}),(0,y.jsx)(tS.NextSeo,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dM(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==dP(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({title:null!==(n=null!==(r=null==K?void 0:K.name)&&void 0!==r?r:null==X?void 0:X.name)&&void 0!==n?n:"StoryBird"},C)),(0,y.jsx)(dv,{organization:X,isCommercial:er,hideShareButton:el,hideLogo:ec,hideMedia:eu||ew,brandingLogo:F,brandingLogoMobile:B,brandingLogoWidth:void 0===W?null:W,brandingLogoHeight:void 0===R?null:R,brandingLogoLink:H}),(0,y.jsx)("style",{scoped:!0,children:eS}),(0,y.jsx)(ea,{owner:"StoryBird",children:(0,y.jsxs)("div",{className:"main",children:[eo?(0,y.jsx)(dt,{organization:X,isCommercial:er,organizations:k,featuredStories:w,featuredOrganizations:j,featuredStoriesSectionTitle:x,attachments:g,facilities:S,hideMedia:eu,hideInfos:ef,hideCertifications:ep,brandingLogo:F,brandingLogoMobile:B,brandingLogoLink:H}):(0,y.jsx)(ur,{product:K,customCertifications:s,customCertificationsSectionTitle:u,storyClaims:i,claimsSectionTitle:a,organization:X,facilities:S,events:f,organizations:k,products:o,recipes:h,nutritionFacts:p,ingredientDescriptions:m,isBasic:en,hideMedia:eu,hideMainOrganizationDetail:ed,hideInfos:ef,hideCertifications:ep,hideCustomCertifications:eh,hideIngredients:ey,hideRecipes:ev,hidePartnerLogo:ej,hidePoweredBy:e_,verboseIngredientReadMore:void 0!==q&&q,partnerLogo:void 0===Q?null:Q}),!en&&!er&&(0,y.jsx)(s6,{customCertifications:s,origins:d,facilities:S,organizations:k,products:o,events:f,ingredientDescriptions:m,nutritionFacts:p,recipes:h,hideFacilityName:eg,hideJourneySummary:eb,blockchainType:void 0===T?null:T,blockchainStatus:void 0===L?null:L,mapOptions:M,dynamicFieldsUpdating:I,claims:i}),b?(0,y.jsx)(dC,{farmers:b}):null,em?null:(0,y.jsx)(db,{story:null==K?void 0:K.story}),null,ex?(0,y.jsx)("div",{style:{paddingBottom:"64px",backgroundColor:"#f9f9f9"}}):null,es?null:(0,y.jsx)(da,{organization:X}),ei?(0,y.jsx)(eJ,{buyActionLink:V,buyActionLabel:void 0===Z?null:Z}):null]})}),(0,y.jsx)(tm,{withBuyAction:ei,availableLanguages:void 0===Y?[]:Y,privacyLinkDisabled:void 0!==J&&J,termsLinkDisabled:void 0!==$&&$}),en&&(0,y.jsx)(iW,{customCertifications:s,organizations:k,facilities:S,ingredientDescriptions:m,nutritionFacts:p,recipes:h,notDesktopEmbed:!0,storyClaims:i})]}):(0,y.jsx)(tq,{statusCode:404})},dN=function(e){var t=e.facilities,n=e.organizations,r=e.products;return(0,c.useMemo)(function(){return sR({facilities:t,organizations:n,products:r})},[t,n,r]).map(function(e,t){return(0,y.jsx)("link",{rel:"prefetch",href:e},t)})};var dT=(0,c.createContext)({});function dL(e){var t=e.items,n=e.viewItems,r=e.children,o=(0,c.useMemo)(function(){return{items:t,viewItems:n}},[t,n]);return(0,y.jsx)(dT.Provider,{value:o,children:r})}var dE=function(){return(0,c.useContext)(dT)},dz=(0,c.createContext)({});function dA(e){var t=e.organizations,n=e.children;return(0,y.jsx)(dz.Provider,{value:t,children:n})}var dF=function(){return(0,c.useContext)(dz)},dD=(0,c.createContext)({});function dB(e){var t=e.facilities,n=e.children;return(0,y.jsx)(dD.Provider,{value:t,children:n})}var dW=function(){return(0,c.useContext)(dD)},dR=(0,c.createContext)({});function dU(e){var t=e.products,n=e.children;return(0,y.jsx)(dR.Provider,{value:t,children:n})}var dH,dq,dG,dV,dZ,dY,dJ,d$,dQ,dK,dX,d0,d1,d2,d5=function(){return(0,c.useContext)(dR)};function d8(e){return(d8="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)}function d4(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d3(e,void 0);var n=({}).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)?d3(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function d3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d6(e,t,n){var r;return(r=function(e,t){if("object"!=d8(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=d8(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==d8(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}for(var d9={banner:"banner",certifications:"certifications",values:"values",gallery:"gallery",logo:"logo",mainOrganization:"mainOrganization",mainProduct:"mainProduct",map:"map",organizationAffiliates:"organizationAffiliates",organizationFarmers:"organizationFarmers",organizationMembers:"organizationMembers",organizationParents:"organizationParents",organizationProducts:"organizationProducts",organizationStories:"organizationStories",productAnnualProduction:"productAnnualProduction",productAvailability:"productAvailability",productOrganization:"productOrganization",productPrice:"productPrice",productProductionPeriods:"productProductionPeriods",productRelatedProducts:"productRelatedProducts",productSpecSheets:"productSpecSheets",productStorageType:"productStorageType",productSupplyChainRoles:"productSupplyChainRoles",productOrganizationParents:"productOrganizationParents",snapshot:"snapshot",socialLink:"socialLink",story:"story"},d7=(d6(d6(d6(d6(d6(d6(d6(d6(d6(d6(d2={},d9.banner,{}),d9.certifications,{}),d9.gallery,{}),d9.logo,{}),d9.map,{}),d9.mainOrganization,{consuming:[d9.banner,d9.logo,d9.certifications,d9.values],children:[d9.certifications,d9.values]}),d9.mainProduct,{consuming:[d9.gallery,d9.logo,d9.certifications,d9.values,d9.productOrganization,d9.productStorageType,d9.productAvailability,d9.productPrice,d9.productAnnualProduction,d9.productProductionPeriods,d9.productSpecSheets,d9.productSupplyChainRoles,d9.productOrganizationParents],children:[d9.certifications,d9.values]}),d9.organizationAffiliates,{consuming:[d9.organizationFarmers,d9.organizationMembers]}),d9.organizationParents,{}),d9.organizationProducts,{}),d6(d6(d6(d6(d6(d6(d6(d6(d6(d6(d2,d9.organizationFarmers,{}),d9.organizationMembers,{}),d9.organizationStories,{}),d9.productAnnualProduction,{}),d9.map,{}),d9.productOrganization,{}),d9.productPrice,{}),d9.productAvailability,{}),d9.productProductionPeriods,{}),d9.productSpecSheets,{}),d6(d6(d6(d6(d6(d6(d6(d6(d2,d9.productSupplyChainRoles,{}),d9.productOrganizationParents,{}),d9.productRelatedProducts,{}),d9.socialLink,{}),d9.productStorageType,{}),d9.values,{}),d9.story,{}),d9.snapshot,{})),fe=0,ft=Object.keys(d9);fe<ft.length;fe++){var fn=ft[fe];if(void 0!==d7[fn]){Array.isArray(d7[fn].consuming)?d7[fn].consuming.push(fn):d7[fn].consuming=[fn],Array.isArray(d7[fn].children)||(d7[fn].children=[]);var fr,fo=d4(d7[fn].children);try{for(fo.s();!(fr=fo.n()).done;){var fi=fr.value;void 0!==fi&&fi||console.error("view::item::config: bad child for ".concat(fn))}}catch(e){fo.e(e)}finally{fo.f()}var fa,fl=d4(d7[fn].consuming);try{for(fl.s();!(fa=fl.n()).done;){var fs=fa.value;void 0!==fs&&fs||console.error("view::item::config: bad consume for ".concat(fn))}}catch(e){fl.e(e)}finally{fl.f()}}else console.warn("view::item::types no config for ".concat(fn))}function fc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fd(e,void 0);var n=({}).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)?fd(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function fd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ff(e){return(ff="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)}function fm(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.items,n=e.viewItems;if(!Array.isArray(t)||!n||!Array.isArray(Object.keys(n)))return null;var r,o=fu(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(void 0===n[i]||!n[i])return console.warn("view::item::getMain viewItems does not contain requested itemId",{itemId:i,items:t}),null;if("string"==typeof n[i].type&&n[i].type.startsWith("main"))return n[i]}}catch(e){o.e(e)}finally{o.f()}return null}function fp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type,n=e.items,r=e.viewItems;if(!(Array.isArray(n)&&r&&Array.isArray(Object.keys(r))&&"string"==typeof t&&t.length))return null;var o,i=fu(n);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(void 0===r[a]||!r[a])return console.warn("view::item::getData viewItems does not contain requested itemId",{itemId:a,items:n}),null;if(r[a].type===t)return r[a]}}catch(e){i.e(e)}finally{i.f()}return null}var fy=[d9.mainOrganization,d9.mainProduct,d9.gallery,d9.banner,d9.logo,d9.certifications,d9.values,d9.organizationProducts,d9.organizationAffiliates,d9.organizationFarmers,d9.organizationParents,d9.organizationStories,d9.productOrganization,d9.productStorageType,d9.productPrice,d9.productAvailability,d9.productAnnualProduction,d9.productProductionPeriods,d9.productSpecSheets,d9.productSupplyChainRoles,d9.productOrganizationParents,d9.story,d9.map,d9.productRelatedProducts,d9.socialLink],fh=[d9.mainOrganization,d9.mainProduct,d9.gallery,d9.banner,d9.logo,d9.certifications,d9.values,d9.organizationProducts,d9.organizationAffiliates,d9.map,d9.organizationFarmers,d9.organizationParents,d9.organizationStories,d9.productOrganization,d9.productStorageType,d9.productPrice,d9.productAvailability,d9.productAnnualProduction,d9.productProductionPeriods,d9.productSpecSheets,d9.productSupplyChainRoles,d9.productOrganizationParents,d9.productRelatedProducts,d9.story,d9.socialLink];let fv=function(e){return e.item,null},fg={banner:"banner_banner__d46n6",mobile:"banner_mobile__d46n6",imageGradient:"banner_imageGradient__d46n6",shareContainer:"banner_shareContainer__d46n6",shareButton:"banner_shareButton__d46n6",shareIcon:"banner_shareIcon__d46n6",nameButtonContainer:"banner_nameButtonContainer__d46n6",name:"banner_name__d46n6",hiddenButton:"banner_hiddenButton__d46n6",playVideoWrapper:"banner_playVideoWrapper__d46n6"};function fb(e){return(fb="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)}function fj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f_(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 fw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f_(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=fb(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fb(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fb(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let fx=function(e){var t=e.media,n=e.name,r=e.organization,o=e.product,i=e.hideMedia,a=(0,S.useRouter)(),l=(0,c.useMemo)(function(){return t.filter(function(e){return e.mediaType===m.mediaTypes.video})},[t]),s=(0,c.useMemo)(function(){return i2({itemType:iZ.organization,media:l.length===t.length?[]:t,options:{width:1400}})},[t,l]),u=(0,c.useMemo)(function(){var e={backgroundImage:"linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 53.59%, rgba(0, 0, 0, 0.35) 100%),url(".concat(s,")")};return function(e){try{return new URL(e).searchParams.get("rect")}catch(e){return!1}}(s)||(e.backgroundPosition="center"),e},[s]),d=(0,c.useMemo)(function(){return r?"organization":o?"product":"banner"},[r,o]),p=(0,c.useMemo)(function(){return r?"fromOrganizationSection":o?"fromProductSection":"fromBannerSection"},[r,o]),h=(0,c.useMemo)(function(){return r?"orgSectionBtn":o?"productSectionBtn":"bannerSectionBtn"},[r,o]),v=(0,c.useCallback)(function(){var e,t,n=a.pathname,r=a.query;a.push({pathname:n,query:fw(fw({},r),{},{params:[].concat(function(e){if(Array.isArray(e))return fj(e)}(t=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return fj(e,void 0);var n=({}).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)?fj(e,void 0):void 0}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["media-".concat(d)])}),hash:window.location.hash},void 0,{shallow:!0})},[a,d]),g=Array.isArray(t)&&t.length>1&&!(void 0!==i&&i)||l.length>0;return(0,y.jsx)(y.Fragment,{children:(0,y.jsx)("section",{className:"".concat(fg.banner," ").concat(sS.isMobileOnly?fg.mobile:""),style:u,children:(0,y.jsxs)("div",{className:fg.imageGradient,children:[l.length>0?(0,y.jsx)("div",{className:fg.playVideoWrapper,children:(0,y.jsx)(f(),{alt:"Play video icon",src:"/images/common/icons/play-btn-orange--circle-white.svg",height:114,width:114,onClick:v})}):null,(0,y.jsx)("div",{className:fg.shareContainer,children:(0,y.jsx)(dm,{className:fg.shareButton,shareIconClassName:fg.shareIcon,organization:r,product:o})}),(0,y.jsxs)("div",{className:"".concat(fg.nameButtonContainer," ").concat(l.length?fg.hiddenButton:""),children:["string"==typeof n&&(0,y.jsx)("div",{className:fg.name,children:n}),g&&(0,y.jsx)(nV,{slug:d,index:0,mediaItemClass:p,mediaSectionBtn:h,mediaType:l.length?"video":"image",carouselCount:l.length>0?l.length:t.length,embedded:!1,embeddedFull:!1,videoOverlay:!1,isButtonWrapper:!0,modalContent:(0,y.jsx)(n9,{className:fg.mediaCarousel,mediaCarouselClass:"fromMediaItems",slideClass:"fromMediaItems",dotsTypeStyle__mobile:"",media:l.length?l:t,type:"fullscreen",slug:d,current:0,videoAsOverlay:!1,fromMediaItems:!0,embedded:!1,embeddedFull:!1})})]})]})})})};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})(e)}function fO(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}let fk=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainOrganization})},[r,o]),s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainProduct})},[r,o]),u=(0,c.useMemo)(function(){return i&&null!=l&&l.organization?i[l.organization]||(console.warn("ItemDataBanner: no main organization"),null):null},[i,l]),d=(0,c.useMemo)(function(){return a&&null!=s&&s.product?a[s.product]||(console.warn("ItemDataBanner: no main product"),null):null},[a,s]),f=(0,c.useMemo)(function(){return"string"==typeof(null==u?void 0:u.name)?u.name:"string"==typeof(null==d?void 0:d.name)?d.name:null},[u,d]),m=(0,c.useMemo)(function(){var e;return{media:null!==(e=null==t?void 0:t.media)&&void 0!==e?e:[],product:d,organization:u,name:f}},[t,d,u,f]);return m?(0,y.jsx)(fx,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fO(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fS(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},m)):null};function fC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let fM=function(e){var t=e.certifications,n=e.certificationsSorted,r=Array.isArray(t)&&t.length,o=(0,c.useMemo)(function(){var e={};if(!Array.isArray(t))return e;var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fC(e,void 0);var n=({}).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)?fC(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;e[o]={certifications:[o]}}}catch(e){r.e(e)}finally{r.f()}return e},[t]);return r?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s9,{organizations:o}),(0,y.jsx)(nv,{certifications:t,certificationsSorted:n,clickEnabled:!0,minimumCertificationsShown:10})]}):null};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})(e)}function fI(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}let fN=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=(0,c.useMemo)(function(){return function(e){var t=e.products,n=e.organizations,r=e.item,o=e.items,i=e.viewItems;if(Array.isArray(null==r?void 0:r.certifications)&&r.certifications.length)return r.certifications;var a=fp({items:o,viewItems:i,type:d9.mainOrganization}),l=fp({items:o,viewItems:i,type:d9.mainProduct}),s=(null==a?void 0:a.organization)||(null==l?void 0:l.product);if(!s)return[];var c=a?n[s]:t[s];return c&&Array.isArray(c.certifications)&&c.certifications.length?c.certifications:[]}({item:t,items:r,viewItems:o,organizations:i,products:a})},[t,r,o,i,a]),s=(0,c.useMemo)(function(){return Array.isArray(l)&&l.length?{certifications:l}:null},[l]);return s?(0,y.jsx)(fM,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fP(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},s)):null},fT=function(e){var t=e.values,n=e.valuesSorted;return Array.isArray(t)&&t.length?(0,y.jsx)("div",{className:"values_container__g1aqd",children:(0,y.jsx)(ic,{values:t,valuesSorted:n})}):null};function fL(e){return(fL="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)}function fE(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}let fz=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=(0,c.useMemo)(function(){return function(e){var t=e.products,n=e.organizations,r=e.item,o=e.items,i=e.viewItems;if(Array.isArray(null==r?void 0:r.values)&&r.values.length)return r.values;var a=fp({items:o,viewItems:i,type:d9.mainOrganization}),l=fp({items:o,viewItems:i,type:d9.mainProduct}),s=(null==a?void 0:a.organization)||(null==l?void 0:l.product);if(!s)return[];var c=a?n[s]:t[s];return c&&Array.isArray(c.values)&&c.values.length?c.values:[]}({item:t,items:r,viewItems:o,organizations:i,products:a})},[t,r,o,i,a]),s=(0,c.useMemo)(function(){return Array.isArray(l)&&l.length?{values:l}:null},[l]);return s?(0,y.jsx)(fT,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fE(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=fL(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fL(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fL(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},s)):null},fA={container:"gallery_container__rrqgc",containerWrapper:"gallery_containerWrapper__rrqgc",containerGrid:"gallery_containerGrid__rrqgc",galleryItem:"gallery_galleryItem__rrqgc","galleryItem-1":"gallery_galleryItem-1__rrqgc","galleryItem-2":"gallery_galleryItem-2__rrqgc","galleryItem-3":"gallery_galleryItem-3__rrqgc","rowCount-2":"gallery_rowCount-2__rrqgc",galleryMax:"gallery_galleryMax__rrqgc",overlay:"gallery_overlay__rrqgc",rollover:"gallery_rollover__rrqgc",fadein:"gallery_fadein__rrqgc",circle:"gallery_circle__rrqgc",galleryItemBg:"gallery_galleryItemBg__rrqgc",galleryLightbox:"gallery_galleryLightbox__rrqgc",seeAllButton:"gallery_seeAllButton__rrqgc",mediaIcon:"gallery_mediaIcon__rrqgc",containerInner:"gallery_containerInner__rrqgc",hiddenButton:"gallery_hiddenButton__rrqgc"};function fF(e){return(fF="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)}function fD(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 fB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fD(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=fF(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fF(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fW(e,t){if(e){if("string"==typeof e)return fR(e,t);var n=({}).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)?fR(e,t):void 0}}function fR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var fU="gallery";let fH=function(e){var t,n=e.isOrganizationView,r=e.media,o=(0,S.useRouter)(),i=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(0))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||fW(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],s=(0,c.useCallback)(function(e){l(e);var t,n,r=o.pathname,i=o.query;o.push({pathname:r,query:fB(fB({},i),{},{params:[].concat(function(e){if(Array.isArray(e))return fR(e)}(t=null!==(n=null==i?void 0:i.params)&&void 0!==n?n:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||fW(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),["media-".concat(fU)])}),hash:window.location.hash},void 0,{shallow:!0})},[o]),u=(0,c.useMemo)(function(){var e=r.length;return r.filter(function(e){return e.mediaType===m.mediaTypes.image}).slice(0,3).map(function(t,n){var r,o=fA.galleryItem;return o+=" ".concat(fA["galleryItem-"+(n+1)])+" ".concat(e>=5?fA.galleryMax:null!==(r=fA["rowCount-"+e])&&void 0!==r?r:""),(0,y.jsxs)("div",{onClick:function(){return s(n)},className:o,children:[(0,y.jsx)("div",{className:fA.overlay}),(0,y.jsx)("div",{className:fA.rollover,children:(0,y.jsx)("div",{className:fA.circle})}),(0,y.jsx)(f(),{alt:"Gallery item",className:fA.galleryItemBg,src:t.url,priority:!1,fill:!0,layout:"fill",style:{objectFit:"cover"},sizes:"(max-width: 768px) 99vw, 100vw"})]},n)})},[r]);return Array.isArray(r)&&r.length?(0,y.jsx)("section",{className:fA.container,children:n?(0,y.jsxs)("div",{className:fA.containerWrapper,children:[(0,y.jsx)("div",{className:fA.containerGrid,children:u}),r&&r.length>0&&(0,y.jsx)("div",{className:fA.galleryLightbox,children:(0,y.jsxs)(j.Button,{className:fA.seeAllButton,onClick:function(){return s(0)},children:[(0,y.jsx)("i",{className:fA.mediaIcon}),(0,y.jsx)(v.FormattedMessage,{id:"gallery-see_all-button-text",defaultMessage:"See all"}),(0,y.jsxs)("span",{style:{marginLeft:"5px"},children:["(",r.length,")"]})]})}),(0,y.jsx)("div",{className:fA.hiddenButton,children:(0,y.jsx)(nV,{slug:fU,index:0,mediaItemClass:"fromOrganizationSection",mediaSectionBtn:"orgSectionBtn",mediaType:"image",carouselCount:r.length,embedded:!1,embeddedFull:!1,videoOverlay:!1,isButtonWrapper:!0,modalContent:(0,y.jsx)(n9,{current:a,mediaCarouselClass:"fromMediaItems",slideClass:"fromMediaItems",dotsTypeStyle__mobile:"",type:"fullscreen",media:r,videoAsOverlay:!1,fromMediaItems:!0,slug:fU})})})]}):(0,y.jsx)("div",{className:fA.containerInner,children:(0,y.jsx)(n9,{mediaCarouselClass:"fromProductSection",dotsTypeStyle__mobile:"rounded",media:r,videoAsOverlay:!1,clickOpensFullscreenCarousel:!0,slug:fU})})}):null};function fq(e){return(fq="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)}function fG(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}let fV=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainOrganization})},[r,o]),a=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.media)&&t.media.length?{isOrganizationView:!!i,media:t.media}:null},[null==t?void 0:t.media,i]);return a?(0,y.jsx)(fH,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fG(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=fq(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fq(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fq(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},a)):null};var fZ=function(e){var t,n,r,o,i,a=e.media,l=e.options;return Array.isArray(a)&&a[0]?o=null===(i=a[0])||void 0===i?void 0:i.url:Array.isArray(a)||(o=null==a?void 0:a.url),o?(t=o,n=void 0===l?{size:400}:l,(r=new URL(t)).searchParams.delete("auto"),r.searchParams.get("w")||(r.searchParams.set("width",n.size),r.searchParams.set("height",n.size)),r.toString()):"/images/common/default-thumbnail.png"};let fY=function(e){var t=e.media,n=e.name,r=(0,c.useMemo)(function(){return fZ({media:t})},[t]),o=(0,c.useMemo)(function(){return n+" Logo"},[n]);return(0,y.jsx)("div",{className:"logo_logo__pxq5y",children:(0,y.jsx)(j.Avatar,{src:r,shape:"round",alt:o})})};function fJ(e){return(fJ="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)}function f$(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}let fQ=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainOrganization})},[r,o]),s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainProduct})},[r,o]),u=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.organizationParents})},[r,o]),d=(0,c.useMemo)(function(){return i&&null!=l&&l.organization?i[l.organization]||(console.warn("ItemDataLogo: no main organization"),null):null},[i,l]),f=(0,c.useMemo)(function(){return a&&null!=s&&s.product?a[s.product]||(console.warn("ItemDataLogo: no main product"),null):null},[a,s]),m=(0,c.useMemo)(function(){if(u&&Array.isArray(u.parents)&&u.parents.length>0){var e=i[u.parents[0]];return null==e?void 0:e.logo}return null},[i,u]),p=(0,c.useMemo)(function(){return"string"==typeof(null==d?void 0:d.name)?d.name:"string"==typeof(null==f?void 0:f.name)?f.name:null},[d,f]),h=(0,c.useMemo)(function(){var e;return{media:null!==(e=null==t?void 0:t.media)&&void 0!==e?e:m,name:p}},[null==t?void 0:t.media,p,m]);return h?(0,y.jsx)(fY,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f$(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=fJ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=fJ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==fJ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},h)):null},fK=function(e){var t=e.organization,n=void 0===t?null:t,r=e.product,o=void 0===r?null:r,i=tF(),a=(0,c.useCallback)(function(){var e,t=null!==(e=null==o?void 0:o.name)&&void 0!==e?e:null==n?void 0:n.name,r=null!=o&&o.name?"Product":"Organization";eU("trade_facilitation_inquiry_click",t?{category:"Engagement",label:"".concat(r," profile: ").concat(t)}:{}),"function"==typeof(null==i?void 0:i.handle)&&i.handle({organization:n,product:o})},[n,o,i]);return(0,y.jsxs)("button",{className:"wholesaleInquiryButton_button__hjpsm",onClick:a,id:"requestTradeFacilitation",children:[(0,y.jsx)("i",{className:"wholesaleInquiryButton_icon__hjpsm"}),(0,y.jsx)(v.FormattedMessage,{id:"component-wholesale_inquiry-button-text",defaultMessage:"Wholesale Inquiry"})]})};function fX(e){return"string"==typeof e?[e.trim()]:Array.isArray(e)&&Array.isArray(e)?e.reduce(function(e,t){return"string"==typeof t&&t.trim().length>0&&e.push(t.trim()),e},[]):[]}let f0="mainOrganization_goldDotSeparator__6uqt4";function f1(e){return(f1="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)}function f2(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 f5(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=f1(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=f1(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==f1(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let f8=function(e){var t=e.organization,n=e.mainFacility,r=e.banner,o=e.logo,i=e.certifications,a=e.values,l=e.parentOrganizations,s=e.hideLocationText,u=e.hideInfos,d=e.hideCertifications,f=e.hideValues,m=t.description,p=t.story,h=t.missionStatement,g=t.numberMembers,b=t.organizationType,_=t.yearEstablished,w=(0,v.useIntl)().locale,x=(0,c.useMemo)(function(){return"string"==typeof b},[b]),S=(0,c.useMemo)(function(){return Array.isArray(l)&&l.length>0?(0,y.jsxs)("p",{className:"mainOrganization_memberOfWrapper__6uqt4",children:[(0,y.jsx)("span",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-organization-member-of",defaultMessage:"Member of"})}),(0,y.jsx)("span",{className:"mainOrganization_namesWrapper__6uqt4",children:l.map(function(e,t){var n=e.name,r=e.link;return(0,y.jsxs)("span",{children:[(0,y.jsx)(ou,{locale:w,to:r,target:"_blank",children:n}),t+1<l.length?(0,y.jsx)("span",{children:", "}):null]},t)})})]}):null},[l,w]),O=(0,c.useMemo)(function(){return fX(h)},[h]),k=(0,c.useMemo)(function(){return!("string"!=typeof h||!h.trim().length)||!(!Array.isArray(h)||!h.length)},[h]),C=(0,c.useMemo)(function(){var e,t,n=fX(p);return null!==(e=n)&&void 0!==e&&e.length||null!==(t=n=fX(m))&&void 0!==t&&t.length?n:null},[m,p]),M=av(t),P=!isNaN(_)&&Number(_)>0,I=!(void 0!==d&&d)&&i,N=!(void 0!==f&&f)&&a,T=!(void 0!==u&&u)&&(I||N);return(0,y.jsxs)(y.Fragment,{children:[r,(0,y.jsx)("section",{className:"mainOrganization_organizationDetails__6uqt4",children:(0,y.jsxs)(j.Row,{className:"mainOrganization_detailsContainer__6uqt4",children:[(0,y.jsx)(j.Col,{xs:24,md:7,lg:5,className:"mainOrganization_logoWrapper__6uqt4",children:o}),(0,y.jsxs)(j.Col,{xs:24,md:17,lg:13,className:"".concat("mainOrganization_metadataWrapper__6uqt4"," ").concat(S?"mainOrganization_extraPadding__6uqt4":""),children:[(0,y.jsx)("h1",{className:"mainOrganization_organizationNameMobile__6uqt4",children:t.name}),!(void 0!==s&&s)&&null!=n&&n.location?(0,y.jsxs)(j.Row,{className:"mainOrganization_locationWrapper__6uqt4",children:[n.location.countryCode?(0,y.jsx)("span",{className:"mainOrganization_countryFlag__6uqt4",children:(0,y.jsx)(o0(),{countryCode:n.location.countryCode,svg:!0})}):null,(0,y.jsx)("span",{className:"mainOrganization_locationText__6uqt4",children:(0,y.jsx)(rm,f5(f5({},n.location),{},{hideCity:!0,hideFacilityName:!0,hideIcon:!0,enableStateMapping:!0,customClass:"orgSectionPlace"}))})]}):null,(0,y.jsxs)(j.Row,{className:"mainOrganization_typeAreaYearWrapper__6uqt4",children:[x?(0,y.jsx)(o4,{type:b,numberMembers:g}):null,M?(0,y.jsxs)(y.Fragment,{children:[x?(0,y.jsx)("span",{className:f0,children:"•"}):null,(0,y.jsx)(ag,{organization:t})]}):null,P?(0,y.jsxs)(y.Fragment,{children:[x||M?(0,y.jsx)("span",{className:f0,children:"•"}):null,(0,y.jsx)("span",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-organization-established",defaultMessage:"Established {yearEstablished}",values:{yearEstablished:_}})})]}):null]}),S]}),(0,y.jsx)(j.Col,{xs:24,md:17,lg:6,className:"mainOrganization_wholesaleContainer__6uqt4",children:(0,y.jsx)(fK,{organization:t})})]})}),(0,y.jsx)("section",{className:"mainOrganization_organizationBody__6uqt4",children:(0,y.jsxs)("div",{className:"".concat("mainOrganization_bodyContentContainer__6uqt4"," ").concat(T?"":"mainOrganization_fullContainer__6uqt4"),children:[(0,y.jsxs)("div",{className:"mainOrganization_bodyTextContainer__6uqt4",children:[null!==C&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h2",{className:"mainOrganization_storyTitle__6uqt4",children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-organization-our-story",defaultMessage:"Our Story"})}),(0,y.jsx)("div",{className:"mainOrganization_story__6uqt4",children:(0,y.jsx)(aq,{content:C,color:"golden",type:"link",name:"story section",maxCharLength:sS.isMobileOnly?400:800,buttonClassName:"mainOrganization_marketplace__6uqt4"})})]}),k&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h2",{className:"mainOrganization_missionStatementTitle__6uqt4",children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-organization-mission-statement",defaultMessage:"Mission Statement"})}),(0,y.jsx)("div",{className:"mainOrganization_missionStatement__6uqt4",children:(0,y.jsx)("q",{children:(0,y.jsx)("div",{className:"mainOrganization_missionStatementContent__6uqt4",children:(0,y.jsx)(oe,{content:O})})})})]})]}),T&&(0,y.jsxs)("div",{className:"mainOrganization_infos__6uqt4",children:[(0,y.jsx)(tY,{defaultOpenPanels:["certifications"],children:I&&(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:"mainOrganization_panelHeader__6uqt4",children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-organization-certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:i},"certifications")}),N&&a]})]})})]})};function f4(e){return(f4="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)}function f3(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 f6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f3(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=f4(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=f4(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==f4(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f3(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let f9={productContainer:"mainProduct_productContainer__2mtyz",content:"mainProduct_content__2mtyz",description:"mainProduct_description__2mtyz",shareWrapper:"mainProduct_shareWrapper__2mtyz",shareButton:"mainProduct_shareButton__2mtyz",productShareIcon:"mainProduct_productShareIcon__2mtyz",leftSidebar:"mainProduct_leftSidebar__2mtyz",rightSidebar:"mainProduct_rightSidebar__2mtyz",name:"mainProduct_name__2mtyz",wholesaleContainer:"mainProduct_wholesaleContainer__2mtyz",productDetails:"mainProduct_productDetails__2mtyz",infos:"mainProduct_infos__2mtyz",productDetailsContainer:"mainProduct_productDetailsContainer__2mtyz",col:"mainProduct_col__2mtyz",title:"mainProduct_title__2mtyz",marketplace:"mainProduct_marketplace__2mtyz"},f7=function(e){var t=e.product,n=e.certifications,r=e.values,o=e.gallery,i=e.productOrganization,a=e.productDetails,l=e.productOrganizationParents,s=(e.mainFacility,e.organization),u=e.products,d=e.hideMedia,f=e.hideInfos,m=e.hideCertifications,p=e.hideValues,h=t.name,g=t.description,b=(0,c.useMemo)(function(){return"string"==typeof g&&g.trim().length||Array.isArray(g)&&g.length?g:[]},[g]),_=(0,c.useMemo)(function(){return s?(0,y.jsx)(j.Col,{xs:24,md:3,className:f9.shareWrapper,children:(0,y.jsx)(dm,{className:f9.shareButton,shareIconClassName:f9.productShareIcon,organization:s})}):null},[s]),w=(0,c.useMemo)(function(){return(0,y.jsx)("div",{className:f9.description,children:(0,y.jsx)(aq,{content:b,color:"golden",type:"link",name:"product section",maxCharLength:sS.isMobileOnly?120:300,buttonClassName:f9.marketplace})})},[sS.isMobileOnly,b]),x=!!(!(void 0!==m&&m)&&n),S=!!(!(void 0!==p&&p)&&r),O=!!(!(void 0!==f&&f)&&(x||S)),k=!!a.length;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("section",{className:f9.productContainer,children:(0,y.jsxs)(j.Row,{align:"top",className:f9.content,children:[(0,y.jsxs)(j.Col,{xs:24,md:14,className:f9.leftSidebar,children:[_,!(void 0!==d&&d)&&o,w]}),(0,y.jsxs)(j.Col,{xs:24,md:10,className:f9.rightSidebar,children:[(0,y.jsxs)(j.Row,{align:"top",justify:"space-between",children:[(0,y.jsx)(j.Col,{xs:24,md:21,className:f9.name,children:(0,y.jsx)("h1",{children:h})}),_]}),(0,y.jsx)("div",{className:f9.wholesaleContainer,children:(0,y.jsx)(fK,{organization:s,product:t})}),w,i,O&&(0,y.jsxs)("div",{className:f9.infos,children:[(0,y.jsx)(tY,{defaultOpenPanels:["certifications"],children:x&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s9,{organizations:u}),(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:f9.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-product-certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:n},"certifications")]})}),S&&r]})]})]})}),k&&(0,y.jsx)("section",{className:f9.productDetails,children:(0,y.jsx)(j.Row,{className:f9.productDetailsContainer,children:(0,y.jsxs)(j.Col,{span:24,className:f9.col,children:[(0,y.jsx)("div",{className:f9.title,children:(0,y.jsx)("h4",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-main-product-details-heading",defaultMessage:"Product Details"})})}),a]})})}),l]})};var me={1:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.bags",defaultMessage:"Bags"}),2:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.bales",defaultMessage:"Bales"}),3:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.bottles",defaultMessage:"Bottles"}),4:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.boxes",defaultMessage:"Boxes"}),5:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.bushels",defaultMessage:"Bushels"}),6:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.cartons",defaultMessage:"Cartons"}),7:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.cases",defaultMessage:"Cases"}),8:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.gallons",defaultMessage:"Gallons"}),9:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.kilograms",defaultMessage:"Kilograms"}),10:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.liters",defaultMessage:"Liters"}),11:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.metric_tons",defaultMessage:"Metric tons (1000kg)"}),12:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.palettes",defaultMessage:"Palettes"}),13:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.pieces",defaultMessage:"Pieces"}),14:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.pounds",defaultMessage:"Pounds"}),15:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.metric_quintals",defaultMessage:"Quintals (100kg)"}),16:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.quintals",defaultMessage:"Quintals (100lb)"}),17:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.units",defaultMessage:"Units"}),18:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.meters",defaultMessage:"Meters"}),20:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.square_meters",defaultMessage:"Square meters"}),21:(0,y.jsx)(v.FormattedMessage,{id:"enums.units.cubic_meters",defaultMessage:"Cubic meters"})};let mt=function(e){var t=na(),n=(0,c.useMemo)(function(){if(null==t||!t.productionUnitTypes||null==e||!e.unit)return null;var n=t.productionUnitTypes.getByRefId(e.unit);return Object.keys(n)&&"string"==typeof n.name&&""!==n.name.trim()?n.name:e.unit},[null==t?void 0:t.productionUnitTypes,e]),r=(0,c.useMemo)(function(){var e;return null!==(e=me[n])&&void 0!==e?e:n},[n]);return e&&r?(0,y.jsxs)(j.Row,{className:"productAnnualProduction_wrapper__c4ug7",children:[(0,y.jsx)(j.Col,{xs:24,md:12,children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-annual-production-capacity",defaultMessage:"Annual Production Capacity:"})})}),(0,y.jsxs)(j.Col,{xs:24,md:12,children:[(0,y.jsx)(v.FormattedNumber,{value:null==e?void 0:e.low}),(0,y.jsx)("span",{className:"productAnnualProduction_center__c4ug7",children:"-"}),(0,y.jsx)(v.FormattedNumber,{value:null==e?void 0:e.high}),(0,y.jsx)("span",{className:"productAnnualProduction_space__c4ug7"}),r]})]}):null};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})(e)}function mr(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}let mo=function(e){var t=e.item,n=(0,c.useMemo)(function(){return void 0===(null==t?void 0:t.unit)||void 0===(null==t?void 0:t.high)||void 0===(null==t?void 0:t.low)||null===(null==t?void 0:t.unit)||null===(null==t?void 0:t.low)||null===(null==t?void 0:t.high)?null:{unit:t.unit,high:t.high,low:t.low}},[t]);return n?(0,y.jsx)(mt,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mn(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mn(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null},mi=function(e){var t=e.facility,n=e.organization,r=n.id,o=n.hyphenatedName,i=n.logo,a=(n.media,n.name),l=(n.story,(0,v.useIntl)().locale),s=(0,c.useMemo)(function(){return iY({hyphenatedName:o,id:r,itemType:iZ.organization})},[o,r]),u=(0,c.useMemo)(function(){return fZ({media:i})},[i]);return t||console.warn("ProductOrganizationCard: missing facility"),(0,y.jsxs)("div",{className:"productOrganizationCard_container__6c7zt",children:[(0,y.jsx)("div",{className:"productOrganizationCard_text__6c7zt",children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-organization-sold-by",defaultMessage:"Sold by"})}),(0,y.jsx)("div",{className:"productOrganizationCard_logo__6c7zt",children:(0,y.jsx)(ou,{locale:l,to:s,children:(0,y.jsx)(j.Avatar,{src:u,shape:"round",alt:a+" Logo"})})}),(0,y.jsx)("div",{className:"productOrganizationCard_name__6c7zt",children:a}),(0,y.jsx)("div",{className:"productOrganizationCard_location__6c7zt",children:(0,y.jsx)(ay,{facility:t})})]})},ma=function(e){var t=e.mainFacility,n=e.organization;return n?(0,y.jsx)("div",{className:"productOrganization_container__rfahd",children:(0,y.jsx)(mi,{facility:t,organization:n})}):null};function ml(e){return(ml="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)}function ms(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}let mc=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=dW(),s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainProduct})},[r,o]),u=(0,c.useMemo)(function(){return a&&null!=s&&s.product?a[s.product]||(console.warn("ItemDataProductOrganization: no main product"),null):null},[a,s]),d=(0,c.useMemo)(function(){if(!i)return null;if(null!=t&&t.organization&&(e=i[t.organization]),!e&&null!=u&&u.organization&&(e=i[u.organization]),!e)return console.warn("ItemDataProductOrganization: no organization"),null;if(!e.logo&&Array.isArray(e.parents)&&e.parents.length>0){var e,n=e.parents[0];e.logo=i[n].logo}return e},[i,t,u]),f=(0,c.useMemo)(function(){return d&&l?ie({facilities:l,organization:d}):null},[d,l]),m=(0,c.useMemo)(function(){return d?{mainFacility:f,organization:d}:null},[f,d]);return m?(0,y.jsx)(ma,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=ml(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ml(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ml(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},m)):null},mu=function(e){var t=e.min,n=e.max,r=e.currency,o=(0,c.useMemo)(function(){return void 0===t||void 0===n||void 0===r||null===t||null===n||null===r?null:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(v.FormattedNumber,{value:t}),(0,y.jsx)("span",{className:"productPrice_center__e5ba9",children:"-"}),(0,y.jsx)(v.FormattedNumber,{value:n}),(0,y.jsx)("span",{className:"productPrice_space__e5ba9"}),r]})},[t,n,r]);return o?(0,y.jsxs)(j.Row,{className:"productPrice_wrapper__e5ba9",children:[(0,y.jsx)(j.Col,{xs:24,md:12,children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-price",defaultMessage:"Product Price:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,children:o})]}):null};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})(e)}function mf(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}let mm=function(e){var t=e.item,n=(0,c.useMemo)(function(){return"string"!=typeof(null==t?void 0:t.min)||"string"!=typeof(null==t?void 0:t.max)||"string"!=typeof(null==t?void 0:t.currency)?null:{min:t.min,max:t.max,currency:t.currency,recommendedRetail:t.recommendedRetail}},[t]);return n?(0,y.jsx)(mu,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mf(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==md(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null};function mp(e){return(mp="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)}function my(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 mh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?my(Object(n),!0).forEach(function(t){mv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mv(e,t,n){var r;return(r=function(e,t){if("object"!=mp(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mp(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mp(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let mb=function(e){var t=e.productionPeriods,n=(0,v.useIntl)().locale,r=(0,c.useMemo)(function(){return function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",r=new Intl.DateTimeFormat(t,{month:n}).format;return((function(e){if(Array.isArray(e))return mg(e)})(e=Array(12).keys())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return mg(e,void 0);var n=({}).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)?mg(e,void 0):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(e){return r(new Date(Date.UTC((new Date).getFullYear(),(e+1)%12)))}).reduce(function(e,t,n){return mh(mh({},e),{},mv({},n+1,t))},{})}(n)},[n]),o=(0,c.useMemo)(function(){return null==t?void 0:t.map(function(e,t){return(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:r[e.start]}),(0,y.jsx)("span",{className:"productProductionPeriods_center__faw8e",children:"-"}),(0,y.jsx)("span",{children:r[e.end]})]},t)})},[r,t]);return(0,y.jsxs)(j.Row,{className:"productProductionPeriods_wrapper__faw8e",children:[(0,y.jsx)(j.Col,{xs:24,md:12,children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-production-time-periods",defaultMessage:"Harvest or Production Time Periods:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,children:o})]})};function mj(e){return(mj="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)}function m_(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}let mw=function(e){var t=e.item,n=(0,c.useMemo)(function(){return null!=t&&t.productionPeriods?{productionPeriods:t.productionPeriods}:null},[t]);return n?(0,y.jsx)(mb,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mj(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mj(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null},mx=function(e){var t=e.productSpecSheets,n=(0,c.useMemo)(function(){return t.map(function(e,t){var n,r,o;return(0,y.jsxs)(j.Row,{className:"productSpecSheets_specsheet__d2e3p",children:[(0,y.jsx)(j.Col,{xs:5,sm:4,md:6,className:"productSpecSheets_resource__d2e3p",children:(0,y.jsx)("a",{onClick:function(){return eU("select_product_specsheet_preview",{})},href:e.url,target:"_blank",rel:"noopener noreferrer",children:(n=e.caption,r=e.mediaType,o=e.url,"attachment"===r?(0,y.jsx)(rC.FilePdfOutlined,{className:"productSpecSheets_icon__d2e3p"}):(0,y.jsx)("div",{className:"productSpecSheets_imageWrapper__d2e3p",children:(0,y.jsx)(f(),{alt:n,fill:!0,layout:"fill",sizes:"(max-width: 768px) 99vw, 100vw",style:{objectFit:"contain"},src:o})}))})}),(0,y.jsx)(j.Col,{xs:19,sm:20,md:18,className:"productSpecSheets_description__d2e3p",children:(0,y.jsx)("div",{className:"productSpecSheets_caption__d2e3p",children:(0,y.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",children:e.caption&&e.caption})})})]},t)})},[t]);return t.length?(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{xs:24,md:12,className:"productSpecSheets_title__d2e3p",children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-product-spec-sheet",defaultMessage:"Product Specifications:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,className:"productSpecSheets_itemsWrapper__d2e3p",children:n})]}):null};function mS(e){return(mS="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)}function mO(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}let mk=function(e){var t=e.item,n=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.media)?{productSpecSheets:t.media}:null},[t]);return n?(0,y.jsx)(mx,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mO(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mS(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mS(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mS(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null},mC=function(e){var t=e.storageType,n=na(),r=(0,c.useMemo)(function(){if(null==n||!n.storageTypes||!t)return null;var e=n.storageTypes.getByRefId(t);return Object.keys(e)&&"string"==typeof e.name&&""!==e.name.trim()?e.name:(console.warn("ProductStorageType: no enums, fallback to refId"),t)},[null==n?void 0:n.storageTypes,t]);return r?(0,y.jsxs)(j.Row,{className:"productStorageType_wrapper__gvqcr",children:[(0,y.jsx)(j.Col,{xs:24,md:12,children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-product-storage-type",defaultMessage:"Product Storage Type:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,children:r})]}):null};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})(e)}function mP(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}let mI=function(e){var t=e.item,n=(0,c.useMemo)(function(){return null!=t&&t.storageType?{storageType:t.storageType}:null},[t]);return n?(0,y.jsx)(mC,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mP(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mM(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null};function mN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let mT=function(e){var t=e.eventTypes,n=na(),r=(0,c.useMemo)(function(){if(!Array.isArray(t)||null==n||!n.eventTypes)return null;var e,r=[],o=[],i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mN(e,void 0);var n=({}).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)?mN(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(i.s();!(e=i.n()).done;){var a,l=e.value,s=null==n||null===(a=n.eventTypes)||void 0===a?void 0:a.getByRefId(l);if(0!==Object.keys(s).length){var c=n.eventTypes.iconClass(s,!0);r.push((0,y.jsx)("i",{className:"".concat("productSupplyChainRoles_roleIcon__5s45g"," ").concat(c)},l)),o.push(n.eventTypes.iconClassDefinition(s))}}}catch(e){i.e(e)}finally{i.f()}return{icons:r,iconDefinitions:o.join("")}},[null==n?void 0:n.eventTypes,t]);return r.icons?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("style",{scoped:!0,children:r.iconDefinitions}),(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{xs:24,md:12,className:"productSupplyChainRoles_title__5s45g",children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-supply-chain-roles",defaultMessage:"Supply Chain Roles:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,children:(0,y.jsx)(j.Row,{children:r.icons})})]})]}):null};function mL(e){return(mL="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)}function mE(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}let mz=function(e){var t=e.organization,n=e.sliderLength,r=t.banner,o=t.hyphenatedName,i=t.id,a=t.logo,l=t.name,s=(0,c.useMemo)(function(){return"".concat("parentsCarouselItem_slideContent__yw45m"," ").concat(n>1?"parentsCarouselItem_slideMargin__yw45m":"")},[n]),u=(0,c.useMemo)(function(){return i2({media:Array.isArray(r)?r:[r],itemType:iZ.organization})},[r]),d=(0,c.useMemo)(function(){return fZ({media:a})},[a]),f=(0,c.useMemo)(function(){return iY({hyphenatedName:o,id:i,itemType:iZ.organization})},[o,i]);return(0,y.jsx)("div",{className:"parentsCarouselItem_slideWrapper__yw45m",children:(0,y.jsx)("div",{className:s,style:{backgroundImage:"linear-gradient(0deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url(".concat(u,")")},children:(0,y.jsxs)("div",{className:"parentsCarouselItem_inner__yw45m",children:[(0,y.jsx)("div",{className:"parentsCarouselItem_slideLogo__yw45m",children:(0,y.jsx)(j.Avatar,{src:d,shape:"round",alt:l?l+"-logo":""})}),(0,y.jsx)("h2",{className:"parentsCarouselItem_headline__yw45m",children:l}),(0,y.jsx)(ou,{target:"_blank",to:f,onClick:function(){eU("select_carousel_affiliate_item",{})},children:(0,y.jsx)("button",{className:"parentsCarouselItem_antButtonPrimarySm__yw45m",children:(0,y.jsx)(v.FormattedMessage,{id:"component-parents-carousel-item-button",description:"Button display in affiliate carousel",defaultMessage:"Discover Producers™"})})})]})})})};function mA(e){return(mA="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)}function mF(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 mD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mF(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mA(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mA(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mB(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mW(e,t);var n=({}).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)?mW(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var mR={dots:!1,infinite:!1,speed:500,slidesToShow:1,arrows:!1,slidesToScroll:1,draggable:!0,swipe:!0,responsive:[{breakpoint:768,settings:{infinite:!0,centerMode:!0,centerPadding:40}},{breakpoint:576,settings:{infinite:!0,centerMode:!0,centerPadding:20}}]};let mU=function(e){var t=e.organizations,n=mB((0,c.useState)(!1),2),r=n[0],o=n[1],i=mB((0,c.useState)(!!(t&&t.length>1)),2),a=i[0],l=i[1],s=t&&t.length>0?t.length:0,u=(0,c.useRef)(null),d=(0,c.useCallback)(function(){u.current.next(),eU("carousel_affiliateItem_next_arrow",{category:"carousel",label:"Affiliates Carousel"})},[u]),f=(0,c.useCallback)(function(){u.current.prev(),eU("carousel_affiliateItem_previous_arrow",{category:"carousel",label:"Affiliates Carousel"})},[u]),m=(0,c.useCallback)(function(e){var t=s-1;o(e>0),l(e!==t)},[s]);return 1===s&&(mR.responsive[0].settings.centerMode=!1,mR.responsive[0].settings.centerPadding=0,mR.responsive[1].settings.centerMode=!1,mR.responsive[1].settings.centerPadding=0),t&&0===t.length?null:(0,y.jsx)("section",{className:"parentsCarousel_parents__218vq",children:(0,y.jsxs)("div",{className:"parentsCarousel_carousel__218vq",children:[r&&(0,y.jsx)("nav",{className:"parentsCarousel_previous__218vq",onClick:f,children:(0,y.jsx)("i",{className:"parentsCarousel_iconArrowLeft__218vq"})}),(0,y.jsx)(j.Carousel,mD(mD({ref:u},mR),{},{afterChange:m,onSwipe:function(){return eU("carousel_affiliateItem_swipe",{category:"carousel",label:"Affiliates Carousel"})},children:t.map(function(e){return(0,y.jsx)(mz,{organization:e,sliderLength:s},e.id)})})),a&&(0,y.jsx)("nav",{className:"parentsCarousel_next__218vq",onClick:d,children:(0,y.jsx)("i",{className:"parentsCarousel_iconArrowRight__218vq"})})]})})},mH=function(e){var t=e.isOrganizationView,n=e.organizations,r=(0,c.useMemo)(function(){return t?(0,y.jsx)(v.FormattedMessage,{id:"component-organization-parents-organization-heading",defaultMessage:"This organization is a member of:"}):(0,y.jsx)(v.FormattedMessage,{id:"component-organization-parents-product-heading",defaultMessage:"This product is affiliated with:"})},[t]);return Array.isArray(n)&&n.length?(0,y.jsxs)("section",{className:"organizationParents_container__64hcj",children:[(0,y.jsx)("h3",{children:r}),(0,y.jsx)(mU,{organizations:n})]}):null};function mq(e){return(mq="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)}function mG(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}let mV=function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=d5(),l=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainProduct})},[r,o]),s=(0,c.useMemo)(function(){if(!i)return null;if(Array.isArray(null==t?void 0:t.parents)&&t.parents.length)return t.parents;if(!a)return null;var e=a[null==l?void 0:l.product],n=i[null==e?void 0:e.organization];return null==n?void 0:n.parents},[t,i,a,l]),u=(0,c.useMemo)(function(){return s?{isOrganizationView:!1,organizations:s.reduce(function(e,t){return i[t]?e.concat(i[t]):e},[])}:null},[s,i]);return u?(0,y.jsx)(mH,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mG(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mq(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mq(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mq(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},u)):null};function mZ(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 mY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mZ(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mJ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mJ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mJ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mZ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mJ(e){return(mJ="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)}function m$(e){var t,n,r=e.enums,o=e.enumName,i=e.enumValue,a=Array.isArray(i)?i.length>0:i&&"string"==typeof i&&"null"!==i&&"undefined"!==i,l=(t=r[o])&&"function"==typeof(null==t?void 0:t.getByRefId)&&(null==t||null===(n=t.enumValues)||void 0===n?void 0:n.length)>0;return a?l?(Array.isArray(i)&&i.forEach(function(e){if(!r[o].getByRefId(e))return console.warn("getIsValidEnumValue: missing enum value",e),!1}),!(i&&!r[o].getByRefId(i))||(console.warn("getIsValidEnumValue: missing enum value",i),!1)):(console.warn("getIsValidEnumValue: missing enum",o),!1):(console.warn("getIsValidEnumValue: invalid enum value",i),!1)}let mQ=n(4945);var mK=a.n(mQ);function mX(e){return(mX="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)}function m0(){m0=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==mX(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(mX(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function m1(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return m2(e,void 0);var n=({}).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)?m2(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function m2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m5(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 m8(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function m4(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){m8(i,r,o,a,l,"next",e)}function l(e){m8(i,r,o,a,l,"throw",e)}a(void 0)})}}var m3={affiliatedMember:"affiliatedMember",smallProducer:"smallProducer",mainOrganization:"mainOrganization",organization:"organization",product:"product"},m6={blue:{color:"#42a4b1",imageSrc:"/images/common/icons/icon-mapmarker-blue.png"},gold:{color:"#c4a029",imageSrc:"/images/common/icons/icon-mapmarker-gold.png"},green:{color:"#4b8029",imageSrc:"/images/common/icons/icon-mapmarker-green.png"}},m9={affiliatedMember:m6.blue.color,smallProducer:m6.green.color,mainOrganization:m6.gold.color,organization:m6.gold.color,product:m6.green.color},m7=[m9.affiliatedMember,m9.smallProducer,m9.mainOrganization,m9.organization,m9.product],pe={affiliatedMember:m6.blue.imageSrc,smallProducer:m6.green.imageSrc,mainOrganization:m6.gold.imageSrc,organization:m6.gold.imageSrc,product:m6.green.imageSrc},pt=["==",["get","markerType"],m3.affiliatedMember],pn=["==",["get","markerType"],m3.smallProducer],pr=["==",["get","markerType"],m3.mainOrganization],po=["==",["get","markerType"],m3.organization],pi=["==",["get","markerType"],m3.product];function pa(){var e=document.getElementsByClassName("selectedMarker");e.length>0&&e[0].classList.remove("selectedMarker")}function pl(e){return ps.apply(this,arguments)}function ps(){return(ps=m4(m0().mark(function e(t){var n,r,o,i,a,l,s,c,u,d,f,m,p,y,h;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.coordinates,o=t.getPopupContentFunction,i=t.handleClosePopUp,a=t.handleSelected,l=t.intl,s=t.map,c=t.objectId,d=void 0===(u=t.offset)?0:u,f=t.popUp,m=t.router,p=s.indexType,f.setOffset(d),e.next=6,o({indexType:p,intl:l,objectId:c,router:m,onClosePopUp:function(){f.remove(),a&&a(null),i()}});case 6:if(y=e.sent){e.next=9;break}return e.abrupt("return");case 9:h=document.createElement("div"),(0,lf.createRoot)(h).render(y),null===(n=f.setLngLat(r))||void 0===n||n.setDOMContent(h),setTimeout(function(){f.addTo(s)},250);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pc(e){return pu.apply(this,arguments)}function pu(){return(pu=m4(m0().mark(function e(t){var n,r,o,i,a,l,s,c,u,d,f,m,p,y,h,v;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getPopupContentFunction,r=t.handleClosePopUp,o=t.handleMarkerClick,i=t.intl,a=t.map,l=t.marker,s=t.router,c=a.handleSelected,u=a.indexType,d=a.popUp,m=(f=l.feature).properties.objectId,p=f.geometry.coordinates.slice(),o&&o(),c&&c(m),y=p[1],h=p[0],[m3.organization,m3.product].includes(u)&&(v=a.getBounds().getNorth()-a.getBounds().getSouth(),y=p[1]+.2*v),a.easeTo({center:[h,y]}),d){e.next=15;break}return e.abrupt("return");case 15:pl({coordinates:p,getPopupContentFunction:n,handleClosePopUp:r,handleSelected:c,intl:i,map:a,objectId:m,offset:mK().popupOffsetForSpiderLeg(l,4),popUp:d,router:s});case 16:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pd(e){var t=e.clusterId,n=e.coordinates,r=e.err,o=e.features,i=e.map,a=e.mapSource,l=e.resultCallback,s=void 0===l?function(){}:l;if(r)s&&s(!1);else{for(var c=i.spiderifier,u=o.map(function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m5(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mX(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mX(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mX(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({id:t},e)}),d=u[0].properties._geoloc,f=i.getZoom(),m=i.transform.maxZoom,p=!0,y=1;y<u.length;y++){var h=u[y].properties;if(h._geoloc.lat!==d.lat||h._geoloc.lng!==d.lng){p=!1;break}}p||f===m?(c&&c.spiderfy(n,u),s&&s(!0)):(c&&c.unspiderfy(),a.getClusterExpansionZoom(t,function(e,t){var r,o,a,l,c,u,d;return o=(r={map:i,coordinates:n,err:e,resultCallback:s,zoom:t}).map,a=r.coordinates,l=r.err,u=void 0===(c=r.resultCallback)?function(){}:c,d=r.zoom,void(l?u&&u(!1):(o.easeTo({center:a,zoom:d}),o.once("moveend",function(){u&&u(!1)})))}))}}function pf(e){return{type:"Feature",geometry:{type:"Point",coordinates:[e._geoloc.lng,e._geoloc.lat]},properties:e}}function pm(e,t){return Array.isArray(e)?{type:"FeatureCollection",features:e.reduce(function(e,n){var r,o,i=n.objectId,a=n._geoloc;return"number"!=typeof(null==a?void 0:a.lng)||"number"!=typeof a.lat||e.push({objectId:i,_geoloc:a,markerType:null!==(r=null==n||null===(o=n.data)||void 0===o?void 0:o.markerType)&&void 0!==r?r:t}),e},[]).map(pf)}:{type:"FeatureCollection",features:[]}}function pp(){return(pp=m4(m0().mark(function e(t){var n,r,o,i,a,l,s;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=t.map,r=t.selectedMarker,o=n.querySourceFeatures("mapItems"),i=!1,a=[],l=m0().mark(function e(){var t,l,c,u,d,f,m;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c=null!==(t=(l=o[s]).id)&&void 0!==t?t:l.properties.objectId,!a.includes(c)){e.next=4;break}return e.abrupt("return",0);case 4:if(a.push(c),(u=l.properties).cluster){e.next=9;break}return e.abrupt("return",0);case 9:if(d=u.cluster_id,f=u.objectIds,m=u.point_count,f.includes(r.objectId)){e.next=12;break}return e.abrupt("return",0);case 12:return e.next=14,new Promise(function(e){function t(t){setTimeout(function(){e(t)},250)}var o=n.getSource("mapItems");o.getClusterLeaves(d,m,0,function(e,i){i.forEach(function(a){a.properties.objectId===r.objectId&&(a.properties.selected=!0,pd({clusterId:d,coordinates:l.geometry.coordinates,err:e,features:i,map:n,mapSource:o,resultCallback:t}))})})});case 14:i=e.sent;case 15:case"end":return e.stop()}},e)}),s=0;case 7:if(!(s<o.length)){e.next=15;break}return e.delegateYield(l(),"t0",9);case 9:if(0!==e.t0){e.next=12;break}return e.abrupt("continue",12);case 12:s++,e.next=7;break;case 15:return e.abrupt("return",i);case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function py(e){return ph.apply(this,arguments)}function ph(){return(ph=m4(m0().mark(function e(t){var n,r,o,i,a,l,s;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.map,r=t.selectedMarker,n&&r){e.next=3;break}return e.abrupt("return");case 3:return o="marker-".concat(r.objectId),(i=document.getElementById(o))||n.spiderifier&&n.spiderifier.unspiderfy(),pC(a=pk(),r._geoloc),n.fitBounds(a,{maxZoom:n.getZoom()}),e.next=12,new Promise(function(e){n.once("moveend",function(){setTimeout(function(){e()},250)})});case 12:if(!(i=document.getElementById(o))){e.next=17;break}return i.classList.add("selectedMarker"),e.abrupt("return");case 17:l=!1,s=0;case 20:return e.next=22,function(e){return pp.apply(this,arguments)}({map:n,selectedMarker:r});case 22:l=e.sent,10==++s&&(l=!0);case 26:if(!1===l){e.next=20;break}case 27:return e.next=29,new Promise(function(e){var t=setInterval(function(){var n=document.getElementById(o);n&&(n.classList.add("selectedMarker"),e(),clearInterval(t))},250)});case 29:case 30:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pv(){return(pv=m4(m0().mark(function e(t){var n,r,o,i,a,l,s,c,u,d,f,m,p,y,h;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.coordinates,r=t.getPopupContentFunction,o=t.handleClosePopUp,i=t.handleMarkerClick,a=t.handleSelected,l=t.intl,s=t.map,c=t.markerType,u=t.objectId,d=t.popUp,f=t.router,m=t.spiderifier,i&&i(),a&&a(u),m&&m.unspiderfy(),p=n[1],y=n[0],[m3.organization,m3.product].includes(c)&&(h=s.getBounds().getNorth()-s.getBounds().getSouth(),p=n[1]+.2*h),s.easeTo({center:[y,p]}),d){e.next=12;break}return e.abrupt("return");case 12:pl({coordinates:n,getPopupContentFunction:r,handleClosePopUp:o,handleSelected:a,intl:l,map:s,objectId:u,popUp:d,router:f});case 13:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pg(e,t){var n=e.feature,r=e.elements,o=n.properties,i=o.markerType,a=o.selected,l=o.objectId,s="".concat(null!=i?i:t," ").concat(a?"selectedMarker":"");r.pin.innerHTML='<img class="'.concat(s,'" id="marker-').concat(l,'" />')}function pb(e){Object.keys(m6).forEach(function(t){var n=m6[t].imageSrc;e.loadImage(n,function(r,o){r?console.error("".concat(t," map icon no loaded:"),r.message):Object.keys(pe).forEach(function(t){pe[t]===n&&e.addImage(t,o)})})})}function pj(e){var t=e.closePopUp,n=void 0!==t&&t,r=e.map,o=e.handleZoomChange,i=void 0===o?function(){}:o,a=r.spiderifier,l=document.querySelector(".mapboxgl-ctrl-group > .mapboxgl-ctrl-zoom-in"),s=document.querySelector(".mapboxgl-ctrl-group > .mapboxgl-ctrl-zoom-out");l&&s&&(l.onclick=function(){i()},s.onclick=function(){var e;a&&a.unspiderfy(),n&&(null==r||null===(e=r.popUp)||void 0===e||e.remove()),i()})}function p_(e){var t=e.functionParam,n=e.map;return new Promise(function(e){n.loaded()?(t(),e(!0)):n.once("idle",function(){t(),e(!0)})})}function pw(e,t){p_({functionParam:function(){e.setLayoutProperty("country-label","text-field",["get","name_".concat(t)])},map:e})}function px(){return(px=m4(m0().mark(function e(t){var n,r,o;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.popUp,r=t.spiderifier,o=function(){n&&n.remove(),r&&r.unspiderfy()},e.next=4,p_({functionParam:o,map:t});case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pS(e){return pO.apply(this,arguments)}function pO(){return(pO=m4(m0().mark(function e(t){var n,r,o,i,a,l,s,c,u,d,f;return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.data,r=t.getPopupContentFunction,o=t.handleClosePopUp,i=t.handleClusterClick,a=t.handleMarkerClick,l=t.indexType,s=t.intl,c=t.map,u=t.router,d=t.withClusters,e.next=4,function(e){return px.apply(this,arguments)}(c);case 4:return f=function(){d?function(e){var t=e.data,n=e.getPopupContentFunction,r=e.handleClosePopUp,o=e.handleClusterClick,i=e.handleMarkerClick,a=e.intl,l=e.map,s=e.router,c=l.handleSelected,u=l.indexType,d=l.popUp,f=l.spiderifier,m={},p={};function y(){var e,t={},u=m1(l.querySourceFeatures("mapItems"));try{for(u.s();!(e=u.n()).done;)(function(){var u=e.value,y=u.geometry.coordinates,h=u.properties,v=h.cluster_id,g=h.markerType,b=h.objectId,j=h.point_count;if(h.cluster){var _=m[v];if(!_){var w=function(e){for(var t=function(e){var t=[e.countAffiliatedMembers,e.countSmallProducers,e.countMainOrganizations,e.countOrganizations,e.countProducts],n=[],r=0,o=t.reduce(function(e,t){return e+t},0);o>t.length&&(t=t.map(function(e){return 0===e?0:e/o<.125?Math.round(o/8):e}));var i,a=m1(t);try{for(a.s();!(i=a.n()).done;){var l=i.value;n.push(r),r+=l}}catch(e){a.e(e)}finally{a.f()}return{counts:t,offsets:n,total:r}}(e),n=t.counts,r=t.offsets,o=t.total,i='<div><svg width="40" height="40" viewbox="0 0 40 40" text-anchor="middle" style="font: 12px sans-serif; display: block">',a=0;a<n.length;a++)i+=function(e,t,n){t-e==1&&(t-=1e-5);var r=2*Math.PI*(e-.25),o=2*Math.PI*(t-.25),i=Math.cos(r),a=Math.sin(r),l=Math.cos(o),s=Math.sin(o),c=t-e>.5?1:0;return'<path d="M '.concat(20+15*i," ").concat(20+15*a," L ").concat(20+20*i," ").concat(20+20*a," A ").concat(20," ").concat(20," 0 ").concat(c," 1 ").concat(20+20*l," ").concat(20+20*s," L ").concat(20+15*l," ").concat(20+15*s," A ").concat(15," ").concat(15," 0 ").concat(c," 0 ").concat(20+15*i," ").concat(20+15*a,'" fill="').concat(n,'" />')}(r[a]/o,(r[a]+n[a])/o,m7[a]);i+='<circle cx="20" cy="20" r="15" fill="white" />\n          <text dominant-baseline="central" transform="translate(20, 20)">\n              '.concat(e.point_count_abbreviated,"\n          </text>\n          </svg>\n          </div>");var l=document.createElement("div");return l.innerHTML=i,l.firstChild}(h);w.addEventListener("click",function(){var e,t,n,r,i,a,s;return t=(e={coordinates:y,clusterId:v,handleClusterClick:o,map:l,pointCount:j}).coordinates,n=e.clusterId,r=e.handleClusterClick,i=e.map,a=e.pointCount,r&&r(),void(s=i.getSource("mapItems")).getClusterLeaves(n,a,0,function(e,r){return pd({clusterId:n,coordinates:t,err:e,features:r,map:i,mapSource:s})})}),_=m[v]=new(a8()).Marker({element:w}).setLngLat(y)}t[v]=_,p[v]||_.addTo(l)}else{var x=m[b];if(!x){var S,O,k=(S=null!=g?g:l.indexType,(O=document.createElement("img")).id="marker-".concat(b),O.src=pe[S],O);k.addEventListener("click",m4(m0().mark(function e(){return m0().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",function(e){return pv.apply(this,arguments)}({coordinates:y,getPopupContentFunction:n,handleClosePopUp:r,handleMarkerClick:i,handleSelected:c,intl:a,map:l,markerType:g,objectId:b,popUp:d,router:s,spiderifier:f}));case 1:case"end":return e.stop()}},e)}))),x=m[b]=new(a8()).Marker({element:k}).setLngLat(y)}t[b]=x,p[b]||x.addTo(l)}})()}catch(e){u.e(e)}finally{u.f()}for(var y in p)t[y]||p[y].remove();p=t}if(l.getSource("mapItems"))return l.on("sourcedata",function e(t){t.isSourceLoaded&&!l.multipleTypes&&l.off("sourcedata",e)}),void l.getSource("mapItems").setData(pm(t,u));l.off("render",y),l.on("sourcedata",function e(t){t.isSourceLoaded&&(l.on("render",y),l.addLayer({id:"unclustered-point",type:"symbol",source:"mapItems",filter:["all",["!has","point_count"]]}),l.off("sourcedata",e))}),l.addSource("mapItems",{type:"geojson",data:pm(t,u),cluster:!0,clusterRadius:52,clusterProperties:{countAffiliatedMembers:["+",["case",pt,1,0]],countSmallProducers:["+",["case",pn,1,0]],countMainOrganizations:["+",["case",pr,1,0]],countOrganizations:["+",["case",po,1,0]],countProducts:["+",["case",pi,1,0]],objectIds:["concat",["concat",["get","objectId"],","]]}})}({data:n,getPopupContentFunction:r,handleClosePopUp:o,handleClusterClick:i,handleMarkerClick:a,intl:s,map:c,router:u}):function(e){var t=e.data,n=e.map,r=e.indexType;n.addSource("mapItemsWithoutClusters",{type:"geojson",data:{type:"FeatureCollection",features:t.map(pf)},cluster:!1}),n.addLayer({id:"points",type:"symbol",source:"mapItemsWithoutClusters",layout:{"icon-image":r,"icon-offset":[0,-20]}})}({data:n,map:c,indexType:null!=l?l:c.indexType})},e.next=7,p_({functionParam:f,map:c});case 7:case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}function pk(){return new(a8()).LngLatBounds}function pC(e,t){return e.isEmpty()?(e.setNorthEast(t),e.setSouthWest(t)):Array.isArray(t)&&t.length?e.extend(new(a8()).LngLat(t[0],t[1])):e.extend(new(a8()).LngLat(t.lng,t.lat)),e}let pM={mapboxMap:"locationMap_mapboxMap__c84s4",hidePopUpCloseButton:"locationMap_hidePopUpCloseButton__c84s4",fullSize:"locationMap_fullSize__c84s4"};function pP(e){return(pP="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)}function pI(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 pN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pI(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=pP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pP(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==pP(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let pT=function(e){var t=e.mainOrganization,n=e.facilities,r=e.mapOptions,o=void 0===r?null:r,i=e.customPopUpClass,a=void 0===i?null:i;lV();var l=(0,v.useIntl)(),s=(0,c.useRef)(null),u=(0,c.useRef)(null),d=(0,c.useMemo)(function(){return a?"".concat(pM.mapboxMap," ").concat(pM[a]):pM.mapboxMap},[a]),f=(0,c.useMemo)(function(){var e=Object.assign({},lP.marketplaceMapOptions);return o&&Object.keys(o).forEach(function(t){e[t]=o[t]}),e},[o]);return(0,c.useEffect)(function(){if(a8().supported()){var e=function(e){var t,n,r,o,i=e.facilities,a=e.organization,l=a.facilities;if(!Array.isArray(l)||!l.length)return console.warn("locationMap::getMarkerData: no facilities"),null;var s=ie({organization:a,facilities:i});if(!s)return console.warn("locationMap::getMarkerData: no facility"),null;var c=null!=s&&null!==(t=s.location)&&void 0!==t&&t.coordinates.length?null==s||null===(n=s.location)||void 0===n?void 0:n.coordinates:[];return c.length&&"number"==typeof(null===(r=c[0])||void 0===r?void 0:r.lat)&&"number"==typeof(null===(o=c[0])||void 0===o?void 0:o.lng)?{facility:s,coordinates:c}:(console.warn("locationMap::getMarkerData: no coordinates in facilities"),null)}({facilities:n,organization:t});if(e){var r,o,i,a,c,d,m,p=new(a8()).Map({accessToken:"pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A",container:u.current,style:f.mapboxStyleUrl,renderWorldCopies:!1,zoom:lP.mainOrganizationZoomLevel,minZoom:lP.defaultZoomLevel,center:Array.isArray(e.coordinates)?e.coordinates[0]:null,cooperativeGestures:!0}),h=new(a8()).NavigationControl({showCompass:!1});return p.addControl(h,"bottom-right"),s.current=new l4(p,"mapbox",f),o=(r={currentMapOptions:f,intl:l,markerData:e,mapRef:s}).currentMapOptions,i=r.intl,a=r.markerData,c=r.mapRef,d=(0,y.jsx)(v.IntlProvider,pN(pN({},i),{},{children:(0,y.jsx)(ay,{facility:a.facility,showOriginText:!0})})),m={coordinates:a.coordinates,options:pN(pN({},o),{},{mapMarkerSelectedPath:pe.mainOrganization}),onMarkerClickHandler:function(){c.current.map.panTo(a.coordinates[0])},markersRef:[],isSelected:!0,hideSelectedInitial:!1,infoWindowContent:[{type:"custom",data:d}]},c.current.map.drawMarker(m),function(){s.current.destructor(),s.current||p.remove(),s.current=null}}}else console.warn("locationMap: WebGL is not supported. Interactive map not loaded.")},[]),(0,y.jsx)("div",{className:pM.fullSize,children:(0,y.jsx)("div",{ref:u,className:d})})};function pL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var pE=function(e){var t=e.facilities,n=e.organizations;if(!Array.isArray(n))return!1;var r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return pL(e,void 0);var n=({}).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)?pL(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(n);try{for(o.s();!(r=o.n()).done;){var i,a=ie({organization:r.value,facilities:t});if(Array.isArray(null==a||null===(i=a.location)||void 0===i?void 0:i.coordinates)&&a.location.coordinates.length){var l=a.location.coordinates;if(0!==l[0].lat||0!==l[0].lng)return!0}}}catch(e){o.e(e)}finally{o.f()}return!1};let pz=function(e){var t=e.mainOrganization,n=(e.organizations,e.facilities),r=e.title;return(0,c.useMemo)(function(){return pE({facilities:n,organizations:[t]})},[n,t])?(0,y.jsxs)("section",{className:"map_container__ps8tt",children:[(0,y.jsx)("div",{className:"map_titleContainer__ps8tt",children:r?(0,y.jsx)("h2",{children:r}):null}),(0,y.jsx)("div",{className:"map_containerInnerMap__ps8tt",children:(0,y.jsx)(pT,{mainOrganization:t,customPopUpClass:"hidePopUpCloseButton",facilities:n})})]}):null};function pA(e){return(pA="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)}function pF(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 pD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pF(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=pA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pA(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==pA(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let pB={hidden:"affiliatesCarousel_hidden__rg8ck",desktopCarousel:"affiliatesCarousel_desktopCarousel__rg8ck",controls:"affiliatesCarousel_controls__rg8ck",singleControl:"affiliatesCarousel_singleControl__rg8ck",heading:"affiliatesCarousel_heading__rg8ck",counter:"affiliatesCarousel_counter__rg8ck",organizationAffiliates:"affiliatesCarousel_organizationAffiliates__rg8ck",filterContainer:"affiliatesCarousel_filterContainer__rg8ck",selectContainer:"affiliatesCarousel_selectContainer__rg8ck",customSuffixIcon:"affiliatesCarousel_customSuffixIcon__rg8ck",pmtCloseCircleSm:"affiliatesCarousel_pmtCloseCircleSm__rg8ck",selectDropdown:"affiliatesCarousel_selectDropdown__rg8ck",actions:"affiliatesCarousel_actions__rg8ck",disabled:"affiliatesCarousel_disabled__rg8ck",paginationPage:"affiliatesCarousel_paginationPage__rg8ck",paginationIcon:"affiliatesCarousel_paginationIcon__rg8ck",iconPageNext:"affiliatesCarousel_iconPageNext__rg8ck",iconPagePrev:"affiliatesCarousel_iconPagePrev__rg8ck",currentPage:"affiliatesCarousel_currentPage__rg8ck",checkBoxesContainer:"affiliatesCarousel_checkBoxesContainer__rg8ck",noResutls:"affiliatesCarousel_noResutls__rg8ck"};function pW(e){return(pW="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)}function pR(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 pU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pR(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=pW(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pW(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==pW(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pH(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||pG(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pq(e){return function(e){if(Array.isArray(e))return pV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pG(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pG(e,t){if(e){if("string"==typeof e)return pV(e,t);var n=({}).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)?pV(e,t):void 0}}function pV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let pZ=e4(function(e){var t,n=e.parentContainer,r=e.heading,o=e.customHeadingStyle,i=e.itemComponent,a=e.pageRows,l=void 0===a?1:a,s=e.pageCols,u=void 0===s?4:s,d=e.pageResponsiveness,f=e.ssrSize,m=e.windowWidth,p=e.windowHeight,h=e.landscape,g=e.portrait,b=e.filterItems,_=void 0===b?function(e){return e.item,e.filter,!0}:b,w=e.onSelect,x=e.onUnselect,S=e.selected,O=e.setDisplayItems,k=void 0===O?function(){}:O,C=e.showSizeChanger,M=e.filteredProductTypes,P=e.affiliatedMembersList,I=void 0===P?[]:P,N=e.smallProducersList,T=void 0===N?[]:N,L=e.selectedTypes,E=void 0===L?[]:L,z=e.setSelectedTypes,A=e.selectedItem,F=e.setSelectedItem,D=void 0===F?function(){}:F,B=e.withFilterSelector,W=e.paginationSizeBreakpoint,R=(0,v.useIntl)(),U=((0,c.useMemo)(function(){return l*u},[l,u]),(0,c.useRef)(null)),H=pH((0,c.useState)(0),2),q=H[0],G=H[1],V=pH((0,c.useState)(0),2),Z=V[0],Y=V[1],J=pH((0,c.useState)(void 0),2),$=J[0],Q=J[1],K=um(n).width,X=(0,c.useMemo)(function(){var e=pq(I);return $?e.filter(function(e){return _({item:e,filter:$})}):e},[_,I,$]),ee=(0,c.useMemo)(function(){var e=pq(T);return $?e.filter(function(e){return _({item:e,filter:$})}):e},[_,T,$]),et=(0,c.useMemo)(function(){var e=[];return E.includes("affiliatedMembers")&&e.push.apply(e,pq(I)),E.includes("smallProducers")&&e.push.apply(e,pq(T)),e},[I,T,E]),en=(0,c.useMemo)(function(){var e=[];return E.includes("affiliatedMembers")&&e.push.apply(e,pq(X)),E.includes("smallProducers")&&e.push.apply(e,pq(ee)),e},[X,ee,E]),er=(0,c.useMemo)(function(){var e=new Intl.NumberFormat(R.locale,{}).format(X.length),t=new Intl.NumberFormat(R.locale,{}).format(I.length);return"(".concat(e," of ").concat(t,")")},[I,X,R]),eo=(0,c.useMemo)(function(){var e=new Intl.NumberFormat(R.locale,{}).format(ee.length),t=new Intl.NumberFormat(R.locale,{}).format(T.length);return"(".concat(e," of ").concat(t,")")},[T,ee,R]),ei=(0,c.useMemo)(function(){var e=new Intl.NumberFormat(R.locale,{}).format(en.length),t=new Intl.NumberFormat(R.locale,{}).format(I.length+T.length);return" (".concat(e," of ").concat(t,")")},[I,T,en,R]),ea=(0,c.useMemo)(function(){var e,t,n,r;return t=(e={affiliatedOrganizationsCounter:er,smallProducersCounter:eo,intl:R}).affiliatedOrganizationsCounter,n=e.intl,r=e.smallProducersCounter,[{label:n.formatMessage({id:"card-carousel-select-affiliated-organizations",defaultMessage:"Affiliated Organizations {counter}"},{counter:t}),value:"affiliatedMembers",style:{backgroundImage:"url(".concat(pe.affiliatedMember,")"),backgroundPosition:"right",backgroundSize:"contain",backgroundRepeat:"no-repeat",paddingRight:15}},{label:n.formatMessage({id:"card-carousel-select-small-producers",defaultMessage:"Small Producers {counter}"},{counter:r}),value:"smallProducers",style:{backgroundImage:"url(".concat(pe.smallProducer,")"),backgroundPosition:"right",backgroundSize:"contain",backgroundRepeat:"no-repeat",paddingRight:15}}]},[er,eo,R]),el=(0,c.useMemo)(function(){var e,t,n,r,o;return t=(e={filteredProductTypes:M,itemList:et,intl:R}).filteredProductTypes,n=e.itemList,r=e.intl,o=n.reduce(function(e,t){if(!Array.isArray(null==t||null===(n=t.organization)||void 0===n?void 0:n.productTypes))return e;var n,r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=pG(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(pq(new Set(t.organization.productTypes)));try{for(o.s();!(r=o.n()).done;){var i=r.value;"number"!=typeof e[i]&&(e[i]=0),e[i]++}}catch(e){o.e(e)}finally{o.f()}return e},{}),t.sort(function(e,t){return(null==e?void 0:e.name)>(null==t?void 0:t.name)?1:-1}).map(function(e){var t,n=new Intl.NumberFormat(r.locale,{}).format(null!==(t=o[e.refId])&&void 0!==t?t:0);return(0,y.jsxs)(j.Select.Option,{value:e.refId,children:[e.name,n?" (".concat(n,")"):""]},e.refId)})},[M,et,R]),es=uc({getCardStyles:(0,c.useCallback)(function(e){return uu({pageResponsiveness:d,media:e.media,windowWidth:e.windowWidth,containerMaxWidth:null!=n&&n.current?K:void 0})},[d,null==n?void 0:n.current,K]),pageCols:u,pageRows:l,pageResponsiveness:d,ssrSize:f,windowWidth:m,windowHeight:p,landscape:h,portrait:g,items:en,onSelect:w,onUnselect:x,selected:S,currentPage:Z});(0,c.useEffect)(function(){if(null!=U&&U.current&&S)for(var e=0;e<es.length;e++){var t=es[e],n=null==t?void 0:t.key;if("string"==typeof n&&-1!==n.indexOf(S)){Y(e);break}}},[U,S,es]),(0,c.useEffect)(function(){null!=U&&U.current&&U.current.goTo(Z)},[U,Z]),(0,c.useEffect)(function(){Y(0),k(en)},[en]),(0,c.useEffect)(function(){A&&G(Z),!A&&q?(Y(q),G(0)):Y(0)},[A]);var ec=(0,c.useCallback)(function(e,t,n){return"prev"===t?(0,y.jsx)("i",{className:"".concat(pB.paginationIcon," ").concat(pB.iconPagePrev," ").concat(0===Z?pB.disabled:"")}):"next"===t?(0,y.jsx)("i",{className:"".concat(pB.paginationIcon," ").concat(pB.iconPageNext," ").concat(Z>=Math.round(es.length)-1?pB.disabled:"")}):(0,y.jsx)("span",{className:pB.paginationPage,children:n})},[Z,es]),eu=(0,c.useCallback)(function(e){null!=U&&U.current&&Z!==e-1&&("function"==typeof x&&x(S),Y(e-1))},[U,Z,x]),ed=(0,c.useCallback)(function(e){Y(e)},[Z]);return A?null:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:pB.controls,children:[(0,y.jsxs)("h2",{className:"".concat(pB.heading," ").concat(null!==(t=pB[o])&&void 0!==t?t:""),children:[r,(0,y.jsx)("span",{className:pB.counter,children:ei})]}),(0,y.jsxs)("div",{className:pB.filterContainer,children:[void 0!==B&&B&&(0,y.jsx)("div",{className:pB.checkBoxesContainer,children:(0,y.jsx)(j.Checkbox.Group,{options:ea,defaultValue:["affiliatedMembers","smallProducers"],value:E,onChange:void 0===z?function(){}:z})}),(0,y.jsx)("div",{className:pB.selectContainer,children:(0,y.jsx)(j.Select,{className:pB.select,allowClear:!0,clearIcon:function(){return(0,y.jsx)("i",{className:pB.pmtCloseCircleSm})},placeholder:R.formatMessage({id:"card-carousel-placeholder",defaultMessage:"Filter by Product type"}),popupClassName:pB.selectDropdown,suffixIcon:(0,y.jsx)("div",{className:pB.customSuffixIcon}),showArrow:!0,value:$,onChange:Q,children:el})})]})]}),(0,y.jsxs)("div",{className:pB.desktopCarousel,children:[(0,y.jsx)(j.Carousel,{dots:!1,ref:U,afterChange:ed,children:es.map(function(e){return(0,e.slideWrapper)(e.items.map(function(e){var t=e.key,n=e.itemWrapper,r=e.itemParams;return n((0,c.createElement)(i,pU(pU({},r),{},{key:t,onOrgCardClick:function(e){D(e.orgId)},withRedirect:!1,customClass:"organization-affiliates-card"})))}))})}),0===en.length?(0,y.jsx)("div",{className:pB.noResutls,children:(0,y.jsx)(v.FormattedMessage,{defaultMessage:"No results found",id:"component-card-carosuel-no-results-found"})}):null]}),es.length>1?(0,y.jsx)(j.Row,{className:pB.actions,children:(0,y.jsx)(j.Pagination,{current:Z+1,total:es.length,defaultPageSize:1,hideOnSinglePage:!0,responsive:!0,showSizeChanger:void 0===C||C,onChange:eu,itemRender:ec,size:K<=(void 0===W?520:W)?"small":"default"})}):null]})}),pY="entitiesMapLegend_legendItem__1rpxd",pJ="entitiesMapLegend_color__1rpxd",p$=function(e){var t=e.mainOrganization,n=e.showAffiliatedMemberLegend,r=e.showSmallProducerLegend;return(0,y.jsxs)("div",{className:"entitiesMapLegend_legend__1rpxd",children:[t&&(0,y.jsxs)("div",{className:pY,children:[(0,y.jsx)("span",{className:"".concat(pJ," ").concat("entitiesMapLegend_mainOrganization__1rpxd")}),(0,y.jsx)(v.FormattedMessage,{id:"component-entities-map-legend-main-organization",defaultMessage:"Umbrella Organization"})]}),void 0!==n&&n&&(0,y.jsxs)("div",{className:pY,children:[(0,y.jsx)("span",{className:"".concat(pJ," ").concat("entitiesMapLegend_affiliatedMember__1rpxd")}),(0,y.jsx)(v.FormattedMessage,{id:"component-entities-map-legend-affiliated-organization",defaultMessage:"Affiliated Organization"})]}),void 0!==r&&r&&(0,y.jsxs)("div",{className:pY,children:[(0,y.jsx)("span",{className:"".concat(pJ," ").concat("entitiesMapLegend_smallProducer__1rpxd")}),(0,y.jsx)(v.FormattedMessage,{id:"component-entities-map-legend-small-producer",defaultMessage:"Small Producer"})]})]})},pQ={infoWindowContentContainer:"entitiesMap_infoWindowContentContainer__kn2vm",picture:"entitiesMap_picture__kn2vm",organizationName:"entitiesMap_organizationName__kn2vm",facilityLine:"entitiesMap_facilityLine__kn2vm",facilityName:"entitiesMap_facilityName__kn2vm",distance:"entitiesMap_distance__kn2vm",mainOrganizationPopUp:"entitiesMap_mainOrganizationPopUp__kn2vm",name:"entitiesMap_name__kn2vm",mapboxMap:"entitiesMap_mapboxMap__kn2vm",fullSize:"entitiesMap_fullSize__kn2vm",midSize:"entitiesMap_midSize__kn2vm",popupCloseButton:"entitiesMap_popupCloseButton__kn2vm"};function pK(e){return(pK="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)}function pX(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||p1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p0(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p1(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function p1(e,t){if(e){if("string"==typeof e)return p2(e,t);var n=({}).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)?p2(e,t):void 0}}function p2(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p5(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 p8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p5(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=pK(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pK(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==pK(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p5(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var p4=function(){eU("select_entities_map_org_item",{})},p3=function(){eU("click_entities_map_marker",{})},p6=function(){eU("click_entities_map_cluster",{})},p9=function(){eU("close_entities_map_popup",{})},p7=function(){eU("change_entities_map_zoom",{})},ye=function(e){var t,n=e.facilities,r=e.organization,o=ie({organization:r,facilities:n}),i=null==o||null===(t=o.location)||void 0===t?void 0:t.coordinates[0];return{data:p8(p8({},r),{},{facility:o}),objectId:r.id,_geoloc:i}},yt={showCompass:!1},yn={anchor:"bottom",closeButton:!1,focusAfterOpen:!1,maxWidth:"240px"},yr={animate:!0,animationSpeed:200,circleFootSeparation:35,circleSpiralSwitchover:11,customPin:!0};let yo=function(e){var t=e.affiliatedMembersIdList,n=void 0===t?[]:t,r=e.customClass,o=void 0===r?null:r,i=e.defaultIndexType,a=void 0===i?m3.mainOrganization:i,l=e.displayItemsIdList,s=void 0===l?[]:l,u=e.facilities,d=e.mainOrganization,f=e.mapOptions,m=void 0===f?null:f,p=e.multipleTypes,h=void 0!==p&&p,g=e.organizations,b=e.scrollZoom,j=void 0!==b&&b,_=e.selectedItem,w=void 0===_?null:_,x=e.setSelectedItem,O=void 0===x?function(){}:x,k=e.showDetailPopUp,C=void 0!==k&&k,M=e.showLegend,P=e.smallProducersIdList,I=void 0===P?[]:P,N=e.zoom,T=void 0===N?lP.defaultEntitiesMapZoomLevel:N,L=(0,v.useIntl)(),E=(0,S.useRouter)(),z=(0,c.useRef)(null),A=pX((0,c.useState)(null),2),F=A[0],D=A[1],B=pX((0,c.useState)(!1),2),W=B[0],R=B[1],U=(0,c.useMemo)(function(){var e=Object.assign({},g);return n.forEach(function(t){e[t].markerType=m3.affiliatedMember}),I.forEach(function(t){e[t].markerType=m3.smallProducer}),e[d.id].markerType=m3.mainOrganization,e},[g,n,I,d]),H=(0,c.useMemo)(function(){return function(e){var t,n=e.displayItemsIdList,r=e.facilities,o=e.mapOrganizations,i={},a=function(e){var t,n=e.facilities,r=e.mapOrganizations,o=[],i=p0(e.displayItemsIdList);try{for(i.s();!(t=i.n()).done;){var a=t.value,l=r[a];l?pE({facilities:n,organizations:[l]})?o.push(a):console.log("not displaying organization on map because of bad coordinates",{organization:l}):console.warn("entitiesMap::createMarkers: bad id in displayItemsIdList",{organizationId:a})}}catch(e){i.e(e)}finally{i.f()}return o}({displayItemsIdList:n,facilities:r,mapOrganizations:o}),l=p0(a);try{for(l.s();!(t=l.n()).done;){var s=o[t.value],c=ye({facilities:r,organization:s});i[c.objectId]=c}}catch(e){l.e(e)}finally{l.f()}return i}({displayItemsIdList:[].concat(function(e){if(Array.isArray(e))return p2(e)}(s)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||p1(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[d.id]),facilities:u,mapOrganizations:U})},[s,u,U,d]),q=(0,c.useMemo)(function(){return Object.keys(H).map(function(e){return H[e]})},[H]),G=(0,c.useMemo)(function(){var e=Object.assign({},lP.marketplaceMapOptions);return m&&Object.keys(m).forEach(function(t){e[t]=m[t]}),e},[m]),V=(0,c.useMemo)(function(){return n.length>0},[n]),Z=(0,c.useMemo)(function(){return I.length>0},[I]),Y=(0,c.useCallback)(function(e){C||e!==d.id&&O(e)},[d,O,C]),J=(0,c.useCallback)(function(e){var t,n,r,o,i,a,l,s,c;return n=(t=p8({dataObject:H,mainOrganization:d,showDetailPopUp:C},e)).dataObject,r=t.intl,o=t.mainOrganization,i=t.objectId,a=t.onClosePopUp,l=t.router,s=t.showDetailPopUp,(c=n[i])?i===o.id?(0,y.jsx)(v.RawIntlProvider,{value:r,children:(0,y.jsxs)("div",{className:pQ.mainOrganizationPopUp,children:[(0,y.jsx)("div",{className:pQ.name,children:(0,y.jsx)(v.FormattedMessage,{id:"component-entities-map-main-organization",defaultMessage:"{instanceTitle}'s Location",values:{instanceTitle:o.name}})}),(0,y.jsx)(ay,{facility:c.data.facility})]})}):s?(0,y.jsxs)(v.RawIntlProvider,{value:r,children:[(0,y.jsx)("button",{className:pQ.popupCloseButton,type:"button","aria-label":"Close popup","aria-hidden":"true",onClick:a,children:(0,y.jsx)("i",{})}),(0,y.jsx)(ni,{locale:r.locale,children:(0,y.jsx)(a_,{organization:c.data,onOrgCardClick:p4,customClass:"featured-members-card",routerParam:l},c.objectId)})]}):void 0:null},[H,d,C]),$=(0,c.useCallback)(function(e,t){return pc({getPopupContentFunction:J,handleClosePopUp:p9,handleMarkerClick:p3,intl:L,map:e,marker:t,router:E})},[J,L,E]);return(0,c.useEffect)(function(){if(a8().supported()){var e=new(a8()).Map({accessToken:"pk.eyJ1IjoicHJvZHVjZXJzbWFya2V0IiwiYSI6ImNrdzN1azk4ODBhanoycm52cDM1N29mY3IifQ.F9nX1Kxoddu4s909galw2A",container:z.current,style:G.mapboxStyleUrl,attributionControl:!1,dragRotate:!1,renderWorldCopies:!1,scrollZoom:j,touchPitch:!1,touchZoomRotate:!0,zoom:T,minZoom:lP.defaultZoomLevel,maxZoom:lP.maxFacilityZoomLevel,cooperativeGestures:!0});return e.multipleTypes=h,e.indexType=a,e.touchZoomRotate.disableRotation(),e.addControl(new(a8()).NavigationControl(yt),"bottom-right"),e.popUp=new(a8()).Popup(yn),e.handleSelected=Y,e.spiderifier=new(mK())(e,p8(p8({},yr),{},{initializeLeg:function(e){return pg(e,a)},onClick:function(t,n){return $(e,n)}})),e.on("load",function(){pb(e)}),pj({closePopUp:!0,map:e,handleZoomChange:p7}),D(e),function(){return e.remove()}}console.warn("entitiesMap: WebGL is not supported. Interactive map not loaded.")},[]),(0,c.useEffect)(function(){pa(),F&&w&&py({map:F,selectedMarker:H[w]})},[w]),(0,c.useEffect)(function(){F&&(setTimeout(function(){R(!!w)},1e3),w||W||(pS({data:q,getPopupContentFunction:J,handleClosePopUp:p9,handleClusterClick:p6,handleMarkerClick:p3,intl:L,map:F,router:E,withClusters:!0}),setTimeout(function(){if(0!==q.length){var e=pk();q.forEach(function(t){pC(e,t._geoloc)});var t=F.getContainer();F.fitBounds(e,{padding:Math.min(t.clientWidth/8,t.clientHeight/8),maxZoom:lP.mainOrganizationZoomLevel})}},1e3)))},[q,F]),(0,c.useEffect)(function(){F&&pw(F,L.locale)},[L.locale]),(0,y.jsx)("div",{className:o?pQ[o]:null,children:(0,y.jsx)("div",{ref:z,className:pQ.mapboxMap,children:void 0!==M&&M&&(0,y.jsx)(p$,{mainOrganization:d,showAffiliatedMemberLegend:V,showSmallProducerLegend:Z})})})},yi={content:"affiliatedOrganizationDetail_content__juahc",media:"affiliatedOrganizationDetail_media__juahc",content__inner:"affiliatedOrganizationDetail_content__inner__juahc",socialMediaContainer:"affiliatedOrganizationDetail_socialMediaContainer__juahc",headline:"affiliatedOrganizationDetail_headline__juahc",valuesWrapper:"affiliatedOrganizationDetail_valuesWrapper__juahc",affiliatedProducersWrapper:"affiliatedOrganizationDetail_affiliatedProducersWrapper__juahc",productTypeWrapper:"affiliatedOrganizationDetail_productTypeWrapper__juahc",countHighlight:"affiliatedOrganizationDetail_countHighlight__juahc",panelHeader:"affiliatedOrganizationDetail_panelHeader__juahc",buttonWrapper:"affiliatedOrganizationDetail_buttonWrapper__juahc",button:"affiliatedOrganizationDetail_button__juahc"};function ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let yl=e4(function(e){var t=e.organization,n=e.allFacilities,r=e.defaultOpenPanels,o=e.windowWidth,i=(0,v.useIntl)().locale,a=na().productTypes.enumValues,l=(0,c.useMemo)(function(){return t&&t.isView&&t.isPublished?iY({hyphenatedName:t.hyphenatedName,id:t.id,itemType:iZ.organization}):null},[t]),s=(0,c.useMemo)(function(){var e,r;return Array.isArray(null==t?void 0:t.facilities)&&null!==(e=null===(r=t.facilities)||void 0===r?void 0:r.map(function(e){return n[e]}).filter(function(e){return e}))&&void 0!==e?e:[]},[t,n]),u=(0,c.useMemo)(function(){if(!Array.isArray(null==t?void 0:t.media)&&!Array.isArray(null==t?void 0:t.banner))return[];var e=null!==(n=t.media)&&void 0!==n?n:[];if(Array.isArray(t.banner)&&t.banner.length&&(e=t.banner),!e.length)return[];var n,r,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ya(e,void 0);var n=({}).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)?ya(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.mediaType===m.mediaTypes.image&&(a.url=i2({itemType:"organization",media:e,options:{width:Math.max(1200,Math.min(800,(null!=o?o:800)/2))}}))}}catch(e){i.e(e)}finally{i.f()}return e.filter(function(e){return e.mediaType===m.mediaTypes.image})},[null==t?void 0:t.media,null==t?void 0:t.banner,o]),d=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.certifications)&&t.certifications.length>0},[null==t?void 0:t.certifications]),f=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.values)&&t.values.length>0},[null==t?void 0:t.values]),p=(0,c.useMemo)(function(){return d||f},[d,f]),h=(0,c.useMemo)(function(){return"string"!=typeof(null==t?void 0:t.name)?"":t.name},[t]),g=(0,c.useMemo)(function(){return"string"!=typeof(null==t?void 0:t.organizationType)?null:t.organizationType},[t]),b=(0,c.useMemo)(function(){return"string"!=typeof(null==t?void 0:t.type)?null:t.type},[t]),j=(0,c.useMemo)(function(){return"string"!=typeof(null==t?void 0:t.yearEstablished)?null:t.yearEstablished},[null==t?void 0:t.yearEstablished]),_=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.values)?t.values:[]},[null==t?void 0:t.values]),w=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.valuesSorted)?t.valuesSorted:[]},[null==t?void 0:t.valuesSorted]),x=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.certifications)?t.certifications:[]},[null==t?void 0:t.certifications]),S=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.certificationsSorted)?t.certificationsSorted:[]},[null==t?void 0:t.certificationsSorted]),O=(0,c.useMemo)(function(){return"number"==typeof(null==t?void 0:t.numberMembers)&&t.numberMembers>0?t.numberMembers:"number"==typeof(null==t?void 0:t.affiliationsCount)&&t.affiliationsCount>0?t.affiliationsCount:0},[null==t?void 0:t.affiliationsCount,null==t?void 0:t.numberMembers]),k=(0,c.useMemo)(function(){var e;return(null==t||null===(e=t.productTypes)||void 0===e?void 0:e.length)>0&&(null==t?void 0:t.productCount)>0&&a&&"function"==typeof(null==a?void 0:a.filter)},[t,a]),C=(0,c.useMemo)(function(){return(0,y.jsxs)("span",{className:yi.countHighlight,children:["(",null==t?void 0:t.productCount,")"]})},[null==t?void 0:t.productCount]),M=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.social)?t.social:[]},[null==t?void 0:t.social]),P=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.story)||"string"==typeof(null==t?void 0:t.story)?t.story:""},[null==t?void 0:t.story]);return(0,y.jsxs)("div",{className:yi.content,children:[l&&(0,y.jsx)("div",{className:yi.buttonWrapper,children:(0,y.jsx)(ou,{locale:i,to:l,target:"_blank",children:(0,y.jsx)("button",{className:yi.button,children:(0,y.jsx)(v.FormattedMessage,{id:"component-affiliated-organization-detail-view-full-profile",defaultMessage:"View full profile"})})})}),(0,y.jsx)("div",{className:yi.media,children:(0,y.jsx)(ro,{mediaItemsClass:"fromOrganizationModalContent",media:u,placeholderImage:"/images/image-placeholder--grey.svg",slug:"organization"})}),(0,y.jsxs)("div",{className:yi.content__inner,children:[(0,y.jsx)(ii,{customClass:"affiliatedOrganizationDetail",disableFacilityLink:!0,facilities:n,name:h,numberMembers:O,organizationType:g,ownedFacilities:s,story:P,type:b,withFlag:!0,withSupHeadline:!1,yearEstablished:j}),k&&(0,y.jsxs)("div",{className:yi.productTypeWrapper,children:[(0,y.jsxs)("b",{children:[(0,y.jsx)(v.FormattedMessage,{id:"component-affiliated-organization-detail-product-count",defaultMessage:"Products {productCount}",values:{productCount:C}}),":"]})," ",(0,y.jsx)(ah,{itemProductTypes:t.productTypes})]}),p?(0,y.jsxs)(tY,{defaultOpenPanels:void 0===r?[]:r,children:[d?(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:yi.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-affiliated-organization-detail-certification-title",defaultMessage:"Certifications"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:yi,owner:"OrganizationModalContent",children:(0,y.jsx)(nv,{certifications:x,certificationsSorted:S,minimumCertificationsShown:t.certifications.length})})},"certifications"):null,f?(0,y.jsx)(tV,{header:(0,y.jsx)("h3",{className:yi.panelHeader,children:(0,y.jsx)(v.FormattedMessage,{id:"component-affiliated-organization-detail-values-title",defaultMessage:"Values"})}),forceRender:!0,children:(0,y.jsx)(ea,{styles:yi,owner:"OrganizationModalContent",children:(0,y.jsx)("div",{className:yi.valuesWrapper,children:(0,y.jsx)(ic,{valuesClass:"fromOrgnModal",values:_,valuesSorted:w})})})},"values"):null]}):null,M.length>0?(0,y.jsxs)("div",{className:yi.socialMediaContainer,children:[(0,y.jsx)("div",{className:yi.headlineWrapper,children:(0,y.jsx)("h3",{className:yi.headline,children:(0,y.jsx)(v.FormattedMessage,{id:"component-affiliated-organization-detail-connect-title",defaultMessage:"Connect"})})}),(0,y.jsx)(rk,{fromComponentClass:"orgModalContent",social:M})]}):null]})]})}),ys="organizationAffiliates_container__guet8",yc="organizationAffiliates_affiliatesList__guet8";function yu(e){return(yu="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)}function yd(e){return function(e){if(Array.isArray(e))return yh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||yy(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yf(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 ym(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yf(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yu(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yu(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yf(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yp(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||yy(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yy(e,t){if(e){if("string"==typeof e)return yh(e,t);var n=({}).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)?yh(e,t):void 0}}function yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var yv={desktop:{pageCols:2,pageRows:2},tablet:{pageCols:2,pageRows:2},mobile:{pageCols:1,pageRows:2}};function yg(e){var t,n=e.item,r=e.filter,o=Array.from(new Set(Array.isArray(null==n||null===(t=n.organization)||void 0===t?void 0:t.productTypes)?n.organization.productTypes:[]));return!("string"!=typeof r||!o.includes(r))}let yb=e4(function(e){var t=e.affiliatedMembersIdList,n=e.facilities,r=e.initialSortOrder,o=e.mainOrganization,i=e.organizations,a=e.smallProducersIdList,l=e.windowWidth,s=na().productTypes.enumValues,u=(0,c.useRef)(),d=yp((0,c.useState)([]),2),f=d[0],m=d[1],p=yp((0,c.useState)(null),2),h=p[0],g=p[1],b=yp((0,c.useState)(["affiliatedMembers","smallProducers"]),2),j=b[0],_=b[1],w=yp((0,c.useState)({}),2),x=w[0],S=w[1],O=(0,c.useRef)(null),k=(0,c.useMemo)(function(){return t.map(function(e,t){var r=i[e];return{id:t,organization:ym(ym({},r),{},{facility:ie({organization:r,facilities:n})})}})},[n,i,t]),C=(0,c.useMemo)(function(){return a.map(function(e,t){var r=i[e];return{id:t,organization:ym(ym({},r),{},{facility:ie({organization:r,facilities:n})})}})},[n,i,a]),M=(0,c.useMemo)(function(){return h?i[h]:null},[h,i]),P=(0,c.useMemo)(function(){return[].concat(yd(k),yd(C))},[k,C]),I=(0,c.useMemo)(function(){var e=[];return Array.isArray(t)&&(e=e.concat(t.map(function(e){return i[e]}))),Array.isArray(a)&&(e=e.concat(a.map(function(e){return i[e]}))),pE({facilities:n,organizations:e})},[n,i,t,a]),N=(0,c.useMemo)(function(){var e=[];P.forEach(function(t){var n,r=t.organization;e.push.apply(e,yd(null!==(n=null==r?void 0:r.productTypes)&&void 0!==n?n:[]))});var t=Array.from(new Set(e));return s.filter(function(e){return t.includes(e.refId)})},[s,P]);(0,c.useEffect)(function(){var e=setTimeout(function(){var e={};l>991&&(e=P.length<3?{height:"550px"}:{height:document.getElementById("affiliatesList").offsetHeight}),S(e)},1e3);return function(){clearTimeout(e)}},[P,l]),(0,c.useEffect)(function(){if(null!=O&&O.current&&M){var e=setTimeout(function(){if(null!=O&&O.current){var e=O.current.getBoundingClientRect().top;if(!(e>110)){var t=e+window.pageYOffset-110;window.scrollTo({top:t,behavior:"smooth"})}}},1e3);return function(){clearTimeout(e)}}},[M]);var T=(0,c.useMemo)(function(){return Array.isArray(t)&&t.length>0||Array.isArray(a)&&a.length>0},[t,a]),L=(0,c.useMemo)(function(){return k.length>0&&C.length>0},[k.length,C.length]);return I&&T?(0,y.jsxs)("section",{className:ys,children:[(0,y.jsxs)("div",{className:M?"organizationAffiliates_organizationSelection__guet8":yc,style:x,id:"affiliatesList",ref:u,children:[(0,y.jsx)(pZ,{parentContainer:u,filterItems:yg,heading:(0,y.jsx)(v.FormattedMessage,{id:"component-organization-affiliates-heading",defaultMessage:"Producer Network"}),customHeadingStyle:"organizationAffiliates",itemComponent:a_,pageResponsiveness:yv,withFilterSelector:L,showSizeChanger:!1,setDisplayItems:m,filteredProductTypes:N,affiliatedMembersList:k,smallProducersList:C,selectedTypes:j,setSelectedTypes:_,selectedItem:h,setSelectedItem:g,initialSortOrder:r}),M&&(0,y.jsxs)("div",{className:"organizationAffiliates_selectedWrapper__guet8",children:[(0,y.jsxs)("div",{className:"organizationAffiliates_backButton__guet8",onClick:function(){return g(null)},ref:O,children:[(0,y.jsx)("i",{className:"organizationAffiliates_backIcon__guet8"}),(0,y.jsx)("span",{className:"organizationAffiliates_backText__guet8",children:(0,y.jsx)(v.FormattedMessage,{id:"component-organization-affiliates-back-button-text",defaultMessage:"Back"})})]}),(0,y.jsx)(yl,{organization:M,allFacilities:n,defaultOpenPanels:["certifications","values"]})]})]}),(0,y.jsx)(yo,{affiliatedMembersIdList:t,customClass:"midSize",displayItemsIdList:null==f?void 0:f.map(function(e){return e.organization.id}),facilities:n,mainOrganization:o,multipleTypes:!0,organizations:i,scrollZoom:!0,selectedItem:h,setSelectedItem:g,showLegend:!0,smallProducersIdList:a})]}):null});function yj(e){return(yj="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)}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 yw(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){(function(e,t,n){var r;(r=function(e,t){if("object"!=yj(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yj(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yj(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(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 yx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var yS={desktop:{pageCols:2,pageRows:2},tablet:{pageCols:2,pageRows:2},mobile:{pageCols:1,pageRows:2}};function yO(e){var t,n,r,o,i,a,l=e.sortOrder,s=e.a,c=e.b,u="",d="";switch(l){case"name":return(u=null!==(t=s.organization.name)&&void 0!==t?t:"")===(d=null!==(n=c.organization.name)&&void 0!==n?n:"")?0:u>d?1:-1;case"most-recent":return(u=null!==(r=null!==(o=s.organization.publishedAt)&&void 0!==o?o:s.organization.updatedAt)&&void 0!==r?r:"")===(d=null!==(i=null!==(a=c.organization.publishedAt)&&void 0!==a?a:c.organization.updatedAt)&&void 0!==i?i:"")?0:u>d?-1:1;default:console.warn("[dev] unknown sort order",{sortOrder:l})}return 0}let yk=function(e){var t,n,r=e.affiliatesIdList,o=e.facilities,i=e.organizations,a=e.mainOrganization,l=(0,c.useRef)(),s=na().productTypes.enumValues,u=(0,v.useIntl)(),d=function(e){if(Array.isArray(e))return e}(n=(0,c.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(n,0)||function(e,t){if(e){if("string"==typeof e)return yx(e,2);var n=({}).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)?yx(e,2):void 0}}(n,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=d[0],m=d[1],p=(0,c.useMemo)(function(){return r.map(function(e,t){var n=i[e];return{id:t,organization:yw(yw({},n),{},{facility:ie({organization:n,facilities:o})})}})},[o,i,r]),h=(0,c.useMemo)(function(){var e=[];return Array.isArray(r)&&(e=e.concat(r.map(function(e){return i[e]}))),pE({facilities:o,organizations:e})},[o,i,r]),g=(0,c.useCallback)(function(e){var t,n,r,o,i,a,l,c=e.item,d=e.filter,f=null!==(t=null==c||null===(n=c.organization)||void 0===n?void 0:n.name)&&void 0!==t?t:"",m=null!==(r=null==c||null===(o=c.organization)||void 0===o||null===(o=o.facility)||void 0===o||null===(o=o.location)||void 0===o||null===(o=o.countryCode)||void 0===o?void 0:o.toUpperCase())&&void 0!==r?r:"",p=null!==(i=2===m.length&&u.formatDisplayName(m,{type:"region"}))&&void 0!==i?i:"",y=Array.from(new Set(Array.isArray(null==c||null===(a=c.organization)||void 0===a?void 0:a.productTypes)?c.organization.productTypes:[])),h=null!==(l=s.filter(function(e){return y.includes(e.refId)}).map(function(e){return e.name}).join(","))&&void 0!==l?l:"";return"string"!=typeof d||""===d||-1!==f.toLowerCase().indexOf(d.toLowerCase())||-1!==p.toLowerCase().indexOf(d.toLowerCase())||-1!==h.toLowerCase().indexOf(d.toLowerCase())},[u,s]),b=Array.isArray(r)&&r.length>0;return h&&b?(0,y.jsxs)("section",{className:ys,children:[(0,y.jsx)("div",{className:yc,ref:l,children:(0,y.jsx)(uj,{parentContainer:l,customSearchPlaceholder:u.formatMessage({id:"organization-affiliates-search-input-placeholder",defaultMessage:"Search for name, country or product type..."}),filterItems:g,heading:(0,y.jsx)(v.FormattedMessage,{id:"component-organization-affiliates-heading",defaultMessage:"Producer Network"}),customHeadingStyle:"organizationAffiliates",items:p,itemComponent:a_,pageResponsiveness:yS,withFilter:!0,withSortOrder:!0,showSizeChanger:!1,setDisplayItems:m,sortItems:yO})}),(0,y.jsx)(yo,{customClass:"midSize",defaultIndexType:m3.affiliatedMember,displayItemsIdList:null!==(t=null==f?void 0:f.map(function(e){return e.organization.id}))&&void 0!==t?t:r,facilities:o,mainOrganization:a,organizations:i,showDetailPopUp:!0,showLegend:!0})]}):null};function yC(e){return(yC="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)}function yM(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 yP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yM(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yC(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yI(e){return(yI="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)}function yN(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}let yT="organizationProducts_productsSection__4c5p5",yL="organizationProducts_productsContainer__4c5p5",yE="organizationProducts_productsList__4c5p5";var yz={desktop:{pageCols:3,pageRows:2},tablet:{pageCols:2,pageRows:2},mobile:{pageCols:1,pageRows:1}};let yA=function(e){var t=e.products,n=(0,c.useRef)(),r=(0,y.jsx)(v.FormattedMessage,{id:"component-organization-products-heading",defaultMessage:"Products"});return Array.isArray(t)&&t.length?(0,y.jsx)("section",{className:yT,id:"product-anchor",children:(0,y.jsx)("div",{className:yL,children:(0,y.jsx)("div",{className:yE,ref:n,children:(0,y.jsx)(uj,{parentContainer:n,pageResponsiveness:yz,heading:r,items:t.map(function(e,t){return{product:e,id:t}}),itemComponent:sF,withFilter:!1,withSortOrder:!1,showSizeChanger:!1})})})}):null};function yF(e){return(yF="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)}function yD(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 yB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yD(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yF(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yF(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yF(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yW(e){return(yW="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)}function yR(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 yU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yW(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yW(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yW(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let yH=function(e){var t=e.stories;return Array.isArray(t)&&t.length?(0,y.jsx)("section",{className:"organizationStories_container__eccj1",children:(0,y.jsx)("div",{className:"organizationStories_containerInner__eccj1",children:(0,y.jsx)(sz,{stories:t})})}):null};function yq(e){return(yq="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)}function yG(){yG=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==yq(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(yq(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function yV(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function yZ(e){return yY.apply(this,arguments)}function yY(){var e;return e=yG().mark(function e(t){var n;return yG().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ew().get("".concat("https://producersmarket.com/blog/wp-json/wp/v2/posts","?filter[meta_key]=org_uuid&filter[meta_value]=").concat(t,"&_embed&per_page=").concat(4)).catch(function(e){return e.response?Promise.reject({status:e.response.status,message:e.response.data.message}):(e.request,Promise.reject(e))});case 3:return n=e.sent,e.abrupt("return",n.data);case 7:return e.prev=7,e.t0=e.catch(0),console.error("Failed to load word press blog posts in getOrganizationStories",{organizationUuid:t,error:e.t0}),e.abrupt("return",[]);case 11:case"end":return e.stop()}},e,null,[[0,7]])}),(yY=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){yV(i,r,o,a,l,"next",e)}function l(e){yV(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}function yJ(e){return(yJ="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)}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 yQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let yK=function(e){var t=e.available,n=e.stock,r=e.unit,o=na(),i=(0,c.useMemo)(function(){if(null==o||!o.productionUnitTypes||!r)return null;var e=o.productionUnitTypes.getByRefId(r);return Object.keys(e)&&"string"==typeof e.name&&""!==e.name.trim()?e.name:r},[null==o?void 0:o.productionUnitTypes,r]),a=(0,c.useMemo)(function(){return i&&void 0!==t&&void 0!==n&&null!==t?!1===t||0===n?(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-product-availability-not-available",defaultMessage:"Not Available"}):(0,y.jsxs)(y.Fragment,{children:[n,(0,y.jsx)("span",{className:"productAvailability_space__q8g4w"}),i]}):null},[i,t,n]);return a?(0,y.jsxs)(j.Row,{children:[(0,y.jsx)(j.Col,{xs:24,md:12,className:"productAvailability_title__q8g4w",children:(0,y.jsx)("strong",{children:(0,y.jsx)(v.FormattedMessage,{id:"component-product-details-availability",defaultMessage:"Product Availability:"})})}),(0,y.jsx)(j.Col,{xs:24,md:12,children:a})]}):null};function yX(e){return(yX="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)}function y0(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}var y1={desktop:{pageCols:3,pageRows:1},tablet:{pageCols:2,pageRows:1},mobile:{pageCols:1,pageRows:1}};let y2=function(e){var t=e.products,n=(0,y.jsx)(v.FormattedMessage,{id:"component-product-products-heading",defaultMessage:"More Products By This Organization"}),r=(0,c.useRef)();return t.length?(0,y.jsx)("section",{className:yT,id:"product-anchor",children:(0,y.jsx)("div",{className:yL,children:(0,y.jsx)("div",{className:yE,ref:r,children:(0,y.jsx)(uj,{parentContainer:r,pageResponsiveness:y1,heading:n,items:t.map(function(e,t){return{product:e,id:t}}),itemComponent:sF,withFilter:!1,withSortOrder:!1,showSizeChanger:!1})})})}):null};function y5(e){return(y5="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)}function y8(){y8=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==y5(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(y5(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function y4(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var y3="".concat(tO.marketplace.apiBase,"/products/index/related/");function y6(){var e;return e=y8().mark(function e(t){var n;return y8().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ew().get("".concat(y3).concat(t)).catch(function(e){return e.response?Promise.reject({status:e.response.status,message:e.response.data.message}):(e.request,Promise.reject(e))});case 3:return n=e.sent,e.abrupt("return",n.data.data);case 7:return e.prev=7,e.t0=e.catch(0),console.error("Failed to load related products in getProductsByOrganization",{organizationId:t,error:e.t0}),e.abrupt("return",[]);case 11:case"end":return e.stop()}},e,null,[[0,7]])}),(y6=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y4(i,r,o,a,l,"next",e)}function l(e){y4(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}function y9(e){return(y9="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)}function y7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let he=function(e){var t=e.snapshot,n=(0,c.useMemo)(function(){return JSON.stringify({snapshot:t},null,!0)},[t]);return(0,y.jsx)("pre",{children:n})};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})(e)}function hn(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 hr(e){return(hr="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)}function ho(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 hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=hr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hr(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hr(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let ha=function(e){var t=e.socialLinks,n=e.name,r=(0,c.useMemo)(function(){return{organization:{name:n,social:t}}},[t,n]);return(0,y.jsx)(da,hi(hi({},r),{},{customHeadlineStyle:"socialLink"}))};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})(e)}function hs(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}let hc=function(e){var t=e.storyUuid,n=(0,v.useIntl)().locale;return(0,y.jsx)("section",{className:"story_container__5pgky",children:(0,y.jsxs)("div",{className:"story_containerInnerStoryBird__5pgky",children:[(0,y.jsx)("h2",{children:(0,y.jsx)(v.FormattedMessage,{id:"product.heading.origins",defaultMessage:"Origins"})}),(0,y.jsx)("div",{className:"story_flex__5pgky",children:(0,y.jsx)(an,{customClass:"fromProductProfile",product:{storyUuid:t},locale:n})})]})})};function hu(e){return(hu="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)}function hd(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 hf(e){return(hf="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)}function hm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hp(e,t,n){var r;return(r=function(e,t){if("object"!=hf(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hf(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hf(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}for(var hy=(hp(hp(hp(hp(hp(hp(hp(hp(hp(hp(t={},d9.banner,fk),d9.certifications,fN),d9.values,fz),d9.gallery,fV),d9.logo,fQ),d9.mainOrganization,function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dF(),a=dW(),l=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.banner})},[r,o]),s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.logo})},[r,o]),u=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.certifications})},[r,o]),d=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.values})},[r,o]),f=(0,c.useMemo)(function(){return i&&null!=t&&t.organization?i[null==t?void 0:t.organization]||(console.warn("ItemDataMainOrganization: no main organization"),null):null},[i,null==t?void 0:t.organization]),m=(0,c.useMemo)(function(){return a&&f?ie({organization:f6({},f),facilities:a})||(console.warn("ItemDataMainOrganization: no main facility"),null):null},[f,a]),p=(0,c.useMemo)(function(){var e,t=fp({items:r,viewItems:o,type:d9.organizationParents}),n=[];return t&&Array.isArray(t.parents)&&t.parents.length&&(null==t||null===(e=t.parents)||void 0===e||e.forEach(function(e){var t=i[e],r=iY({hyphenatedName:t.hyphenatedName,id:t.id,itemType:iZ.organization});n.push({link:r,name:t.name})})),n},[r,o,i]),h=(0,c.useMemo)(function(){var e,n,r;return f&&t?{organization:f6(f6({},f),{},{name:null!==(e=t.name)&&void 0!==e?e:f.name,description:null!==(n=t.description)&&void 0!==n?n:f.description,missionStatement:null!==(r=t.missionStatement)&&void 0!==r?r:f.missionStatement}),banner:(0,y.jsx)(fk,{item:l}),logo:(0,y.jsx)(fQ,{item:s}),certifications:u?(0,y.jsx)(fN,{item:u}):null,values:d?(0,y.jsx)(fz,{item:d}):null,parentOrganizations:p,organizations:i,mainFacility:m}:null},[i,m,f,t,l,u,d,p,s]);return h?(0,y.jsx)(f8,f6({},h)):null}),d9.mainProduct,function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dW(),a=dF(),l=d5(),s=na(),u=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.gallery})},[r,o]),d=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.certifications})},[r,o]),f=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.values})},[r,o]),m=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productAnnualProduction})},[r,o]),p=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productAvailability})},[r,o]),h=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productOrganization})},[r,o]),v=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productPrice})},[r,o]),g=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productProductionPeriods})},[r,o]),b=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productSpecSheets})},[r,o]),j=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productStorageType})},[r,o]),_=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.productSupplyChainRoles})},[r,o]),w=(0,c.useMemo)(function(){return l&&null!=t&&t.product?l[t.product]:null},[t,l]),x=(0,c.useMemo)(function(){var e;return"object"===mJ(a)&&null!=h&&h.organization?a[h.organization]:"object"===mJ(a)&&null!=w&&w.organization?a[w.organization]:"object"===mJ(a)&&1===(null===(e=Object.keys(a))||void 0===e?void 0:e.length)?a[Object.keys(a)[0]]:null},[w,h,a]),S=(0,c.useMemo)(function(){return ie({organization:x,facilities:i})},[i,x]),O=(0,c.useMemo)(function(){var e=[];return j&&m$({enums:s,enumName:"storageTypes",enumValue:j.storageType})&&e.push((0,y.jsx)(mI,{item:j},0)),m&&m.high&&m.low&&m$({enums:s,enumName:"productionUnitTypes",enumValue:m.unit})&&e.push((0,y.jsx)(mo,{item:m},1)),v&&v.max!==v.min&&"0"!==v.min&&e.push((0,y.jsx)(mm,{item:v},3)),g&&Array.isArray(g.productionPeriods)&&g.productionPeriods.length&&e.push((0,y.jsx)(mw,{item:g},5)),b&&Array.isArray(b.media)&&b.media.length&&e.push((0,y.jsx)(mk,{item:b},6)),e},[s,m,p,v,g,b,j,_]),k=(0,c.useMemo)(function(){if(!w)return null;var e,n,r,o,i=!1;return null!=d&&null!==(e=d.certifications)&&void 0!==e&&e.length||null!=w&&null!==(n=w.certifications)&&void 0!==n&&n.length||(i=!0),{product:mY(mY({},w),{},{name:null!==(r=null==t?void 0:t.name)&&void 0!==r?r:null==w?void 0:w.name,description:null!==(o=null==t?void 0:t.description)&&void 0!==o?o:null==w?void 0:w.description}),gallery:(0,y.jsx)(fV,{item:u}),certifications:d?(0,y.jsx)(fN,{item:d}):null,values:f?(0,y.jsx)(fz,{item:f}):null,productDetails:O,productOrganization:(0,y.jsx)(mc,{item:h}),productOrganizationParents:(0,y.jsx)(mV,{}),mainFacility:S,organization:x,products:l,hideCertifications:i}},[d,f,u,t,S,w,h,x,O,l]);return k?(0,y.jsx)(f7,mY({},k)):null}),d9.map,function(e){e.item;var t=dE(),n=t.items,r=t.viewItems,o=dW(),i=dF(),a=d5(),l=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.story})},[n,r]),s=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.mainOrganization})},[n,r]),u=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.mainProduct})},[n,r]),d=(0,c.useMemo)(function(){return a&&null!=u&&u.product?a[u.product]||(console.warn("ItemDataMap: no main product"),null):null},[a,u]),f=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.productOrganization})},[n,r]),m=(0,c.useMemo)(function(){return i?null!=s&&s.organization?i[s.organization]:null!=f&&f.organization?i[f.organization]:d&&d.organization?i[d.organization]:null:null},[i,a,d,s,f]),p=(0,c.useMemo)(function(){return m?d&&Array.isArray(d.facilities)&&d.facilities.length?pD(pD({},m),{},{facilities:d.facilities}):m:null},[d,m,a]),h=(0,c.useMemo)(function(){if(!i||!m)return null;var e=pD({},i);return e[m.id]=p,e},[m,i]),g=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.organizationFarmers})},[n,r]),b=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.organizationMembers})},[n,r]),j=(0,c.useMemo)(function(){if(l&&l.storyUuid||!p)return null;var e=Array.isArray(null==b?void 0:b.members)&&b.members.length,t=Array.isArray(null==g?void 0:g.farmers)&&g.farmers.length;return s&&(e||t)?null:{title:s?(0,y.jsx)(v.FormattedMessage,{id:"views-map-heading",defaultMessage:"{instanceTitle}'s Location",values:{instanceTitle:p.name}}):void 0,mainOrganization:p,facilities:o,organizations:h}},[m,o,i,g,b,l]);return j?(0,y.jsx)(pz,pD({},j)):null}),d9.organizationAffiliates,function(e){var t=e.item,n=dW(),r=dF(),o=dE(),i=o.items,a=o.viewItems,l=(0,c.useMemo)(function(){var e=fp({items:i,viewItems:a,type:d9.mainOrganization});return null==e?void 0:e.organization},[i,a]),s=(0,c.useMemo)(function(){return fp({items:i,viewItems:a,type:d9.organizationFarmers})},[i,a]),u=(0,c.useMemo)(function(){return fp({items:i,viewItems:a,type:d9.organizationMembers})},[i,a]),d=(0,c.useMemo)(function(){if(!r||!l||!Array.isArray(null==t?void 0:t.affiliations)||!t.affiliations.length)return null;var e,o=null==t?void 0:t.initialSortOrder;return{affiliatesIdList:null!==(e=null==t?void 0:t.affiliations)&&void 0!==e?e:[],facilities:n,organizations:r,initialSortOrder:o,mainOrganization:r[l]}},[n,r,t,l]),f=(0,c.useMemo)(function(){if(!r||!l)return null;var e,t,o=!Array.isArray(null==u?void 0:u.members)||!u.members.length,i=!Array.isArray(null==s?void 0:s.farmers)||!s.farmers.length;return o&&i?null:{affiliatedMembersIdList:null!==(e=null==u?void 0:u.members)&&void 0!==e?e:[],smallProducersIdList:null!==(t=null==s?void 0:s.farmers)&&void 0!==t?t:[],facilities:n,organizations:r,mainOrganization:r[l]}},[n,r,s,u,l]),m=(0,c.useMemo)(function(){return!u&&!s},[u,s]);return m&&!d?null:m?(0,y.jsx)(yk,yP({},d)):m||f?(0,y.jsx)(yb,yP({},f)):null}),d9.organizationFarmers,null),hp(hp(hp(hp(hp(hp(hp(hp(hp(hp(t,d9.organizationMembers,null),d9.organizationParents,function(e){var t=e.item,n=dF(),r=(0,c.useMemo)(function(){return n&&Array.isArray(null==t?void 0:t.parents)&&t.parents.length?{isOrganizationView:!0,organizations:t.parents.reduce(function(e,t){return n[t]?e.concat(n[t]):e},[])}:null},[t,n]);return r?(0,y.jsx)(mH,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yN(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yI(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yI(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},r)):null}),d9.organizationProducts,function(e){var t=e.item,n=dE(),r=n.items,o=n.viewItems,i=dW(),a=d5(),l=dF(),s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainOrganization})},[r,o]),u=(0,c.useMemo)(function(){return null!=s&&s.organization&&l?l[s.organization]:null},[s,l]),d={products:(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.products)?t.products.reduce(function(e,t){var n=a[t];if(!n)return e;var r=yB({},u);return Array.isArray(n.facilities)&&n.facilities.length&&(r.facilities=n.facilities),e.concat(yB(yB({},n),{},{organization:yB(yB({},r),{},{facility:ie({organization:r,facilities:i})})}))},[]):[]},[i,a,u,t])};return(0,y.jsx)(yA,yB({},d))}),d9.organizationFarmers,function(e){var t=e.item,n=dW(),r=dF(),o=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.farmers)?t.farmers.reduce(function(e,t){var o=r[t];return o?e.concat(yU(yU({},o),{},{facility:ie({organization:o,facilities:n})})):e},[]):[]},[n,r,t]);return(0,c.useMemo)(function(){return Array.isArray(o)&&o.length?{farmers:o}:null},[o]),null}),d9.organizationStories,function(e){e.item;var t,n=dE(),r=n.items,o=n.viewItems,i=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return yQ(e,2);var n=({}).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)?yQ(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],s=(0,c.useMemo)(function(){return fp({items:r,viewItems:o,type:d9.mainOrganization})},[r,o]);(0,c.useEffect)(function(){null!=s&&s.pmktUuid?yZ(s.pmktUuid).then(function(e){return l(e)}):null!=s&&s.organization&&yZ(s.organization).then(function(e){return l(e)})},[s]);var u=(0,c.useMemo)(function(){return null!=s&&s.organization?{stories:a}:null},[s,a]);return s?(0,y.jsx)(yH,function(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){(function(e,t,n){var r;(r=function(e,t){if("object"!=yJ(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yJ(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yJ(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(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}({},u)):null}),d9.productAnnualProduction,mo),d9.productAvailability,function(e){var t=e.item,n=(0,c.useMemo)(function(){return void 0===(null==t?void 0:t.available)||void 0===(null==t?void 0:t.stock)||void 0===(null==t?void 0:t.unit)||null===t.available||null===t.stock||null===t.unit?null:{available:t.available,stock:t.stock,unit:t.unit}},[t]);return n?(0,y.jsx)(yK,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y0(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=yX(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yX(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==yX(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y0(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null}),d9.productOrganization,mc),d9.productPrice,mm),d9.productSpecSheets,mk),hp(hp(hp(hp(hp(hp(t,d9.productStorageType,mI),d9.productSupplyChainRoles,function(e){var t=e.item,n=(0,c.useMemo)(function(){return Array.isArray(null==t?void 0:t.eventTypes)&&t.eventTypes.length?{eventTypes:t.eventTypes}:null},[t]);return n?(0,y.jsx)(mT,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mE(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=mL(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=mL(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==mL(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null}),d9.productRelatedProducts,function(e){var t,n=e.item,r=e.preview,o=dE(),i=o.items,a=o.viewItems,l=dF(),s=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,0)||function(e,t){if(e){if("string"==typeof e)return y7(e,2);var n=({}).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)?y7(e,2):void 0}}(t,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=s[0],d=s[1],f=(0,c.useMemo)(function(){return fp({items:i,viewItems:a,type:d9.mainProduct})},[i,a]),m=(0,c.useMemo)(function(){return fp({items:i,viewItems:a,type:d9.productOrganization})},[i,a]),p=(0,c.useMemo)(function(){var e;return"object"===y9(l)&&null!=m&&m.organization?l[m.organization]:"object"===y9(l)&&null!=f&&f.organization?l[f.organization]:"object"===y9(l)&&1===(null===(e=Object.keys(l))||void 0===e?void 0:e.length)?l[Object.keys(l)[0]]:null},[f,m,l]);return(0,c.useEffect)(function(){f&&null!=p&&p.name&&!r?(function(e){return y6.apply(this,arguments)})(p.id).then(function(e){Array.isArray(e)&&e.length>0&&d(e.filter(function(e){return e.objectId!==f.product}))}).catch(function(e){console.error("getProductsByOrganization, error response",e)}):d([])},[f,p,n]),u.length?(0,y.jsx)(y2,{products:u}):null}),d9.snapshot,function(e){var t=e.item,n=(0,c.useMemo)(function(){return t.snapshot?{snapshot:t.snapshot}:null},[t]);return n?(0,y.jsx)(he,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hn(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==ht(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null}),d9.socialLink,function(e){e.item;var t=dE(),n=t.items,r=t.viewItems,o=dF(),i=d5(),a=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.mainOrganization})},[n,r]),l=(0,c.useMemo)(function(){return fp({items:n,viewItems:r,type:d9.mainProduct})},[n,r]),s=(0,c.useMemo)(function(){return o&&null!=a&&a.organization?o[a.organization]:null},[a,o]),u=(0,c.useMemo)(function(){return i&&null!=l&&l.product?i[l.product]:null},[l,i]),d=(0,c.useMemo)(function(){return Array.isArray(null==s?void 0:s.social)&&s.social.length?s.social:Array.isArray(null==u?void 0:u.social)&&u.social.length?u.social:null},[s,u]),f=(0,c.useMemo)(function(){return Array.isArray(d)&&d.length?{name:null==s?void 0:s.name,socialLinks:d}:null},[s,d]);return f?(0,y.jsx)(ha,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hs(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hl(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},f)):null}),d9.story,function(e){var t=e.item,n=(0,c.useMemo)(function(){return t.storyUuid?{storyUuid:t.storyUuid}:null},[t]);return n?(0,y.jsx)(hc,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hd(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=hu(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hu(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hu(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n)):null})),hh=0,hv=Object.entries(hy);hh<hv.length;hh++){var hg=function(e){if(Array.isArray(e))return e}(o=hv[hh])||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(o,0)||function(e,t){if(e){if("string"==typeof e)return hm(e,2);var n=({}).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)?hm(e,2):void 0}}(o,0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),hb=hg[0];if("undefined"===hg[1])throw Error("[dev] view:viewItem: bad imports for ".concat(hb))}for(var hj=0,h_=Object.entries(d9);hj<h_.length;hj++){var hw=h_[hj];"undefined"===hy[hw]&&(console.warn("[dev] view::viewItem: missing component mapping for ".concat(hw)),hy[hw]=fv)}let hx=function(e){var t=e.preview,n=dE(),r=n.items,o=n.viewItems;return(0,c.useMemo)(function(){return function e(t){var n=t.items,r=t.viewItems,o=t.preview;if(!Array.isArray(n)||0===n.length)return[];for(var i=[],a=function(e){var t=e.items,n=e.viewItems;try{var r,o=null,i=null===(r=fm({items:t,viewItems:n}))||void 0===r?void 0:r.type;return t.map(function(e){switch(t=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.viewItemId,r=t.viewItems;if("object"!==ff(r)||!r)throw Error("view::item::getType: invalid viewItems, has to be a object");if("object"!==ff(r[n])||!r[n]){var o="view::item::getType: invalid viewItems/viewItemId"+", has to be a object ".concat(ff(r),",").concat(n);throw console.error(o),Error(o)}return"string"==typeof(null===(e=r[n])||void 0===e?void 0:e.type)&&r[n].type.length&&Object.values(d9).includes(r[n].type)?r[n].type:null}({viewItemId:e,viewItems:n}),i){case d9.mainOrganization:o=fh;break;case d9.mainProduct:default:o=fy}var t,r=0;return(null===t||(r=o.indexOf(t))<0)&&(r=Number.MAX_SAFE_INTEGER),{viewItemId:e,orderIndex:r}}).sort(function(e,t){return e.orderIndex-t.orderIndex}).map(function(e){return e.viewItemId})}catch(e){return console.warn("view::item::sortItems inconsistency with available itemDataTypes - returning unsorted",{error:e,viewItemIds:t,viewItems:n}),t}}({items:n,viewItems:r});a.length;)(function(){var t,n=r[a[0]];if(void 0===n||!n)return console.warn("view::getItemDataComponents inconsistent items list - ignoring item"),a.shift();if("boolean"==typeof n.visible&&!1===n.visible)return a.shift();var l=[],s=hy[t=({type:n.type}).type]?{component:hy[t],children:d7[t].children,consumed:d7[t].consuming}:(console.warn("viewItem::getItemDataComponent bad type ".concat(t," using default")),{component:fv,children:[],consumed:[t]}),c=s.consumed,u=s.component,d=s.children;a=a.filter(function(e){var t=r[e];return!(null==t||!t.id||c.includes(t.type))}),Array.isArray(d)&&(l=e({items:d.reduce(function(e,t){var n=fp({type:t,items:r});return n?e.concat(n):e},[]),viewItems:r})),i.push((0,y.jsx)(u,{item:n,preview:o,children:l},n.id))})();return i}({items:r,viewItems:o,preview:t})},[r,o,t])};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})(e)}var hO=["facilities","organizations","products","viewItems","items","seoOptions","loading","availableLanguages","privacyLinkDisabled","termsLinkDisabled","preview","appWrapper"];function hk(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 hC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hk(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=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 TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hS(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hM(e){return function(e){if(Array.isArray(e))return hI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hP(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hP(e,t){if(e){if("string"==typeof e)return hI(e,t);var n=({}).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)?hI(e,t):void 0}}function hI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var hN=[{id:"0",type:"organizationStories"},{id:"1",type:"productRelatedProducts"}];let hT=function(e){var t=e.facilities,n=e.organizations,r=e.products,o=e.viewItems,i=e.items,a=e.seoOptions,l=e.loading,s=(e.availableLanguages,e.privacyLinkDisabled,e.termsLinkDisabled,e.preview),u=e.appWrapper,d=void 0===u?function(e){var t=e.children;return(0,y.jsx)(y.Fragment,{children:t})}:u,f=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,hO),m=(0,c.useMemo)(function(){return hN.length>0?[].concat(hM(i),hM(hN.map(function(e){return e.id}))):i},[i]),p=(0,c.useMemo)(function(){return function(e){var t,n=hC({},e),r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=hP(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(hN);try{for(r.s();!(t=r.n()).done;)(function(){var r=t.value;!Object.entries(e).find(function(e){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,l=[],s=!0,c=!1;try{for(i=(n=n.call(e)).next;!(s=(r=i.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,2)||hP(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1].type===r.type})&&(n[r.id]=r)})()}catch(e){r.e(e)}finally{r.f()}var o=Object.keys(n).map(function(e){return n[e]}).filter(function(e){return e.type===d9.gallery}),i=o.reduce(function(e,t){var n;return[].concat(hM(e),hM(null!==(n=null==t?void 0:t.media)&&void 0!==n?n:[]))},[]);return o.forEach(function(e){n[e.id].media=i}),n}(o)},[o]),h=(0,c.useMemo)(function(){return function(e){var t=e.items,n=e.viewItems;if(!Array.isArray(t)||!t.length)return console.warn("viewItem::getViewIsValid: no view items",{items:t,viewItems:n}),!1;if(!n||!Array.isArray(Object.keys(n)))return console.warn("viewItem::getViewIsValid: no viewItems map",{items:t,viewItems:n}),!1;var r=[],o=t.find(function(e){return n[e].type===d9.mainOrganization}),i=t.find(function(e){return n[e].type===d9.mainProduct});if(o&&(r=[d9.mainOrganization]),i&&(r=[d9.mainProduct]),o&&i)return console.warn("viewItem::getViewIsValid invalid mainOrganization in product view"),!1;var a,l=0,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fc(e,void 0);var n=({}).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)?fc(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(s.s();!(a=s.n()).done;){var c=n[a.value];r.includes(c.type)&&l++}}catch(e){s.e(e)}finally{s.f()}return l==r.length||(console.warn("viewItem::getViewIsValid required view items missing",{requiredItems:r,available:t.map(function(e){return n[e].type})}),!1)}({items:i,viewItems:o})},[i,o]),v=(0,c.useMemo)(function(){return h?fm({items:i,viewItems:o}):null},[h,i,o]),g=(0,c.useMemo)(function(){if(!v)return null;var e=null,t=null,l="No Name";if(v.organization){l=null===(s=n[v.organization])||void 0===s?void 0:s.name,e=null!==(c=null===(u=n[v.organization])||void 0===u||null===(u=u.story)||void 0===u?void 0:u.toString())&&void 0!==c?c:"";var s,c,u,d=fp({items:i,viewItems:o,type:d9.banner});t=i2({itemType:iZ.organization,media:null==d?void 0:d.media})}if(v.product){l=null===(f=r[v.product])||void 0===f?void 0:f.name,e=null!==(m=null===(p=r[v.product])||void 0===p||null===(p=p.description)||void 0===p?void 0:p.toString())&&void 0!==m?m:"";var f,m,p,y=fp({items:i,viewItems:o,type:d9.gallery});t=i2({itemType:iZ.product,media:null==y?void 0:y.media})}return hC({description:e,imageUrl:t,title:l},a)},[i,o,v,n,r,a]);return lV(),l?(0,y.jsx)(nj,{}):h?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(tx(),{children:(0,y.jsx)(dN,hC({},f))}),(0,y.jsx)(tP,hC({},g)),(0,y.jsx)(d,{viewEnums:f.enums,children:(0,y.jsx)(ea,{owner:"ViewPageComponent",children:(0,y.jsxs)("div",{className:"main",children:[(0,y.jsx)(dL,{items:m,viewItems:p,children:(0,y.jsx)(dA,{organizations:n,children:(0,y.jsx)(dB,{facilities:t,children:(0,y.jsx)(dU,{products:r,children:(0,y.jsx)(hx,{preview:void 0!==s&&s})})})})}),(0,y.jsx)(iW,{})]})})})]}):(sH().notifyError("View page with invalid data items and viewItems","View page items and viewItems validation"),(0,y.jsx)(tq,{appName:"Marketplace",appWrapper:d,statusCode:404}))},hL={social:"socialProfiles_social__hnbt2",disabled:"socialProfiles_disabled__hnbt2"},hE=function(e){var t=e.disableAllLinks,n=e.socialLinks;return(0,y.jsxs)("ul",{className:"".concat(hL.social," ").concat(t?hL.disabled:""),children:[(0,y.jsx)("li",{children:(0,y.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.instagramUrl,children:(0,y.jsx)(f(),{className:hL.icon,src:"/images/common/icons/social/icon-instagram--gold-black.svg",alt:"Instagram Icon",width:37,height:37})})}),(0,y.jsx)("li",{children:(0,y.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.xUrl,children:(0,y.jsx)(f(),{className:hL.icon,src:"/images/common/icons/social/icon-x--gold-black.svg",alt:"Twitter Icon",width:37,height:37})})}),(0,y.jsx)("li",{children:(0,y.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.facebookUrl,children:(0,y.jsx)(f(),{className:hL.icon,src:"/images/common/icons/social/icon-facebook--gold-black.svg",alt:"Facebook Icon",width:37,height:37})})}),(0,y.jsx)("li",{children:(0,y.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.linkedinUrl,children:(0,y.jsx)(f(),{className:hL.icon,src:"/images/common/icons/social/icon-linkedin--gold-black.svg",alt:"LinkedIn Icon",width:37,height:37})})})]})},hz={styleOrderAntAsCommon:"_styleOrder_styleOrderAntAsCommon__3ygcx"},hA=function(){return j.message.success("style order loaded"),(0,y.jsxs)("div",{className:hz.styleOrderAntAsCommon,children:[(0,y.jsxs)("div",{className:hz.beforeResult,children:[(0,y.jsxs)("div",{className:hz.beforeCollapse,children:[(0,y.jsx)(j.Avatar,{}),(0,y.jsx)(j.Breadcrumb,{}),(0,y.jsx)(j.Divider,{}),(0,y.jsx)(j.Image,{}),(0,y.jsxs)("div",{className:hz.beforeLayout,children:[(0,y.jsx)(j.Row,{}),(0,y.jsx)(j.Col,{}),(0,y.jsxs)("div",{children:[(0,y.jsx)(j.Space,{}),(0,y.jsx)(j.Space.Item,{})]}),(0,y.jsx)(j.Layout,{}),(0,y.jsx)(j.Layout.Sider,{}),(0,y.jsx)(j.Layout.Header,{}),(0,y.jsx)(j.Layout.Content,{})]}),(0,y.jsx)(j.Descriptions,{}),(0,y.jsx)(j.Descriptions.Item,{}),(0,y.jsx)(j.Alert,{}),(0,y.jsx)(j.Carousel,{}),(0,y.jsx)(j.Card,{}),(0,y.jsx)(j.List,{}),(0,y.jsx)(j.List.Item,{}),(0,y.jsx)(j.Menu,{}),(0,y.jsx)(j.Menu.Item,{}),(0,y.jsx)(j.Menu.SubMenu,{}),(0,y.jsx)(j.Modal,{}),(0,y.jsx)(j.Popover,{}),(0,y.jsx)(j.Tabs,{}),(0,y.jsx)(j.Tabs.TabPane,{}),(0,y.jsxs)("div",{className:hz.beforeForm,children:[(0,y.jsx)(j.Empty,{}),(0,y.jsx)(j.Select,{}),(0,y.jsx)(j.Select.Option,{}),(0,y.jsxs)("div",{className:hz.beforeUpload,children:[(0,y.jsx)(j.Table,{}),(0,y.jsx)(j.Progress,{}),(0,y.jsx)(j.Tooltip,{}),(0,y.jsx)(j.Upload,{})]}),(0,y.jsx)(j.Radio,{}),(0,y.jsx)(j.Input,{}),(0,y.jsx)(j.Dropdown,{}),(0,y.jsx)(j.Checkbox,{}),(0,y.jsx)(j.Button,{}),(0,y.jsx)(j.Form,{}),(0,y.jsx)(j.Form.Item,{})]}),(0,y.jsx)(j.Pagination,{}),(0,y.jsx)(j.Spin,{}),(0,y.jsx)(j.Grid,{}),(0,y.jsx)(j.Collapse,{}),(0,y.jsx)(j.Collapse.Panel,{})]}),(0,y.jsx)(j.Result,{})]}),(0,y.jsxs)("div",{className:hz.icons,children:[(0,y.jsx)(rC.BlockOutlined,{}),(0,y.jsx)(rC.DeleteOutlined,{}),(0,y.jsx)(rC.DownloadOutlined,{}),(0,y.jsx)(rC.EditOutlined,{}),(0,y.jsx)(rC.HomeOutlined,{}),(0,y.jsx)(rC.InfoCircleOutlined,{}),(0,y.jsx)(rC.LinkOutlined,{}),(0,y.jsx)(rC.LoadingOutlined,{}),(0,y.jsx)(rC.LogoutOutlined,{}),(0,y.jsx)(rC.PlusOutlined,{}),(0,y.jsx)(rC.QuestionOutlined,{}),(0,y.jsx)(rC.SearchOutlined,{}),(0,y.jsx)(rC.SyncOutlined,{}),(0,y.jsx)(rC.UploadOutlined,{})]})]})},hF=function(e){var t=e.href,n=e.children;return"string"==typeof t?(0,y.jsx)(x(),{href:t,children:n}):(console.warn("ValidatedLink:: link without href"),(0,y.jsx)(y.Fragment,{children:n}))};var hD=function(e,t){return e.distance<t.distance?-1:e.distance>t.distance?1:0};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})(e)}function hW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hR(e){return(hR="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)}function hU(e){var t=e.products,n=e.events,r=e.removeFacilities;if(0!==r.length&&n&&"object"===hR(n)&&t&&"object"===hR(t)){var o=[];r.forEach(function(e){Object.keys(n).forEach(function(t){var r=n[t];r.facility===e&&o.push(t),r.sourceFacility===e&&o.push(t),r.destinationFacility===e&&o.push(t)})}),Object.keys(t).forEach(function(e){var n=t[e];o.forEach(function(e){var t=n.events.indexOf(e);-1!==t&&n.events.splice(t,1)})}),o.forEach(function(e){delete n[e]})}}var hH={disabled:"disabled",actual:"actual",africa:"africa",australia:"australia",asia:"asia",europe:"europe",northAmerica:"north america",southAmerica:"south america"};function hq(){hq=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(t,n,r,i){var a,l,s=Object.create((n&&n.prototype instanceof h?n:h).prototype);return o(s,"_invoke",{value:(a=new C(i||[]),l=f,function(n,o){if(l===m)throw Error("Generator is already running");if(l===p){if("throw"===n)throw o;return{value:e,done:!0}}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var s=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),y;var a=d(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var l=a.arg;return l?l.done?(r[n.resultName]=l.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,y)}(i,a);if(s){if(s===y)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===f)throw l=p,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=m;var c=d(t,r,a);if("normal"===c.type){if(l=a.done?p:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:a.done}}"throw"===c.type&&(l=p,a.method="throw",a.arg=c.arg)}})}),s}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",m="executing",p="completed",y={};function h(){}function v(){}function g(){}var b={};c(b,a,function(){return this});var j=Object.getPrototypeOf,_=j&&j(j(M([])));_&&_!==n&&r.call(_,a)&&(b=_);var w=g.prototype=h.prototype=Object.create(b);function x(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){var n;o(this,"_invoke",{value:function(o,i){function a(){return new t(function(n,a){(function n(o,i,a,l){var s=d(e[o],e,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==hG(u)&&r.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,a,l)},function(e){n("throw",e,a,l)}):t.resolve(u).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,l)})}l(s.arg)})(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw TypeError(hG(t)+" is not iterable")}return v.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:v,configurable:!0}),v.displayName=c(g,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,c(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},x(S.prototype),c(S.prototype,l,function(){return this}),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new S(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},x(w),c(w,s,"Generator"),c(w,a,function(){return this}),c(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=M,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:M(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function hG(e){return(hG="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)}function hV(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function hZ(){var e;return e=hq().mark(function e(t,n){var r,o,i,a,l,s;return hq().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.locale===(null===(r=t.router)||void 0===r||null===(r=r.query)||void 0===r?void 0:r.lang)?"url":"intl",i={headers:{"x-view-locale":t.locale,"x-locale-source":o}},e.next=5,function(e,t){return t5.apply(this,arguments)}(n,i);case 5:return a=e.sent,_.load(a),e.prev=9,e.next=12,function(e,t){var n,r=[];if("string"==typeof e.nearbyFacilities&&""!==e.nearbyFacilities&&(r=e.nearbyFacilities.split(",")),Array.isArray(e.nearbyFacilities)&&e.nearbyFacilities.length&&(r=e.nearbyFacilities),0===r.length)return Promise.reject();if(void 0===hH.disabled||!navigator.geolocation)return hU({events:e.events,products:e.products,removeFacilities:r}),Promise.resolve(e);var o=function(t){return function(e){var t=e.nearbyFacilities,n=e.location,r=e.facilities,o=e.events;if(Array.isArray(t)){var i,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return hW(e,void 0);var n=({}).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)?hW(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(t);try{for(a.s();!(i=a.n()).done;){var l=function(e){var t=e.location,n=e.defaultFacility,r=e.facilities,o=[];if(""===t.lat||""===t.lng||!n)return null;var i=r[n];if(!i)for(var a=0,l=Object.keys(r);a<l.length;a++){var s=r[l[a]];if(s.hyphenatedName===n){i=s;break}}return(Object.keys(r).forEach(function(e){var a=r[e];if(a.updateNearbyFor===n||a.updateNearbyFor===i.hyphenatedName||a.id===n||a.hyphenatedName===n){var l=(0,a7.computeDistanceBetween)(a.location.coordinates[0],t);o.push({distance:l,facility:a})}}),0===o.length)?null:o.sort(hD)[0].facility}({location:n,defaultFacility:i.value,facilities:r});l&&function(e){var t=e.events,n=e.currentFacilityId,r=e.newFacilityId;t&&"object"===hB(t)&&Object.keys(t).forEach(function(e){var o=t[e];void 0===o.facility||o.facility!==n||(o.facility=r),void 0===o.sourceFacility||o.sourceFacility!==n||(o.sourceFacility=r),void 0===o.destinationFacility||o.destinationFacility!==n||(o.destinationFacility=r)})}({events:o,currentFacilityId:l.updateNearbyFor,newFacilityId:l.id})}}catch(e){a.e(e)}finally{a.f()}}}({location:{lat:t.lat,lng:t.lng},facilities:e.facilities,events:e.events,products:e.products,nearbyFacilities:r}),Promise.resolve(e)};return new Promise(function(t,n){navigator.geolocation.getCurrentPosition(function(e){o({lat:e.coords.latitude,lng:e.coords.longitude}).then(function(e){t(e)}).catch(n)},function(n){console.warn("updateDynamicFields::error getting actual user position",{error:n}),hU({events:e.events,products:e.products,removeFacilities:r}),t(e)})})}(a);case 12:e.next=16;break;case 14:e.prev=14,e.t0=e.catch(9);case 16:if(t.setData(a),"string"!=typeof a.forceLocale||"url"===o){e.next=30;break}return e.next=21,t4(a.forceLocale);case 21:if(0!==Object.keys(l=e.sent).length){e.next=24;break}return e.abrupt("return");case 24:t.setIntl((0,v.createIntl)({locale:a.forceLocale,messages:l})),b().locale(a.forceLocale),e.next=37;break;case 30:if(t.locale===t.intl.locale){e.next=36;break}return e.next=34,t4(t.locale);case 34:s=e.sent,t.setIntl((0,v.createIntl)({locale:t.locale,messages:s}));case 36:b().locale(t.locale);case 37:"string"==typeof a.googleAnalyticsId&&"object"===("undefined"==typeof window?"undefined":hG(window))&&"function"==typeof window.gtag&&window.gtag("config",a.googleAnalyticsId),a.fetching=!1,a.fetchComplete=!0,t.setData(a);case 41:case"end":return e.stop()}},e,null,[[9,14]])}),(hZ=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){hV(i,r,o,a,l,"next",e)}function l(e){hV(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}function hY(e){return(hY="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)}var hJ=["component","type","uuid","appWrapper"];function h$(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 hQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h$(Object(n),!0).forEach(function(t){(function(e,t,n){var r;(r=function(e,t){if("object"!=hY(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=hY(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==hY(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hK(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,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return hX(e,t);var n=({}).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)?hX(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let h0=function(e){var t,n,r=e.component,o=e.type,i=e.uuid,a=e.appWrapper,l=void 0===a?function(e){var t=e.children;return(0,y.jsx)(y.Fragment,{children:t})}:a,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||({}).propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,hJ),u=(0,S.useRouter)(),d=hK((0,c.useState)(null),2),f=d[0],m=d[1],p=hK((0,c.useState)((0,v.useIntl)()),2),h=p[0],g=p[1],b=hK((0,c.useState)(null!==(t=null==u||null===(n=u.query)||void 0===n?void 0:n.lang)&&void 0!==t?t:h.locale),2),j=b[0],_=b[1],w={setData:m,setIntl:g,locale:j,intl:h};return(0,c.useEffect)(function(){var e;if(null!=f&&f.availableLanguages){var t=(null==u||null===(e=u.query)||void 0===e?void 0:e.lang)||h.locale;if(!f.availableLanguages.includes(t)){if(t.includes("-")){var n=t.split("-")[0];t=f.availableLanguages.includes(n)&&n.length>0?n:f.availableLanguages[0]}else t=f.availableLanguages[0]}"string"==typeof t&&h.locale!==t&&_(t)}},[u,null==f?void 0:f.availableLanguages,h.locale]),(0,c.useEffect)(function(){o&&i&&(function(e,t){return hZ.apply(this,arguments)})(w,i).then(function(){"undefined"!=typeof window&&eW("View page loaded",{category:"Navigation",label:"pageview",value:u.asPath,referrer:null})}).catch(function(e){var t,n,r,o;return n=(t={code:e.code,message:e.message,state:w}).code,r=t.message,o=t.state,void(console.error("FillViewData error",n,r),404!==n?o.setData({type:"error",code:n,msg:r,fetchComplete:!0}):o.setData({type:"error",code:404,fetchComplete:!0}))})},[j,o,i]),f&&"error"===f.type?(0,y.jsx)(tq,{appName:"Marketplace",err:404!==f.code?f.msg:null,statusCode:f.code,appWrapper:l}):(0,y.jsx)(v.IntlProvider,hQ(hQ({},h),{},{locale:j,children:(0,y.jsx)(r,hQ(hQ(hQ({},s),f),{},{loading:!f,appWrapper:l}))}))}})(),t.BlockChainLogo=l.BlockChainLogo,t.BlockchainProofDetail=l.BlockchainProofDetail,t.BuyAction=l.BuyAction,t.CookieWarning=l.CookieWarning,t.CustomError=l.CustomError,t.EnumContextProvider=l.EnumContextProvider,t.ExternLink=l.ExternLink,t.FacilityModalContent=l.FacilityModalContent,t.FillViewData=l.FillViewData,t.FooterSection=l.FooterSection,t.FormattedDateSpan=l.FormattedDateSpan,t.FormattedText=l.FormattedText,t.HeaderSection=l.HeaderSection,t.InfoWindowContent=l.InfoWindowContent,t.IntercomContextProvider=l.IntercomContextProvider,t.IntlLink=l.IntlLink,t.JourneySummary=l.JourneySummary,t.Loader=l.Loader,t.Location=l.Location,t.MetaTags=l.MetaTags,t.NavModals=l.NavModals,t.NewsletterForm=l.NewsletterForm,t.OrganizationCard=l.OrganizationCard,t.OrganizationStoriesCarousel=l.OrganizationStoriesCarousel,t.OriginNavSlider=l.OriginNavSlider,t.OriginSteps=l.OriginSteps,t.OriginsMap=l.OriginsMap,t.ProductCard=l.ProductCard,t.ProductSteps=l.ProductSteps,t.ReadMoreReadLess=l.ReadMoreReadLess,t.SmallFarmerCard=l.SmallFarmerCard,t.SocialProfiles=l.SocialProfiles,t.StoryBird=l.StoryBird,t.StoryClaim=l.StoryClaim,t.StoryClaimModalContent=l.StoryClaimModalContent,t.StoryHeaderSection=l.StoryHeaderSection,t.StyleOrder=l.StyleOrder,t.SupplyStep=l.SupplyStep,t.ThemeContext=l.ThemeContext,t.Themeable=l.Themeable,t.ValidatedLink=l.ValidatedLink,t.ViewPage=l.ViewPage,t.apiMBWithClusters=l.apiMBWithClusters,t.createIntlUrl=l.createIntlUrl,t.defaultBreakpointFunctions=l.defaultBreakpointFunctions,t.enableTracking=l.enableTracking,t.enumsClientInstance=l.enumsClientInstance,t.eventGA=l.eventGA,t.getThemeNames=l.getThemeNames,t.initGoogleAnalytics=l.initGoogleAnalytics,t.isTrackingEnabled=l.isTrackingEnabled,t.loadMapBoxStyles=l.loadMapBoxStyles,t.noFormatting=l.noFormatting,t.pageviewGA=l.pageviewGA,t.sentry=l.sentry,t.setBasePath=l.setBasePath,t.setMapboxFiles=l.setMapboxFiles,t.setTheme=l.setTheme,t.setThemeFiles=l.setThemeFiles,t.stepDurationTracker=l.stepDurationTracker,t.trackPageView=l.trackPageView,t.trackingEvent=l.trackingEvent,t.useIntercomContext=l.useIntercomContext,t.windowSizeCondition=l.windowSizeCondition,t.withWindowSize=l.withWindowSize,Object.defineProperty(t,"__esModule",{value:!0})})()}}]);