UNPKG

activator-oce-exporter

Version:

Extract Activator binder and convert it to valid OCE mono pacakge

32 lines (29 loc) 10.2 kB
(function(){/* Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ 'use strict';var k=!(window.ShadyDOM&&window.ShadyDOM.inUse),n;function r(a){n=a&&a.shimcssproperties?!1:k||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?n=window.ShadyCSS.nativeCss:window.ShadyCSS?(r(window.ShadyCSS),window.ShadyCSS=void 0):r(window.WebComponents&&window.WebComponents.flags);var t=n;function u(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""} function v(a){a=a.replace(aa,"").replace(ba,"");var b=w,c=a,e=new u;e.start=0;e.end=c.length;for(var d=e,f=0,g=c.length;f<g;f++)if("{"===c[f]){d.rules||(d.rules=[]);var h=d,l=h.rules[h.rules.length-1]||null;d=new u;d.start=f+1;d.parent=h;d.previous=l;h.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} function w(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=ca(c),c=c.replace(x," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=y:c.match(da)&&(a.type=z,a.keyframesName=a.selector.split(x).pop()):a.type=0===c.indexOf("--")?A:B);if(c=a.rules)for(var e=0,d=c.length,f;e<d&&(f=c[e]);e++)w(f,b);return a} function ca(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})} function C(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=d.length,h;f<g&&(h=d[f]);f++)e=C(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ea,"").replace(fa,""),b=b.replace(ha,"").replace(ia,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} var B=1,z=7,y=4,A=1E3,aa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ba=/@import[^;]*;/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ha=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ia=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,da=/^@[^\s]*keyframes/,x=/\s+/g;var D=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,F=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ja=/@media\s(.*)/;var G=new Set;function H(a){if(!a)return"";"string"===typeof a&&(a=v(a));return C(a,t)}function I(a){!a.__cssRules&&a.textContent&&(a.__cssRules=v(a.textContent));return a.__cssRules||null}function J(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===y){var g=a.selector.match(ja);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===B?b(a):c&&f===z?c(a):f===A&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var h;d<f&&(h=a[d]);d++)J(h,b,c,e)}}} function K(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=K(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)} function L(a){if(void 0===a.a){var b=a.getAttribute("css-build");if(b)a.a=b;else{a:{b="template"===a.localName?a.content.firstChild:a.firstChild;if(b instanceof Comment&&(b=b.textContent.trim().split(":"),"css-build"===b[0])){b=b[1];break a}b=""}if(""!==b){var c="template"===a.localName?a.content.firstChild:a.firstChild;c.parentNode.removeChild(c)}a.a=b}}return a.a||""};var ka=/;\s*/m,la=/^\s*(initial)|(inherit)\s*$/,M=/\s*!important/;function N(){this.a={}}N.prototype.set=function(a,b){a=a.trim();this.a[a]={h:b,i:{}}};N.prototype.get=function(a){a=a.trim();return this.a[a]||null};var O=null;function P(){this.b=this.c=null;this.a=new N}P.prototype.o=function(a){a=F.test(a)||D.test(a);F.lastIndex=0;D.lastIndex=0;return a}; P.prototype.m=function(a,b){if(void 0===a.b){var c=[];for(var e=a.content.querySelectorAll("style"),d=0;d<e.length;d++){var f=e[d];if(f.hasAttribute("shady-unscoped")){if(!k){var g=f.textContent;G.has(g)||(G.add(g),g=f.cloneNode(!0),document.head.appendChild(g));f.parentNode.removeChild(f)}}else c.push(f.textContent),f.parentNode.removeChild(f)}(c=c.join("").trim())?(e=document.createElement("style"),e.textContent=c,a.content.insertBefore(e,a.content.firstChild),c=e):c=null;a.b=c}return(a=a.b)?this.j(a, b):null};P.prototype.j=function(a,b){b=void 0===b?"":b;var c=I(a);this.l(c,b);a.textContent=H(c);return c};P.prototype.f=function(a){var b=this,c=I(a);J(c,function(a){":root"===a.selector&&(a.selector="html");b.g(a)});a.textContent=H(c);return c};P.prototype.l=function(a,b){var c=this;this.c=b;J(a,function(a){c.g(a)});this.c=null};P.prototype.g=function(a){a.cssText=ma(this,a.parsedCssText,a);":root"===a.selector&&(a.selector=":host > *")}; function ma(a,b,c){b=b.replace(D,function(b,d,f,g){return na(a,b,d,f,g,c)});return Q(a,b,c)}function oa(a,b){for(var c=b;c.parent;)c=c.parent;var e={},d=!1;J(c,function(c){(d=d||c===b)||c.selector===b.selector&&Object.assign(e,R(a,c.parsedCssText))});return e} function Q(a,b,c){for(var e;e=F.exec(b);){var d=e[0],f=e[1];e=e.index;var g=b.slice(0,e+d.indexOf("@apply"));b=b.slice(e+d.length);var h=c?oa(a,c):{};Object.assign(h,R(a,g));d=void 0;var l=a;f=f.replace(ka,"");var p=[];var m=l.a.get(f);m||(l.a.set(f,{}),m=l.a.get(f));if(m){l.c&&(m.i[l.c]=!0);var q=m.h;for(d in q)l=h&&h[d],m=[d,": var(",f,"_-_",d],l&&m.push(",",l.replace(M,"")),m.push(")"),M.test(q[d])&&m.push(" !important"),p.push(m.join(""))}d=p.join("; ");b=g+d+b;F.lastIndex=e+d.length}return b} function R(a,b){b=b.split(";");for(var c,e,d={},f=0,g;f<b.length;f++)if(c=b[f])if(g=c.split(":"),1<g.length){c=g[0].trim();var h=a;e=c;g=g.slice(1).join(":");var l=la.exec(g);l&&(l[1]?(h.b||(h.b=document.createElement("meta"),h.b.setAttribute("apply-shim-measure",""),h.b.style.all="initial",document.head.appendChild(h.b)),e=window.getComputedStyle(h.b).getPropertyValue(e)):e="apply-shim-inherit",g=e);e=g;d[c]=e}return d}function pa(a,b){if(O)for(var c in b.i)c!==a.c&&O(c)} function na(a,b,c,e,d,f){e&&K(e,function(b,c){c&&a.a.get(c)&&(d="@apply "+c+";")});if(!d)return b;var g=Q(a,""+d,f);f=b.slice(0,b.indexOf("--"));var h=g=R(a,g),l=a.a.get(c),p=l&&l.h;p?h=Object.assign(Object.create(p),g):a.a.set(c,h);var m=[],q,X=!1;for(q in h){var E=g[q];void 0===E&&(E="initial");!p||q in p||(X=!0);m.push(c+"_-_"+q+": "+E)}X&&pa(a,l);l&&(l.h=h);e&&(f=b+";"+f);return f+m.join("; ")+";"}P.prototype.detectMixin=P.prototype.o;P.prototype.transformStyle=P.prototype.j; P.prototype.transformCustomStyle=P.prototype.f;P.prototype.transformRules=P.prototype.l;P.prototype.transformRule=P.prototype.g;P.prototype.transformTemplate=P.prototype.m;P.prototype._separator="_-_";Object.defineProperty(P.prototype,"invalidCallback",{get:function(){return O},set:function(a){O=a}});var S={};var qa=Promise.resolve();function ra(a){if(a=S[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function T(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function sa(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.c||(a.c=!0,qa.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.c=!1}))};var U=new P;function V(){this.a=null;U.invalidCallback=ra}function W(a){a.a||(a.a=window.ShadyCSS.CustomStyleInterface,a.a&&(a.a.transformCallback=function(a){U.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&a.flushCustomStyles()})}))}V.prototype.prepareTemplate=function(a,b){W(this);""===L(a)&&(S[b]=a,b=U.m(a,b),a._styleAst=b)}; V.prototype.flushCustomStyles=function(){W(this);if(this.a){var a=this.a.processStyles();if(this.a.enqueued){for(var b=0;b<a.length;b++){var c=this.a.getStyleForCustomStyle(a[b]);c&&U.f(c)}this.a.enqueued=!1}}}; V.prototype.styleSubtree=function(a,b){W(this);if(b)for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b]);else for(a=a.children||a.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b])}; V.prototype.styleElement=function(a){W(this);var b=a.localName,c;b?-1<b.indexOf("-")?c=b:c=a.getAttribute&&a.getAttribute("is")||"":c=a.is;b=S[c];if(!(b&&""!==L(b)||!b||T(b))){if(T(b)||b._applyShimValidatingVersion!==b._applyShimNextVersion)this.prepareTemplate(b,c),sa(b);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=b._styleAst,a.textContent=H(b._styleAst)}};V.prototype.styleDocument=function(a){W(this);this.styleSubtree(document.body,a)}; if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Y=new V,Z=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,b){Y.flushCustomStyles();Y.prepareTemplate(a,b)},prepareTemplateStyles:function(a,b,c){this.prepareTemplate(a,b,c)},prepareTemplateDom:function(){},styleSubtree:function(a,b){Y.flushCustomStyles();Y.styleSubtree(a,b)},styleElement:function(a){Y.flushCustomStyles();Y.styleElement(a)},styleDocument:function(a){Y.flushCustomStyles();Y.styleDocument(a)}, getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},flushCustomStyles:function(){Y.flushCustomStyles()},nativeCss:t,nativeShadow:k};Z&&(window.ShadyCSS.CustomStyleInterface=Z)}window.ShadyCSS.ApplyShim=U;}).call(this); //# sourceMappingURL=apply-shim.min.js.map