-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7178-03d0b5d104ff427143b7.js
1 lines (1 loc) · 16.7 KB
/
7178-03d0b5d104ff427143b7.js
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7178],{27894:function(t,e,n){t.exports=n(69249)},2485:function(t,e,n){"use strict";var r=n(76493),i=n(45428),o=n(3054),s=n(97901),a=n(12905),l=["projectId","dataset","imageOptions","ignoreUnknownTypes"],u={imageOptions:{},ignoreUnknownTypes:!0};function c(t){return"block"===t._type&&t.listItem}t.exports=function(t,e,n,f){var h=r({},u,e),p=Array.isArray(h.blocks)?h.blocks:[h.blocks],d=s(p),m=o(d,h.listNestMode),y=a(n,h.serializers||{}),g=l.reduce((function(t,e){var n=h[e];return"undefined"!==typeof n&&(t[e]=n),t}),{});function v(e,n,r,o){return"list"===(s=e)._type&&s.listItem?function(e){var n=e.listItem,r=e.level,i=e._key,o=e.children.map(v);return t(y.list,{key:i,level:r,type:n,options:g},o)}(e):c(e)?function(e,n){var r=e._key,o=i(e).map(v);return t(y.listItem,{node:e,serializers:y,index:n,key:r,options:g},o)}(e,function(t,e){for(var n=0,r=0;r<e.length;r++){if(e[r]===t)return n;c(e[r])&&n++}return n}(e,r)):function(t){return"string"===typeof t||t.marks||"span"===t._type}(e)?f(e,y,n,{serializeNode:v}):function(e,n,r){var o=i(e).map((function(t,e,n){return v(t,e,n,!0)})),s={key:e._key||"block-".concat(n),node:e,isInline:r,serializers:y,options:g};return t(y.block,s,o)}(e,n,o);var s}var w=Boolean(h.renderContainerOnSingleChild),k=m.map(v);if(w||k.length>1){var b=h.className?{className:h.className}:{};return t(y.container,b,k)}return k[0]?k[0]:"function"===typeof y.empty?t(y.empty):y.empty}},45428:function(t){"use strict";var e=["strong","em","code","underline","strike-through"];function n(t,e,n){if(!t.marks||0===t.marks.length)return t.marks||[];var i=t.marks.reduce((function(t,r){t[r]=t[r]?t[r]+1:1;for(var i=e+1;i<n.length;i++){var o=n[i];if(!o.marks||!Array.isArray(o.marks)||-1===o.marks.indexOf(r))break;t[r]++}return t}),{}),o=r.bind(null,i);return t.marks.slice().sort(o)}function r(t,n,r){var i=t[n]||0,o=t[r]||0;if(i!==o)return o-i;var s=e.indexOf(n),a=e.indexOf(r);return s!==a?s-a:n<r?-1:n>r?1:0}t.exports=function(t){var e=t.children,r=t.markDefs;if(!e||!e.length)return[];var i=e.map(n),o={_type:"span",children:[]},s=[o];return e.forEach((function(t,e){var n=i[e];if(n){var o=1;if(s.length>1)for(;o<s.length;o++){var a=s[o].markKey,l=n.indexOf(a);if(-1===l)break;n.splice(l,1)}var u,c=function(t){for(var e=t.length-1;e>=0;e--){var n=t[e];if("span"===n._type&&n.children)return n}return}(s=s.slice(0,o));if(n.forEach((function(e){var n={_type:"span",_key:t._key,children:[],mark:r.find((function(t){return t._key===e}))||e,markKey:e};c.children.push(n),s.push(n),c=n})),"span"!==(u=t)._type||"string"!==typeof u.text||!Array.isArray(u.marks)&&"undefined"!==typeof u.marks)c.children=c.children.concat(t);else{for(var f=t.text.split("\n"),h=f.length;h-- >1;)f.splice(h,0,"\n");c.children=c.children.concat(f)}}else{s[s.length-1].children.push(t)}})),o.children}},97901:function(t,e,n){"use strict";var r=n(76493);function i(t){var e=0,n=t.length;if(0===n)return e;for(var r=0;r<n;r++)e=(e<<5)-e+t.charCodeAt(r),e&=e;return e}t.exports=function(t){return t.map((function(t){return t._key?t:r({_key:(e=t,i(JSON.stringify(e)).toString(36).replace(/[^A-Za-z0-9]/g,""))},t);var e}))}},7851:function(t,e,n){"use strict";var r=n(49801),i=n(42527),o=n(76493),s=encodeURIComponent,a="You must either:\n - Pass `projectId` and `dataset` to the block renderer\n - Materialize images to include the `url` field.\n\nFor more information, see ".concat(r("block-content-image-materializing"));t.exports=function(t){var e=t.node,n=t.options,r=n.projectId,l=n.dataset,u=e.asset;if(!u)throw new Error("Image does not have required `asset` property");if(u.url)return u.url+function(t){var e=t.imageOptions,n=Object.keys(e);if(!n.length)return"";var r=n.map((function(t){return"".concat(s(t),"=").concat(s(e[t]))}));return"?".concat(r.join("&"))}(n);if(!r||!l)throw new Error(a);if(!u._ref)throw new Error("Invalid image reference in block, no `_ref` found on `asset`");return i(o({projectId:r,dataset:l},n.imageOptions||{})).image(e).toString()}},69249:function(t,e,n){"use strict";var r=n(92190),i=n(2485),o=n(7851),s=n(12905);t.exports={blocksToNodes:function(t,e,n,o){if(n)return i(t,e,n,o);var s=r(t);return i(t,e,s.defaultSerializers,s.serializeSpan)},getSerializers:r,getImageUrl:o,mergeSerializers:s}},12905:function(t,e,n){"use strict";function r(t){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(76493);t.exports=function(t,e){return Object.keys(t).reduce((function(n,o){var s=r(t[o]);return n[o]="function"===s?"undefined"!==typeof e[o]?e[o]:t[o]:"object"===s?i({},t[o],e[o]):"undefined"===typeof e[o]?t[o]:e[o],n}),{})}},3054:function(t,e,n){"use strict";var r=n(76493);function i(t){return Boolean(t.listItem)}function o(t,e){return t.level===e.level&&t.listItem===e.listItem}function s(t){return{_type:"list",_key:"".concat(t._key,"-parent"),level:t.level,listItem:t.listItem,children:[t]}}function a(t){return t.children&&t.children[t.children.length-1]}function l(t,e){var n="string"===typeof e.listItem;if("list"===t._type&&t.level===e.level&&n&&t.listItem===e.listItem)return t;var r=a(t);return!!r&&l(r,e)}t.exports=function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"html",u=[],c=0;c<t.length;c++){var f=t[c];if(i(f))if(e)if(o(f,e))e.children.push(f);else if(f.level>e.level){var h=s(f);if("html"===n){var p=a(e),d=r({},p,{children:p.children.concat(h)});e.children[e.children.length-1]=d}else e.children.push(h);e=h}else if(f.level<e.level){var m=l(u[u.length-1],f);if(m){(e=m).children.push(f);continue}e=s(f),u.push(e)}else if(f.listItem===e.listItem)console.warn("Unknown state encountered for block",f),u.push(f);else{var y=l(u[u.length-1],{level:f.level});if(y&&y.listItem===f.listItem){(e=y).children.push(f);continue}e=s(f),u.push(e)}else e=s(f),u.push(e);else u.push(f),e=null}return u}},92190:function(t,e,n){"use strict";var r=n(76493),i=n(7851);t.exports=function(t,e){var n=e||{useDashedStyles:!1};function o(e,n){return t(e,null,n.children)}return{defaultSerializers:{types:{block:function(e){var n=e.node.style||"normal";return/^h\d/.test(n)?t(n,null,e.children):t("blockquote"===n?"blockquote":"p",null,e.children)},image:function(e){if(!e.node.asset)return null;var n=t("img",{src:i(e)});return e.isInline?n:t("figure",null,n)}},marks:{strong:o.bind(null,"strong"),em:o.bind(null,"em"),code:o.bind(null,"code"),underline:function(e){var r=n.useDashedStyles?{"text-decoration":"underline"}:{textDecoration:"underline"};return t("span",{style:r},e.children)},"strike-through":function(e){return t("del",null,e.children)},link:function(e){return t("a",{href:e.mark.href},e.children)}},list:function(e){var n="bullet"===e.type?"ul":"ol";return t(n,null,e.children)},listItem:function(e){var n=e.node.style&&"normal"!==e.node.style?t(e.serializers.types.block,e,e.children):e.children;return t("li",null,n)},block:function(e){var n=e.node,r=e.serializers,i=e.options,o=e.isInline,s=e.children,a=n._type,l=r.types[a];if(!l){if(i.ignoreUnknownTypes)return console.warn('Unknown block type "'.concat(a,'", please specify a serializer for it in the `serializers.types` prop')),t(r.unknownType,{node:n,options:i,isInline:o},s);throw new Error('Unknown block type "'.concat(a,'", please specify a serializer for it in the `serializers.types` prop'))}return t(l,{node:n,options:i,isInline:o},s)},span:function(e){var n=e.node,r=n.mark,i=n.children,o="string"===typeof r?r:r._type,s=e.serializers.marks[o];return s?t(s,e.node,i):(console.warn('Unknown mark type "'.concat(o,'", please specify a serializer for it in the `serializers.marks` prop')),t(e.serializers.unknownMark,null,i))},hardBreak:function(){return t("br")},unknownType:function(e){return t("div",{style:{display:"none"}},'Unknown block type "'.concat(e.node._type,'", please specify a serializer for it in the `serializers.types` prop'))},unknownMark:"span",container:"div",text:void 0,empty:""},serializeSpan:function(e,n,i,o){if("\n"===e&&n.hardBreak)return t(n.hardBreak,{key:"hb-".concat(i)});if("string"===typeof e)return n.text?t(n.text,{key:"text-".concat(i)},e):e;var s;e.children&&(s={children:e.children.map((function(t,n){return o.serializeNode(t,n,e.children,!0)}))});var a=r({},e,s);return t(n.span,{key:e._key||"span-".concat(i),node:a,serializers:n})}}}},49801:function(t){t.exports=function(t){return"https://docs.sanity.io/help/"+t}},42527:function(t){t.exports=function(){function t(){return(t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function e(t,e){if(t){if("string"===typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function r(t){var n=0;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=e(t)))return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var i="image-Tb9Ew8CXIwaY6R1kjMvI0uRR-2000x3000-jpg";function o(t){var e=t.split("-"),n=e[1],r=e[2],o=e[3];if(!n||!r||!o)throw new Error("Malformed asset _ref '"+t+"'. Expected an id like \""+i+'".');var s=r.split("x"),a=+s[0],l=+s[1];if(!isFinite(a)||!isFinite(l))throw new Error("Malformed asset _ref '"+t+"'. Expected an id like \""+i+'".');return{id:n,width:a,height:l,format:o}}var s=function(t){return!!t&&"string"===typeof t._ref},a=function(t){return!!t&&"string"===typeof t._id},l=function(t){var e=t;return!(!e||!e.asset)&&"string"===typeof e.asset.url};function u(t){if(!t)return null;var e;if("string"===typeof t&&c(t))e={asset:{_ref:f(t)}};else if("string"===typeof t)e={asset:{_ref:t}};else if(s(t))e={asset:t};else if(a(t))e={asset:{_ref:t._id||""}};else if(l(t))e={asset:{_ref:f(t.asset.url)}};else{if("object"!==typeof t.asset)return null;e=t}var n=t;return n.crop&&(e.crop=n.crop),n.hotspot&&(e.hotspot=n.hotspot),h(e)}function c(t){return/^https?:\/\//.test(""+t)}function f(t){return("image-"+t.split("/").slice(-1)[0]).replace(/\.([a-z]+)$/,"-$1")}function h(e){if(e.crop&&e.hotspot)return e;var n=t({},e);return n.crop||(n.crop={left:0,top:0,bottom:0,right:0}),n.hotspot||(n.hotspot={x:.5,y:.5,height:1,width:1}),n}var p=[["width","w"],["height","h"],["format","fm"],["download","dl"],["blur","blur"],["sharpen","sharp"],["invert","invert"],["orientation","or"],["minHeight","min-h"],["maxHeight","max-h"],["minWidth","min-w"],["maxWidth","max-w"],["quality","q"],["fit","fit"],["crop","crop"],["saturation","sat"],["auto","auto"],["dpr","dpr"],["pad","pad"]];function d(e){var n=t({},e||{}),r=n.source;delete n.source;var i=u(r);if(!i)return null;var s=o(i.asset._ref||i.asset._id||""),a=Math.round(i.crop.left*s.width),l=Math.round(i.crop.top*s.height),c={left:a,top:l,width:Math.round(s.width-i.crop.right*s.width-a),height:Math.round(s.height-i.crop.bottom*s.height-l)},f=i.hotspot.height*s.height/2,h=i.hotspot.width*s.width/2,p=i.hotspot.x*s.width,d=i.hotspot.y*s.height,g={left:p-h,top:d-f,right:p+h,bottom:d+f};return n.rect||n.focalPoint||n.ignoreImageParams||n.crop||(n=t(t({},n),y({crop:c,hotspot:g},n))),m(t(t({},n),{},{asset:s}))}function m(t){var e=t.baseUrl||"https://cdn.sanity.io",n=t.asset.id+"-"+t.asset.width+"x"+t.asset.height+"."+t.asset.format,r=e+"/images/"+t.projectId+"/"+t.dataset+"/"+n,i=[];if(t.rect){var o=t.rect,s=o.left,a=o.top,l=o.width,u=o.height;(0!==s||0!==a||u!==t.asset.height||l!==t.asset.width)&&i.push("rect="+s+","+a+","+l+","+u)}t.bg&&i.push("bg="+t.bg),t.focalPoint&&(i.push("fp-x="+t.focalPoint.x),i.push("fp-y="+t.focalPoint.y));var c=[t.flipHorizontal&&"h",t.flipVertical&&"v"].filter(Boolean).join("");return c&&i.push("flip="+c),p.forEach((function(e){var n=e[0],r=e[1];"undefined"!==typeof t[n]?i.push(r+"="+encodeURIComponent(t[n])):"undefined"!==typeof t[r]&&i.push(r+"="+encodeURIComponent(t[r]))})),0===i.length?r:r+"?"+i.join("&")}function y(t,e){var n,r=e.width,i=e.height;if(!r||!i)return{width:r,height:i,rect:t.crop};var o=t.crop,s=t.hotspot,a=r/i;if(o.width/o.height>a){var l=o.height,u=l*a,c=o.top,f=(s.right-s.left)/2+s.left-u/2;f<o.left?f=o.left:f+u>o.left+o.width&&(f=o.left+o.width-u),n={left:Math.round(f),top:Math.round(c),width:Math.round(u),height:Math.round(l)}}else{var h=o.width,p=h/a,d=o.left,m=(s.bottom-s.top)/2+s.top-p/2;m<o.top?m=o.top:m+p>o.top+o.height&&(m=o.top+o.height-p),n={left:Math.max(0,Math.floor(d)),top:Math.max(0,Math.floor(m)),width:Math.round(h),height:Math.round(p)}}return{width:r,height:i,rect:n}}var g=["clip","crop","fill","fillmax","max","scale","min"],v=["top","bottom","left","right","center","focalpoint","entropy"],w=["format"];function k(t){return!!t&&"object"===typeof t.clientConfig}function b(t){for(var e,n=r(p);!(e=n()).done;){var i=e.value,o=i[0],s=i[1];if(t===o||t===s)return o}return t}function O(t){var e=t;if(k(e)){var n=e.clientConfig,r=n.apiHost,i=n.projectId,o=n.dataset;return new x(null,{baseUrl:(r||"https://api.sanity.io").replace(/^https:\/\/api\./,"https://cdn."),projectId:i,dataset:o})}return new x(null,t)}var x=function(){function e(e,n){this.options=t(e?t({},e.options||{}):{},n||{})}var n=e.prototype;return n.withOptions=function(n){var r=n.baseUrl||this.options.baseUrl,i={baseUrl:r};for(var o in n)n.hasOwnProperty(o)&&(i[b(o)]=n[o]);return new e(this,t({baseUrl:r},i))},n.image=function(t){return this.withOptions({source:t})},n.dataset=function(t){return this.withOptions({dataset:t})},n.projectId=function(t){return this.withOptions({projectId:t})},n.bg=function(t){return this.withOptions({bg:t})},n.dpr=function(t){return this.withOptions({dpr:t})},n.width=function(t){return this.withOptions({width:t})},n.height=function(t){return this.withOptions({height:t})},n.focalPoint=function(t,e){return this.withOptions({focalPoint:{x:t,y:e}})},n.maxWidth=function(t){return this.withOptions({maxWidth:t})},n.minWidth=function(t){return this.withOptions({minWidth:t})},n.maxHeight=function(t){return this.withOptions({maxHeight:t})},n.minHeight=function(t){return this.withOptions({minHeight:t})},n.size=function(t,e){return this.withOptions({width:t,height:e})},n.blur=function(t){return this.withOptions({blur:t})},n.sharpen=function(t){return this.withOptions({sharpen:t})},n.rect=function(t,e,n,r){return this.withOptions({rect:{left:t,top:e,width:n,height:r}})},n.format=function(t){return this.withOptions({format:t})},n.invert=function(t){return this.withOptions({invert:t})},n.orientation=function(t){return this.withOptions({orientation:t})},n.quality=function(t){return this.withOptions({quality:t})},n.forceDownload=function(t){return this.withOptions({download:t})},n.flipHorizontal=function(){return this.withOptions({flipHorizontal:!0})},n.flipVertical=function(){return this.withOptions({flipVertical:!0})},n.ignoreImageParams=function(){return this.withOptions({ignoreImageParams:!0})},n.fit=function(t){if(-1===g.indexOf(t))throw new Error('Invalid fit mode "'+t+'"');return this.withOptions({fit:t})},n.crop=function(t){if(-1===v.indexOf(t))throw new Error('Invalid crop mode "'+t+'"');return this.withOptions({crop:t})},n.saturation=function(t){return this.withOptions({saturation:t})},n.auto=function(t){if(-1===w.indexOf(t))throw new Error('Invalid auto mode "'+t+'"');return this.withOptions({auto:t})},n.pad=function(t){return this.withOptions({pad:t})},n.url=function(){return d(this.options)},n.toString=function(){return this.url()},e}();return O}()},57178:function(t,e,n){"use strict";var r=n(27378),i=n(23615),o=n(27894),s=n(39015),a=s.serializers,l=s.serializeSpan,u=s.renderProps,c=o.getImageUrl,f=o.blocksToNodes,h=o.mergeSerializers,p=r.createElement,d=function t(e){var n=h(t.defaultSerializers,e.serializers),r=Object.assign({},u,e,{serializers:n,blocks:e.blocks||[]});return f(p,r,a,l)};d.defaultSerializers=a,d.getImageUrl=c,d.propTypes={className:i.string,renderContainerOnSingleChild:i.bool,ignoreUnknownTypes:i.bool,projectId:i.string,dataset:i.string,imageOptions:i.object,serializers:i.shape({types:i.object,marks:i.object,list:i.func,listItem:i.func,block:i.func,span:i.func}),blocks:i.oneOfType([i.arrayOf(i.shape({_type:i.string.isRequired})),i.shape({_type:i.string.isRequired})]).isRequired},d.defaultProps={ignoreUnknownTypes:!0,renderContainerOnSingleChild:!1,serializers:{},imageOptions:{}},t.exports=d},39015:function(t,e,n){"use strict";var r=n(27378),i=(0,n(27894).getSerializers)(r.createElement),o=i.defaultSerializers,s=i.serializeSpan;t.exports={serializeSpan:s,serializers:o,renderProps:{nestMarks:!0}}}}]);