@ampproject/amp-instagram
Advanced tools
Comparing version 1.2110192227.0 to 1.2110202310.0
@@ -1,2 +0,2 @@ | ||
function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 n(n){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?t(Object(a),!0).forEach((function(t){e(n,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as s,createContext as i,createElement as c,createRef as u}from"preact";import{hydrate as f,render as p}from"preact";import{useCallback as d,useContext as m,useEffect as g,useImperativeHandle as y,useLayoutEffect as b,useMemo as w,useRef as v,useState as h}from"preact/hooks";function O(e,t,n){return c.apply(void 0,arguments)}function S(e){return h(e)}function j(e){return v(e)}function z(e,t){b(e,t)}function R(e,t){return d(e,t)}import{Children as C,createPortal as M,forwardRef as N}from"preact/compat";function x(e){return N(e)}var E=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],$=[null,"paint","layout","content","size","size paint","size layout","strict"],A={"position":"relative","width":"100%","height":"100%"},F=x((function(e,t){let{as:a="div",children:o,"class":l,contentAs:s="div",contentClassName:i,contentProps:c,contentRef:u,contentStyle:f,layout:p=!1,paint:d=!1,size:m=!1,"style":g,wrapperClassName:y,wrapperStyle:b}=e;const w=(m?4:0)+(p?2:0)+(d?1:0);return O(a,n(n({},r(e,E)),{},{ref:t,class:`${l||""} ${y||""}`.trim()||null,style:n(n(n({},g),b),{},{contain:$[w]})}),O(s,n(n({},c),{},{ref:u,class:i,style:n(n({},m&&A),{},{"overflow":d?"hidden":"visible"},f)}),o))})),I=["as","children","class","style","wrapperClassName","wrapperStyle"];function k(e){const t=j(null);return t.current=e,t}x((function(e,t){let{as:a="div",children:o,"class":l,"style":s,wrapperClassName:i,wrapperStyle:c}=e;return O(a,n(n({},r(e,I)),{},{ref:t,class:`${l||""} ${i||""}`.trim()||null,style:n(n({},s),c)}),o)})),new WeakMap,new WeakMap;var H,L=["auto","lazy","eager","unload"],P={auto:0,lazy:1,eager:2,unload:3};function q(){const e=H||(H=i({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var U=["allow","allowFullScreen","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],V=()=>!1,W=x((function(e,t){let{allow:a,allowFullScreen:o,iframeStyle:l,name:s,title:i,matchesMessagingOrigin:c=V,messageHandler:u,ready:f=!0,loading:p,onReadyState:d,sandbox:m,src:b}=e,w=r(e,U);const{playable:v}=q(),h=function(e){const{loading:t}=q();return function(e,t){const n=P[e]||0,r=P[t]||0,a=Math.max(n,r);return L[a]}(e,t)}(p),S="unload"!==h,C=j(!1),M=k(d),N=R((e=>{if(e!==C.current){C.current=e;const t=M.current;null==t||t(e?"complete":"loading")}}),[M]),x=j(null);var E;return function(e,t,n){y(e,(()=>({get readyState(){return C.current?"complete":"loading"},get node(){return x.current}})),[])}(t),z((()=>{S||N(!1)}),[S,N]),E=()=>{const e=x.current;if(!v&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}},g(E,[v]),z((()=>{const e=x.current;if(!e||!S)return;const t=e=>{const t=x.current;t&&e.source==t.contentWindow&&c(e.origin)&&u(e)},{defaultView:n}=e.ownerDocument;return n.addEventListener("message",t),()=>n.removeEventListener("message",t)}),[c,u,S,f]),O(F,n(n({},w),{},{layout:!0,size:!0,paint:!0}),S&&f&&O("iframe",{allow:a,allowFullScreen:o,frameborder:"0",loading:h,name:s,onLoad:()=>N(!0),part:"iframe",ref:x,sandbox:m,scrolling:"no",src:b,style:n(n({},l),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:i}))}));W.displayName="IframeEmbed";var J=self.AMP_CONFIG||{},Z=("string"==typeof J.thirdPartyFrameRegex?new RegExp(J.thirdPartyFrameRegex):J.thirdPartyFrameRegex,("string"==typeof J.cdnProxyRegex?new RegExp(J.cdnProxyRegex):J.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function _(e){if(!self.document||!self.document.head)return null;if(self.location&&Z.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}J.thirdPartyUrl,J.thirdPartyFrameHost,J.cdnUrl||_("runtime-host"),J.errorReportingUrl,J.betaErrorReportingUrl,J.localDev,J.geoApiUrl||_("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var B=["captioned","onLoad","requestResize","shortcode","title"],D=l(),G=e=>"https://www.instagram.com"===e,K=x((function(e,t){let{captioned:a,onLoad:o,requestResize:s,shortcode:i,title:c="Instagram"}=e,u=r(e,B);const[f,p]=S(D),[d,m]=S(0),g=k(o),y=R((e=>{const t=(n=function(e){return e.data}(e),JSON.parse(n));var n;if("MEASURE"==t.type&&t.details){var r;const e=t.details.height;s&&s(e),p(l({"height":e})),m(1),null===(r=g.current)||void 0===r||r.call(g)}}),[s,g]);return O(W,n({iframeStyle:{opacity:d},matchesMessagingOrigin:G,messageHandler:y,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(i)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:f},u))}));K.displayName="Instagram";export{K as BentoInstagram}; | ||
function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 n(n){for(var r=1;r<arguments.length;r++){var a=null!=arguments[r]?arguments[r]:{};r%2?t(Object(a),!0).forEach((function(t){e(n,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(a,e))}))}return n}function r(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var{hasOwnProperty:a,toString:o}=Object.prototype;function l(e){return e||{}}import{cloneElement as s,createContext as i,createElement as c,createRef as u}from"preact";import{hydrate as f,render as p}from"preact";import{useCallback as d,useContext as m,useEffect as g,useImperativeHandle as y,useLayoutEffect as b,useMemo as w,useRef as v,useState as h}from"preact/hooks";function O(e,t,n){return c.apply(void 0,arguments)}function S(e){return h(e)}function j(e){return v(e)}function z(e,t){b(e,t)}function R(e,t){return d(e,t)}import{Children as C,createPortal as M,forwardRef as N}from"preact/compat";function x(e){return N(e)}var E=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],$=[null,"paint","layout","content","size","size paint","size layout","strict"],k={"position":"relative","width":"100%","height":"100%"},A=x((function(e,t){let{as:a="div",children:o,"class":l,contentAs:s="div",contentClassName:i,contentProps:c,contentRef:u,contentStyle:f,layout:p=!1,paint:d=!1,size:m=!1,"style":g,wrapperClassName:y,wrapperStyle:b}=e;const w=(m?4:0)+(p?2:0)+(d?1:0);return O(a,n(n({},r(e,E)),{},{ref:t,class:`${l||""} ${y||""}`.trim()||null,style:n(n(n({},g),b),{},{contain:$[w]})}),O(s,n(n({},c),{},{ref:u,class:i,style:n(n({},m&&k),{},{"overflow":d?"hidden":"visible"},f)}),o))})),F=["as","children","class","style","wrapperClassName","wrapperStyle"];function I(e){const t=j(null);return t.current=e,t}x((function(e,t){let{as:a="div",children:o,"class":l,"style":s,wrapperClassName:i,wrapperStyle:c}=e;return O(a,n(n({},r(e,F)),{},{ref:t,class:`${l||""} ${i||""}`.trim()||null,style:n(n({},s),c)}),o)})),new WeakMap,new WeakMap;var H,L=["auto","lazy","eager","unload"],P={auto:0,lazy:1,eager:2,unload:3};function q(){const e=H||(H=i({renderable:!0,playable:!0,loading:"auto"},void 0));return m(e)}var U=["allow","allowFullScreen","iframeStyle","name","title","matchesMessagingOrigin","messageHandler","ready","loading","onReadyState","sandbox","src"],V=()=>!1,W=x((function(e,t){let{allow:a,allowFullScreen:o,iframeStyle:l,name:s,title:i,matchesMessagingOrigin:c=V,messageHandler:u,ready:f=!0,loading:p,onReadyState:d,sandbox:m,src:b}=e,w=r(e,U);const{playable:v}=q(),h=function(e){const{loading:t}=q();return function(e,t){const n=P[e]||0,r=P[t]||0,a=Math.max(n,r);return L[a]}(e,t)}(p),S="unload"!==h,C=j(!1),M=I(d),N=R((e=>{if(e!==C.current){C.current=e;const t=M.current;null==t||t(e?"complete":"loading")}}),[M]),x=j(null);var E;return function(e,t,n){y(e,(()=>({get readyState(){return C.current?"complete":"loading"},get node(){return x.current}})),[])}(t),z((()=>{S||N(!1)}),[S,N]),E=()=>{const e=x.current;if(!v&&e){const{src:t}=e;(e=>e&&"about:blank"!=e&&!e.includes("#"))(t)?e.src=e.src:e.parentNode.insertBefore(e,e.nextSibling)}},g(E,[v]),z((()=>{const e=x.current;if(!e||!S)return;const t=e=>{const t=x.current;t&&e.source==t.contentWindow&&c(e.origin)&&u(e)},{defaultView:n}=e.ownerDocument;return n.addEventListener("message",t),()=>n.removeEventListener("message",t)}),[c,u,S,f]),O(A,n(n({},w),{},{layout:!0,size:!0,paint:!0}),S&&f&&O("iframe",{allow:a,allowFullScreen:o,frameborder:"0",loading:h,name:s,onLoad:()=>N(!0),part:"iframe",ref:x,sandbox:m,scrolling:"no",src:b,style:n(n({},l),{},{width:"100%",height:"100%",contentVisibility:"auto"}),title:i}))}));W.displayName="IframeEmbed";var J=self.AMP_CONFIG||{},Z=("string"==typeof J.thirdPartyFrameRegex?new RegExp(J.thirdPartyFrameRegex):J.thirdPartyFrameRegex,("string"==typeof J.cdnProxyRegex?new RegExp(J.cdnProxyRegex):J.cdnProxyRegex)||/^https:\/\/([a-zA-Z0-9_-]+\.)?cdn\.ampproject\.org$/);function _(e){if(!self.document||!self.document.head)return null;if(self.location&&Z.test(self.location.origin))return null;const t=self.document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")||null}J.thirdPartyUrl,J.thirdPartyFrameHost,J.cdnUrl||_("runtime-host"),J.errorReportingUrl,J.betaErrorReportingUrl,J.localDev,J.geoApiUrl||_("amp-geo-api"),self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null},self.__AMP_LOG;var B=["captioned","onLoad","requestResize","shortcode","title"],D=l(),G=e=>"https://www.instagram.com"===e,K=x((function(e,t){let{captioned:a,onLoad:o,requestResize:s,shortcode:i,title:c="Instagram"}=e,u=r(e,B);const[f,p]=S(D),[d,m]=S(0),g=I(o),y=R((e=>{const t=(n=function(e){return e.data}(e),JSON.parse(n));var n;if("MEASURE"==t.type&&t.details){var r;const e=t.details.height;s&&s(e),p(l({"height":e})),m(1),null===(r=g.current)||void 0===r||r.call(g)}}),[s,g]);return O(W,n({iframeStyle:{opacity:d},matchesMessagingOrigin:G,messageHandler:y,ref:t,src:"https://www.instagram.com/p/"+encodeURIComponent(i)+"/embed/"+(a?"captioned/":"")+"?cr=1&v=12",title:c,wrapperStyle:f},u))}));K.displayName="Instagram";export{K as BentoInstagram}; | ||
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */ |
{ | ||
"name": "@ampproject/amp-instagram", | ||
"version": "1.2110192227.0", | ||
"version": "1.2110202310.0", | ||
"description": "AMP HTML amp-instagram Component", | ||
@@ -5,0 +5,0 @@ "author": "The AMP HTML Authors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet