@gaoding/editor-sdk
Advanced tools
Comparing version 0.2.8-beta to 0.2.8-beta.0
@@ -1,1 +0,1 @@ | ||
(function(Z,L){typeof exports=="object"&&typeof module=="object"?module.exports=L():typeof define=="function"&&define.amd?define([],L):typeof exports=="object"?exports["gd-editor-sdk"]=L():Z["gd-editor-sdk"]=L()})(this,function(){return(()=>{var re={3913:r=>{function s(t,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n,a){return n&&s(t.prototype,n),a&&s(t,a),t}r.exports=e},6738:(r,s,e)=>{"use strict";e.r(s),e.d(s,{GdEditorSdk:()=>O,default:()=>P});var t={};if(e.r(t),e.d(t,{j:()=>O}),typeof window!="undefined"){e(8344);var n;(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=n[1])}const a=null;var i=e(1181),o=e(6253),c=e(5115),l=e(2773),f=e(851),d=e(3913),v=e.n(d),x={};const b=x;var w=function(){v()(E,[{key:"width",get:function(){return this.config.width}},{key:"height",get:function(){return this.config.height}}]);function E(j){this.config=j}var y=E.prototype;return y.addElement=function(u){var h=JSON.parse(JSON.stringify(u)),g=Math.random();return this.postMessage("editor.addElement",h,g)},y.postMessage=function(u,h,g){var T=this,G=function(){T.config.frame.contentWindow.postMessage({action:u,asyncId:g,payload:h},"*")};if(g)return new Promise(function(M){G(),b[g]=M});G()},E}(),O=function(){function E(j){var u=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(h){if(!h.origin.includes(".gaoding.com"))return!1;h.data.action==="editor.download"&&(u.config.onUpload&&u.config.onUpload(h.data.blob),u.config.onCompleted&&u.config.onCompleted(h.data.file),u.config.autoClose!==!1&&u.close()),h.data.action==="editor.templetLoaded"&&(u.config.onTempletLoaded&&u.config.onTempletLoaded(new w({width:h.data.payload.width,height:h.data.payload.height,frame:u.frame}))),h.data.asyncId&&b[h.data.asyncId]&&b[h.data.asyncId](h.data.payload)},!j.onCompleted&&!j.onUpload)throw new Error("缺少必填参数 onCompleted");this.config=j,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var y=E.prototype;return y.autoResize=function(){var u=this.container;u&&(u.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",u.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},y.open=function(u){var h=this,g=document.createElement("iframe");g.style.display="block",g.style.width="100%",g.style.height="100%",g.setAttribute("frameborder","0");var T=u.ext||{};Object.assign(T,{buttonText:this.config.buttonText});var G=Object.keys(T).reduce(function(D,B){return T[B]!==void 0&&(D+="&"+B+"="+T[B]),D},""),M="";M+=""+G;var N="https://www.gaoding.com",R="utm-editors";this.config.env.includes("http")&&(N=this.config.env,R="utms"),this.config.env==="local"?N="http://design.dev.gaoding.com":this.config.env==="dev"?N="https://www.dev.gaoding.com":this.config.env==="stage"&&(N="https://stage.gaoding.com"),g.src=N+"/"+R+"/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+M,this.frame=g,window.addEventListener("message",this.cb);var F=this.config.container&&document.querySelector(this.config.container);if(F){F.appendChild(g);return}if(!this.wrapper){var C=document.createElement("div");C.className="gaoding-iframe",C.style.position="absolute",C.style.top="0px",C.style.right="0px",C.style.bottom="0px",C.style.left="0px",C.style.zIndex="1000",document.documentElement.clientHeight>800&&(C.style.display="flex",C.style.alignItems="center",C.style.justifyContent="center"),this.wrapper=C;var A=this.container=document.createElement("div");A.style.position="relative",A.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",A.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",A.style.minHeight="604px",A.style.margin="50px auto",A.style.background="#fff",A.style.display="block",A.appendChild(this.createCloseBtn()),this.config.style&&Object.keys(this.config.style).forEach(function(D){A.style[D]=h.config.style[D]}),A.appendChild(g),C.append(A)}this.createMask(),document.body.appendChild(this.wrapper)},y.close=function(){window.removeEventListener("message",this.cb),this.wrapper&&this.wrapper.parentElement&&this.wrapper.parentElement.removeChild(this.wrapper),this.mask&&this.mask.parentElement&&this.mask.parentElement.removeChild(this.mask),window.removeEventListener("resize",this.autoResize.bind(this)),this.config.onClose&&this.config.onClose()},y.createMask=function(){var u=document.createElement("div");u.style.position="fixed",u.style.top="0px",u.style.left="0px",u.style.bottom="0px",u.style.right="0px",u.style.zIndex=parseFloat(this.wrapper.style.zIndex)-1+"",u.style.backgroundColor="#000",u.style.opacity=".5",this.mask=u,document.body.appendChild(u)},y.createCloseBtn=function(){var u=this,h=document.createElement("div");h.style.fontSize="13px",h.style.width="42px",h.style.height="42px",h.style.textAlign="right",h.style.position="absolute",h.style.right="-42px",h.style.top="0px",h.style.background="#000",h.style.cursor="pointer",h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.backgroundRepeat="no-repeat";var g=document.createElement("img");return g.style.display="block",g.style.width="24px",g.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",h.appendChild(g),h.addEventListener("click",function(){return u.close()}),h},E}();window&&(window.GdEditorSdk=O);const P=t.default},4963:r=>{r.exports=function(s){if(typeof s!="function")throw TypeError(s+" is not a function!");return s}},7722:(r,s,e)=>{var t=e(6314)("unscopables"),n=Array.prototype;n[t]==null&&e(7728)(n,t,{}),r.exports=function(a){n[t][a]=!0}},3328:r=>{r.exports=function(s,e,t,n){if(!(s instanceof e)||n!==void 0&&n in s)throw TypeError(t+": incorrect invocation!");return s}},7007:(r,s,e)=>{var t=e(5286);r.exports=function(n){if(!t(n))throw TypeError(n+" is not an object!");return n}},9315:(r,s,e)=>{var t=e(2110),n=e(875),a=e(2337);r.exports=function(i){return function(o,c,l){var f=t(o),d=n(f.length),v=a(l,d),x;if(i&&c!=c){for(;d>v;)if(x=f[v++],x!=x)return!0}else for(;d>v;v++)if((i||v in f)&&f[v]===c)return i||v||0;return!i&&-1}}},1488:(r,s,e)=>{var t=e(2032),n=e(6314)("toStringTag"),a=t(function(){return arguments}())=="Arguments",i=function(o,c){try{return o[c]}catch(l){}};r.exports=function(o){var c,l,f;return o===void 0?"Undefined":o===null?"Null":typeof(l=i(c=Object(o),n))=="string"?l:a?t(c):(f=t(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},2032:r=>{var s={}.toString;r.exports=function(e){return s.call(e).slice(8,-1)}},5645:r=>{var s=r.exports={version:"2.6.11"};typeof __e=="number"&&(__e=s)},741:(r,s,e)=>{var t=e(4963);r.exports=function(n,a,i){if(t(n),a===void 0)return n;switch(i){case 1:return function(o){return n.call(a,o)};case 2:return function(o,c){return n.call(a,o,c)};case 3:return function(o,c,l){return n.call(a,o,c,l)}}return function(){return n.apply(a,arguments)}}},1355:r=>{r.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},7057:(r,s,e)=>{r.exports=!e(4253)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},2457:(r,s,e)=>{var t=e(5286),n=e(3816).document,a=t(n)&&t(n.createElement);r.exports=function(i){return a?n.createElement(i):{}}},4430:r=>{r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(r,s,e)=>{var t=e(3816),n=e(5645),a=e(7728),i=e(3415),o=e(741),c="prototype",l=function(f,d,v){var x=f&l.F,b=f&l.G,w=f&l.S,O=f&l.P,P=f&l.B,E=b?t:w?t[d]||(t[d]={}):(t[d]||{})[c],y=b?n:n[d]||(n[d]={}),j=y[c]||(y[c]={}),u,h,g,T;b&&(v=d);for(u in v)h=!x&&E&&E[u]!==void 0,g=(h?E:v)[u],T=P&&h?o(g,t):O&&typeof g=="function"?o(Function.call,g):g,E&&i(E,u,g,f&l.U),y[u]!=g&&a(y,u,T),O&&j[u]!=g&&(j[u]=g)};t.core=n,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,r.exports=l},4253:r=>{r.exports=function(s){try{return!!s()}catch(e){return!0}}},3531:(r,s,e)=>{var t=e(741),n=e(8851),a=e(6555),i=e(7007),o=e(875),c=e(9002),l={},f={},d=r.exports=function(v,x,b,w,O){var P=O?function(){return v}:c(v),E=t(b,w,x?2:1),y=0,j,u,h,g;if(typeof P!="function")throw TypeError(v+" is not iterable!");if(a(P)){for(j=o(v.length);j>y;y++)if(g=x?E(i(u=v[y])[0],u[1]):E(v[y]),g===l||g===f)return g}else for(h=P.call(v);!(u=h.next()).done;)if(g=n(h,E,u.value,x),g===l||g===f)return g};d.BREAK=l,d.RETURN=f},18:(r,s,e)=>{r.exports=e(3825)("native-function-to-string",Function.toString)},3816:r=>{var s=r.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=s)},9181:r=>{var s={}.hasOwnProperty;r.exports=function(e,t){return s.call(e,t)}},7728:(r,s,e)=>{var t=e(9275),n=e(681);r.exports=e(7057)?function(a,i,o){return t.f(a,i,n(1,o))}:function(a,i,o){return a[i]=o,a}},639:(r,s,e)=>{var t=e(3816).document;r.exports=t&&t.documentElement},1734:(r,s,e)=>{r.exports=!e(7057)&&!e(4253)(function(){return Object.defineProperty(e(2457)("div"),"a",{get:function(){return 7}}).a!=7})},7242:r=>{r.exports=function(s,e,t){var n=t===void 0;switch(e.length){case 0:return n?s():s.call(t);case 1:return n?s(e[0]):s.call(t,e[0]);case 2:return n?s(e[0],e[1]):s.call(t,e[0],e[1]);case 3:return n?s(e[0],e[1],e[2]):s.call(t,e[0],e[1],e[2]);case 4:return n?s(e[0],e[1],e[2],e[3]):s.call(t,e[0],e[1],e[2],e[3])}return s.apply(t,e)}},9797:(r,s,e)=>{var t=e(2032);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return t(n)=="String"?n.split(""):Object(n)}},6555:(r,s,e)=>{var t=e(7234),n=e(6314)("iterator"),a=Array.prototype;r.exports=function(i){return i!==void 0&&(t.Array===i||a[n]===i)}},5286:r=>{r.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},8851:(r,s,e)=>{var t=e(7007);r.exports=function(n,a,i,o){try{return o?a(t(i)[0],i[1]):a(i)}catch(l){var c=n.return;throw c!==void 0&&t(c.call(n)),l}}},9988:(r,s,e)=>{"use strict";var t=e(2503),n=e(681),a=e(2943),i={};e(7728)(i,e(6314)("iterator"),function(){return this}),r.exports=function(o,c,l){o.prototype=t(i,{next:n(1,l)}),a(o,c+" Iterator")}},2923:(r,s,e)=>{"use strict";var t=e(4461),n=e(2985),a=e(3415),i=e(7728),o=e(7234),c=e(9988),l=e(2943),f=e(468),d=e(6314)("iterator"),v=!([].keys&&"next"in[].keys()),x="@@iterator",b="keys",w="values",O=function(){return this};r.exports=function(P,E,y,j,u,h,g){c(y,E,j);var T=function(V){if(!v&&V in R)return R[V];switch(V){case b:return function(){return new y(this,V)};case w:return function(){return new y(this,V)}}return function(){return new y(this,V)}},G=E+" Iterator",M=u==w,N=!1,R=P.prototype,F=R[d]||R[x]||u&&R[u],C=F||T(u),A=u?M?T("entries"):C:void 0,D=E=="Array"&&R.entries||F,B,H,k;if(D&&(k=f(D.call(new P)),k!==Object.prototype&&k.next&&(l(k,G,!0),!t&&typeof k[d]!="function"&&i(k,d,O))),M&&F&&F.name!==w&&(N=!0,C=function(){return F.call(this)}),(!t||g)&&(v||N||!R[d])&&i(R,d,C),o[E]=C,o[G]=O,u)if(B={values:M?C:T(w),keys:h?C:T(b),entries:A},g)for(H in B)H in R||a(R,H,B[H]);else n(n.P+n.F*(v||N),E,B);return B}},7462:(r,s,e)=>{var t=e(6314)("iterator"),n=!1;try{var a=[7][t]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(i){}r.exports=function(i,o){if(!o&&!n)return!1;var c=!1;try{var l=[7],f=l[t]();f.next=function(){return{done:c=!0}},l[t]=function(){return f},i(l)}catch(d){}return c}},5436:r=>{r.exports=function(s,e){return{value:e,done:!!s}}},7234:r=>{r.exports={}},4461:r=>{r.exports=!1},4351:(r,s,e)=>{var t=e(3816),n=e(4193).set,a=t.MutationObserver||t.WebKitMutationObserver,i=t.process,o=t.Promise,c=e(2032)(i)=="process";r.exports=function(){var l,f,d,v=function(){var O,P;for(c&&(O=i.domain)&&O.exit();l;){P=l.fn,l=l.next;try{P()}catch(E){throw l?d():f=void 0,E}}f=void 0,O&&O.enter()};if(c)d=function(){i.nextTick(v)};else if(a&&!(t.navigator&&t.navigator.standalone)){var x=!0,b=document.createTextNode("");new a(v).observe(b,{characterData:!0}),d=function(){b.data=x=!x}}else if(o&&o.resolve){var w=o.resolve(void 0);d=function(){w.then(v)}}else d=function(){n.call(t,v)};return function(O){var P={fn:O,next:void 0};f&&(f.next=P),l||(l=P,d()),f=P}}},3499:(r,s,e)=>{"use strict";var t=e(4963);function n(a){var i,o;this.promise=new a(function(c,l){if(i!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");i=c,o=l}),this.resolve=t(i),this.reject=t(o)}r.exports.f=function(a){return new n(a)}},5345:(r,s,e)=>{"use strict";var t=e(7057),n=e(7184),a=e(4548),i=e(4682),o=e(508),c=e(9797),l=Object.assign;r.exports=!l||e(4253)(function(){var f={},d={},v=Symbol(),x="abcdefghijklmnopqrst";return f[v]=7,x.split("").forEach(function(b){d[b]=b}),l({},f)[v]!=7||Object.keys(l({},d)).join("")!=x})?function(d,v){for(var x=o(d),b=arguments.length,w=1,O=a.f,P=i.f;b>w;)for(var E=c(arguments[w++]),y=O?n(E).concat(O(E)):n(E),j=y.length,u=0,h;j>u;)h=y[u++],(!t||P.call(E,h))&&(x[h]=E[h]);return x}:l},2503:(r,s,e)=>{var t=e(7007),n=e(5588),a=e(4430),i=e(9335)("IE_PROTO"),o=function(){},c="prototype",l=function(){var f=e(2457)("iframe"),d=a.length,v="<",x=">",b;for(f.style.display="none",e(639).appendChild(f),f.src="javascript:",b=f.contentWindow.document,b.open(),b.write(v+"script"+x+"document.F=Object"+v+"/script"+x),b.close(),l=b.F;d--;)delete l[c][a[d]];return l()};r.exports=Object.create||function(d,v){var x;return d!==null?(o[c]=t(d),x=new o,o[c]=null,x[i]=d):x=l(),v===void 0?x:n(x,v)}},9275:(r,s,e)=>{var t=e(7007),n=e(1734),a=e(1689),i=Object.defineProperty;s.f=e(7057)?Object.defineProperty:function(c,l,f){if(t(c),l=a(l,!0),t(f),n)try{return i(c,l,f)}catch(d){}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(c[l]=f.value),c}},5588:(r,s,e)=>{var t=e(9275),n=e(7007),a=e(7184);r.exports=e(7057)?Object.defineProperties:function(o,c){n(o);for(var l=a(c),f=l.length,d=0,v;f>d;)t.f(o,v=l[d++],c[v]);return o}},4548:(r,s)=>{s.f=Object.getOwnPropertySymbols},468:(r,s,e)=>{var t=e(9181),n=e(508),a=e(9335)("IE_PROTO"),i=Object.prototype;r.exports=Object.getPrototypeOf||function(o){return o=n(o),t(o,a)?o[a]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?i:null}},189:(r,s,e)=>{var t=e(9181),n=e(2110),a=e(9315)(!1),i=e(9335)("IE_PROTO");r.exports=function(o,c){var l=n(o),f=0,d=[],v;for(v in l)v!=i&&(t(l,v)&&d.push(v));for(;c.length>f;)t(l,v=c[f++])&&(~a(d,v)||d.push(v));return d}},7184:(r,s,e)=>{var t=e(189),n=e(4430);r.exports=Object.keys||function(i){return t(i,n)}},4682:(r,s)=>{s.f={}.propertyIsEnumerable},188:r=>{r.exports=function(s){try{return{e:!1,v:s()}}catch(e){return{e:!0,v:e}}}},94:(r,s,e)=>{var t=e(7007),n=e(5286),a=e(3499);r.exports=function(i,o){if(t(i),n(o)&&o.constructor===i)return o;var c=a.f(i),l=c.resolve;return l(o),c.promise}},681:r=>{r.exports=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}},4408:(r,s,e)=>{var t=e(3415);r.exports=function(n,a,i){for(var o in a)t(n,o,a[o],i);return n}},3415:(r,s,e)=>{var t=e(3816),n=e(7728),a=e(9181),i=e(3953)("src"),o=e(18),c="toString",l=(""+o).split(c);e(5645).inspectSource=function(f){return o.call(f)},(r.exports=function(f,d,v,x){var b=typeof v=="function";if(b&&(a(v,"name")||n(v,"name",d)),f[d]===v)return;b&&(a(v,i)||n(v,i,f[d]?""+f[d]:l.join(String(d)))),f===t?f[d]=v:x?f[d]?f[d]=v:n(f,d,v):(delete f[d],n(f,d,v))})(Function.prototype,c,function(){return typeof this=="function"&&this[i]||o.call(this)})},2974:(r,s,e)=>{"use strict";var t=e(3816),n=e(9275),a=e(7057),i=e(6314)("species");r.exports=function(o){var c=t[o];a&&c&&!c[i]&&n.f(c,i,{configurable:!0,get:function(){return this}})}},2943:(r,s,e)=>{var t=e(9275).f,n=e(9181),a=e(6314)("toStringTag");r.exports=function(i,o,c){i&&!n(i=c?i:i.prototype,a)&&t(i,a,{configurable:!0,value:o})}},9335:(r,s,e)=>{var t=e(3825)("keys"),n=e(3953);r.exports=function(a){return t[a]||(t[a]=n(a))}},3825:(r,s,e)=>{var t=e(5645),n=e(3816),a="__core-js_shared__",i=n[a]||(n[a]={});(r.exports=function(o,c){return i[o]||(i[o]=c!==void 0?c:{})})("versions",[]).push({version:t.version,mode:e(4461)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},8364:(r,s,e)=>{var t=e(7007),n=e(4963),a=e(6314)("species");r.exports=function(i,o){var c=t(i).constructor,l;return c===void 0||(l=t(c)[a])==null?o:n(l)}},4193:(r,s,e)=>{var t=e(741),n=e(7242),a=e(639),i=e(2457),o=e(3816),c=o.process,l=o.setImmediate,f=o.clearImmediate,d=o.MessageChannel,v=o.Dispatch,x=0,b={},w="onreadystatechange",O,P,E,y=function(){var u=+this;if(b.hasOwnProperty(u)){var h=b[u];delete b[u],h()}},j=function(u){y.call(u.data)};(!l||!f)&&(l=function(h){for(var g=[],T=1;arguments.length>T;)g.push(arguments[T++]);return b[++x]=function(){n(typeof h=="function"?h:Function(h),g)},O(x),x},f=function(h){delete b[h]},e(2032)(c)=="process"?O=function(u){c.nextTick(t(y,u,1))}:v&&v.now?O=function(u){v.now(t(y,u,1))}:d?(P=new d,E=P.port2,P.port1.onmessage=j,O=t(E.postMessage,E,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(O=function(u){o.postMessage(u+"","*")},o.addEventListener("message",j,!1)):w in i("script")?O=function(u){a.appendChild(i("script"))[w]=function(){a.removeChild(this),y.call(u)}}:O=function(u){setTimeout(t(y,u,1),0)}),r.exports={set:l,clear:f}},2337:(r,s,e)=>{var t=e(1467),n=Math.max,a=Math.min;r.exports=function(i,o){return i=t(i),i<0?n(i+o,0):a(i,o)}},1467:r=>{var s=Math.ceil,e=Math.floor;r.exports=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)}},2110:(r,s,e)=>{var t=e(9797),n=e(1355);r.exports=function(a){return t(n(a))}},875:(r,s,e)=>{var t=e(1467),n=Math.min;r.exports=function(a){return a>0?n(t(a),9007199254740991):0}},508:(r,s,e)=>{var t=e(1355);r.exports=function(n){return Object(t(n))}},1689:(r,s,e)=>{var t=e(5286);r.exports=function(n,a){if(!t(n))return n;var i,o;if(a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;if(typeof(i=n.valueOf)=="function"&&!t(o=i.call(n)))return o;if(!a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;throw TypeError("Can't convert object to primitive value")}},3953:r=>{var s=0,e=Math.random();r.exports=function(t){return"Symbol(".concat(t===void 0?"":t,")_",(++s+e).toString(36))}},575:(r,s,e)=>{var t=e(3816),n=t.navigator;r.exports=n&&n.userAgent||""},6314:(r,s,e)=>{var t=e(3825)("wks"),n=e(3953),a=e(3816).Symbol,i=typeof a=="function",o=r.exports=function(c){return t[c]||(t[c]=i&&a[c]||(i?a:n)("Symbol."+c))};o.store=t},9002:(r,s,e)=>{var t=e(1488),n=e(6314)("iterator"),a=e(7234);r.exports=e(5645).getIteratorMethod=function(i){if(i!=null)return i[n]||i["@@iterator"]||a[t(i)]}},6997:(r,s,e)=>{"use strict";var t=e(7722),n=e(5436),a=e(7234),i=e(2110);r.exports=e(2923)(Array,"Array",function(o,c){this._t=i(o),this._i=0,this._k=c},function(){var o=this._t,c=this._k,l=this._i++;return!o||l>=o.length?(this._t=void 0,n(1)):c=="keys"?n(0,l):c=="values"?n(0,o[l]):n(0,[l,o[l]])},"values"),a.Arguments=a.Array,t("keys"),t("values"),t("entries")},5115:(r,s,e)=>{var t=e(2985);t(t.S+t.F,"Object",{assign:e(5345)})},6253:(r,s,e)=>{"use strict";var t=e(1488),n={};n[e(6314)("toStringTag")]="z",n+""!="[object z]"&&e(3415)(Object.prototype,"toString",function(){return"[object "+t(this)+"]"},!0)},851:(r,s,e)=>{"use strict";var t=e(4461),n=e(3816),a=e(741),i=e(1488),o=e(2985),c=e(5286),l=e(4963),f=e(3328),d=e(3531),v=e(8364),x=e(4193).set,b=e(4351)(),w=e(3499),O=e(188),P=e(575),E=e(94),y="Promise",j=n.TypeError,u=n.process,h=u&&u.versions,g=h&&h.v8||"",T=n[y],G=i(u)=="process",M=function(){},N,R,F,C,A=R=w.f,D=!!function(){try{var p=T.resolve(1),m=(p.constructor={})[e(6314)("species")]=function(I){I(M,M)};return(G||typeof PromiseRejectionEvent=="function")&&p.then(M)instanceof m&&g.indexOf("6.6")!==0&&P.indexOf("Chrome/66")===-1}catch(I){}}(),B=function(p){var m;return c(p)&&typeof(m=p.then)=="function"?m:!1},H=function(p,m){if(p._n)return;p._n=!0;var I=p._c;b(function(){for(var S=p._v,U=p._s==1,$=0,X=function(z){var q=U?z.ok:z.fail,J=z.resolve,Q=z.reject,K=z.domain,W,ee,ne;try{q?(U||(p._h==2&&_(p),p._h=1),q===!0?W=S:(K&&K.enter(),W=q(S),K&&(K.exit(),ne=!0)),W===z.promise?Q(j("Promise-chain cycle")):(ee=B(W))?ee.call(W,J,Q):J(W)):Q(S)}catch(oe){K&&!ne&&K.exit(),Q(oe)}};I.length>$;)X(I[$++]);p._c=[],p._n=!1,m&&!p._h&&k(p)})},k=function(p){x.call(n,function(){var m=p._v,I=V(p),S,U,$;if(I&&(S=O(function(){G?u.emit("unhandledRejection",m,p):(U=n.onunhandledrejection)?U({promise:p,reason:m}):($=n.console)&&$.error&&$.error("Unhandled promise rejection",m)}),p._h=G||V(p)?2:1),p._a=void 0,I&&S.e)throw S.v})},V=function(p){return p._h!==1&&(p._a||p._c).length===0},_=function(p){x.call(n,function(){var m;G?u.emit("rejectionHandled",p):(m=n.onrejectionhandled)&&m({promise:p,reason:p._v})})},Y=function(p){var m=this;if(m._d)return;m._d=!0,m=m._w||m,m._v=p,m._s=2,m._a||(m._a=m._c.slice()),H(m,!0)},te=function(p){var m=this,I;if(m._d)return;m._d=!0,m=m._w||m;try{if(m===p)throw j("Promise can't be resolved itself");(I=B(p))?b(function(){var S={_w:m,_d:!1};try{I.call(p,a(te,S,1),a(Y,S,1))}catch(U){Y.call(S,U)}}):(m._v=p,m._s=1,H(m,!1))}catch(S){Y.call({_w:m,_d:!1},S)}};D||(T=function(m){f(this,T,y,"_h"),l(m),N.call(this);try{m(a(te,this,1),a(Y,this,1))}catch(I){Y.call(this,I)}},N=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},N.prototype=e(4408)(T.prototype,{then:function(m,I){var S=A(v(this,T));return S.ok=typeof m=="function"?m:!0,S.fail=typeof I=="function"&&I,S.domain=G?u.domain:void 0,this._c.push(S),this._a&&this._a.push(S),this._s&&H(this,!1),S.promise},catch:function(p){return this.then(void 0,p)}}),F=function(){var p=new N;this.promise=p,this.resolve=a(te,p,1),this.reject=a(Y,p,1)},w.f=A=function(p){return p===T||p===C?new F(p):R(p)}),o(o.G+o.W+o.F*!D,{Promise:T}),e(2943)(T,y),e(2974)(y),C=e(5645)[y],o(o.S+o.F*!D,y,{reject:function(m){var I=A(this),S=I.reject;return S(m),I.promise}}),o(o.S+o.F*(t||!D),y,{resolve:function(m){return E(t&&this===C?T:this,m)}}),o(o.S+o.F*!(D&&e(7462)(function(p){T.all(p).catch(M)})),y,{all:function(m){var I=this,S=A(I),U=S.resolve,$=S.reject,X=O(function(){var z=[],q=0,J=1;d(m,!1,function(Q){var K=q++,W=!1;z.push(void 0),J++,I.resolve(Q).then(function(ee){if(W)return;W=!0,z[K]=ee,--J||U(z)},$)}),--J||U(z)});return X.e&&$(X.v),S.promise},race:function(m){var I=this,S=A(I),U=S.reject,$=O(function(){d(m,!1,function(X){I.resolve(X).then(S.resolve,U)})});return $.e&&U($.v),S.promise}})},2773:(r,s,e)=>{"use strict";var t=e(2985),n=e(9315)(!0);t(t.P,"Array",{includes:function(i){return n(this,i,arguments.length>1?arguments[1]:void 0)}}),e(7722)("includes")},1181:(r,s,e)=>{for(var t=e(6997),n=e(7184),a=e(3415),i=e(3816),o=e(7728),c=e(7234),l=e(6314),f=l("iterator"),d=l("toStringTag"),v=c.Array,x={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},b=n(x),w=0;w<b.length;w++){var O=b[w],P=x[O],E=i[O],y=E&&E.prototype,j;if(y&&(y[f]||o(y,f,v),y[d]||o(y,d,O),c[O]=v,P))for(j in t)y[j]||a(y,j,t[j],!0)}},8344:()=>{(function(r){var s="currentScript",e=r.getElementsByTagName("script");s in r||Object.defineProperty(r,s,{get:function(){try{throw new Error}catch(a){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(a.stack)||[!1])[1];for(t in e)if(e[t].src==n||e[t].readyState=="interactive")return e[t];return null}}})})(document)}},Z={};function L(r){if(Z[r])return Z[r].exports;var s=Z[r]={exports:{}};return re[r](s,s.exports,L),s.exports}return(()=>{L.n=r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return L.d(s,{a:s}),s}})(),(()=>{L.d=(r,s)=>{for(var e in s)L.o(s,e)&&!L.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:s[e]})}})(),(()=>{L.o=(r,s)=>Object.prototype.hasOwnProperty.call(r,s)})(),(()=>{L.r=r=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}})(),(()=>{L.p="/"})(),L(6738)})()}); | ||
(function(Z,M){typeof exports=="object"&&typeof module=="object"?module.exports=M():typeof define=="function"&&define.amd?define([],M):typeof exports=="object"?exports["gd-editor-sdk"]=M():Z["gd-editor-sdk"]=M()})(this,function(){return(()=>{var re={3913:r=>{function s(t,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,n,a){return n&&s(t.prototype,n),a&&s(t,a),t}r.exports=e},6738:(r,s,e)=>{"use strict";e.r(s),e.d(s,{GdEditorSdk:()=>O,default:()=>P});var t={};if(e.r(t),e.d(t,{j:()=>O}),typeof window!="undefined"){e(8344);var n;(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(e.p=n[1])}const a=null;var i=e(1181),o=e(6253),c=e(5115),l=e(2773),f=e(851),d=e(3913),v=e.n(d),x={};const b=x;var w=function(){v()(E,[{key:"width",get:function(){return this.config.width}},{key:"height",get:function(){return this.config.height}}]);function E(j){this.config=j}var y=E.prototype;return y.addElement=function(u){var h=JSON.parse(JSON.stringify(u)),g=Math.random();return this.postMessage("editor.addElement",h,g)},y.postMessage=function(u,h,g){var S=this,L=function(){S.config.frame.contentWindow.postMessage({action:u,asyncId:g,payload:h},"*")};if(g)return new Promise(function(D){L(),b[g]=D});L()},E}(),O=function(){function E(j){var u=this;if(this.wrapper=null,this.frame=null,this.mask=null,this.container=null,this.cb=function(h){if(!h.origin.includes(".gaoding.com"))return!1;h.data.action==="editor.download"&&(u.config.onUpload&&u.config.onUpload(h.data.blob),u.config.onCompleted&&u.config.onCompleted(h.data.file),u.config.autoClose!==!1&&u.close()),h.data.action==="editor.templetLoaded"&&(u.config.onTempletLoaded&&u.config.onTempletLoaded(new w({width:h.data.payload.width,height:h.data.payload.height,frame:u.frame}))),h.data.asyncId&&b[h.data.asyncId]&&b[h.data.asyncId](h.data.payload)},!j.onCompleted&&!j.onUpload)throw new Error("缺少必填参数 onCompleted");this.config=j,this.autoResize(),window.addEventListener("resize",this.autoResize.bind(this))}var y=E.prototype;return y.autoResize=function(){var u=this.container;u&&(u.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",u.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px")},y.open=function(u){var h=this,g=document.createElement("iframe");g.style.display="block",g.style.width="100%",g.style.height="100%",g.setAttribute("frameborder","0");var S=this.config.env,L=u.ext||{};Object.assign(L,{buttonText:this.config.buttonText});var D=Object.keys(L).reduce(function(N,B){return L[B]!==void 0&&(N+="&"+B+"="+L[B]),N},""),U="";U+=""+D;var R="https://www.gaoding.com";S==="local"?R="http://design.dev.gaoding.com":S==="dev"?R="https://www.dev.gaoding.com":S==="stage"&&(R="https://stage.gaoding.com"),S.includes("http")?g.src=S+(""+(S.includes("?")?"&":"?")+U):g.src=R+"/utm-editors/"+(this.config.appId?this.config.appId:encodeURIComponent(location.hostname))+"?"+U,this.frame=g,window.addEventListener("message",this.cb);var F=this.config.container&&document.querySelector(this.config.container);if(F){F.appendChild(g);return}if(!this.wrapper){var C=document.createElement("div");C.className="gaoding-iframe",C.style.position="absolute",C.style.top="0px",C.style.right="0px",C.style.bottom="0px",C.style.left="0px",C.style.zIndex="1000",document.documentElement.clientHeight>800&&(C.style.display="flex",C.style.alignItems="center",C.style.justifyContent="center"),this.wrapper=C;var A=this.container=document.createElement("div");A.style.position="relative",A.style.width=Math.max(document.documentElement.clientWidth-100,1280)+"px",A.style.height=Math.max(document.documentElement.clientHeight-80,604)+"px",A.style.minHeight="604px",A.style.margin="50px auto",A.style.background="#fff",A.style.display="block",A.appendChild(this.createCloseBtn()),this.config.style&&Object.keys(this.config.style).forEach(function(N){A.style[N]=h.config.style[N]}),A.appendChild(g),C.append(A)}this.createMask(),document.body.appendChild(this.wrapper)},y.close=function(){window.removeEventListener("message",this.cb),this.wrapper&&this.wrapper.parentElement&&this.wrapper.parentElement.removeChild(this.wrapper),this.mask&&this.mask.parentElement&&this.mask.parentElement.removeChild(this.mask),window.removeEventListener("resize",this.autoResize.bind(this)),this.config.onClose&&this.config.onClose()},y.createMask=function(){var u=document.createElement("div");u.style.position="fixed",u.style.top="0px",u.style.left="0px",u.style.bottom="0px",u.style.right="0px",u.style.zIndex=parseFloat(this.wrapper.style.zIndex)-1+"",u.style.backgroundColor="#000",u.style.opacity=".5",this.mask=u,document.body.appendChild(u)},y.createCloseBtn=function(){var u=this,h=document.createElement("div");h.style.fontSize="13px",h.style.width="42px",h.style.height="42px",h.style.textAlign="right",h.style.position="absolute",h.style.right="-42px",h.style.top="0px",h.style.background="#000",h.style.cursor="pointer",h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.backgroundRepeat="no-repeat";var g=document.createElement("img");return g.style.display="block",g.style.width="24px",g.src="https://st-gdx.dancf.com/gaodingx/34555636/design/20190509-142237-249d.png",h.appendChild(g),h.addEventListener("click",function(){return u.close()}),h},E}();window&&(window.GdEditorSdk=O);const P=t.default},4963:r=>{r.exports=function(s){if(typeof s!="function")throw TypeError(s+" is not a function!");return s}},7722:(r,s,e)=>{var t=e(6314)("unscopables"),n=Array.prototype;n[t]==null&&e(7728)(n,t,{}),r.exports=function(a){n[t][a]=!0}},3328:r=>{r.exports=function(s,e,t,n){if(!(s instanceof e)||n!==void 0&&n in s)throw TypeError(t+": incorrect invocation!");return s}},7007:(r,s,e)=>{var t=e(5286);r.exports=function(n){if(!t(n))throw TypeError(n+" is not an object!");return n}},9315:(r,s,e)=>{var t=e(2110),n=e(875),a=e(2337);r.exports=function(i){return function(o,c,l){var f=t(o),d=n(f.length),v=a(l,d),x;if(i&&c!=c){for(;d>v;)if(x=f[v++],x!=x)return!0}else for(;d>v;v++)if((i||v in f)&&f[v]===c)return i||v||0;return!i&&-1}}},1488:(r,s,e)=>{var t=e(2032),n=e(6314)("toStringTag"),a=t(function(){return arguments}())=="Arguments",i=function(o,c){try{return o[c]}catch(l){}};r.exports=function(o){var c,l,f;return o===void 0?"Undefined":o===null?"Null":typeof(l=i(c=Object(o),n))=="string"?l:a?t(c):(f=t(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},2032:r=>{var s={}.toString;r.exports=function(e){return s.call(e).slice(8,-1)}},5645:r=>{var s=r.exports={version:"2.6.11"};typeof __e=="number"&&(__e=s)},741:(r,s,e)=>{var t=e(4963);r.exports=function(n,a,i){if(t(n),a===void 0)return n;switch(i){case 1:return function(o){return n.call(a,o)};case 2:return function(o,c){return n.call(a,o,c)};case 3:return function(o,c,l){return n.call(a,o,c,l)}}return function(){return n.apply(a,arguments)}}},1355:r=>{r.exports=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}},7057:(r,s,e)=>{r.exports=!e(4253)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},2457:(r,s,e)=>{var t=e(5286),n=e(3816).document,a=t(n)&&t(n.createElement);r.exports=function(i){return a?n.createElement(i):{}}},4430:r=>{r.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},2985:(r,s,e)=>{var t=e(3816),n=e(5645),a=e(7728),i=e(3415),o=e(741),c="prototype",l=function(f,d,v){var x=f&l.F,b=f&l.G,w=f&l.S,O=f&l.P,P=f&l.B,E=b?t:w?t[d]||(t[d]={}):(t[d]||{})[c],y=b?n:n[d]||(n[d]={}),j=y[c]||(y[c]={}),u,h,g,S;b&&(v=d);for(u in v)h=!x&&E&&E[u]!==void 0,g=(h?E:v)[u],S=P&&h?o(g,t):O&&typeof g=="function"?o(Function.call,g):g,E&&i(E,u,g,f&l.U),y[u]!=g&&a(y,u,S),O&&j[u]!=g&&(j[u]=g)};t.core=n,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,r.exports=l},4253:r=>{r.exports=function(s){try{return!!s()}catch(e){return!0}}},3531:(r,s,e)=>{var t=e(741),n=e(8851),a=e(6555),i=e(7007),o=e(875),c=e(9002),l={},f={},d=r.exports=function(v,x,b,w,O){var P=O?function(){return v}:c(v),E=t(b,w,x?2:1),y=0,j,u,h,g;if(typeof P!="function")throw TypeError(v+" is not iterable!");if(a(P)){for(j=o(v.length);j>y;y++)if(g=x?E(i(u=v[y])[0],u[1]):E(v[y]),g===l||g===f)return g}else for(h=P.call(v);!(u=h.next()).done;)if(g=n(h,E,u.value,x),g===l||g===f)return g};d.BREAK=l,d.RETURN=f},18:(r,s,e)=>{r.exports=e(3825)("native-function-to-string",Function.toString)},3816:r=>{var s=r.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=s)},9181:r=>{var s={}.hasOwnProperty;r.exports=function(e,t){return s.call(e,t)}},7728:(r,s,e)=>{var t=e(9275),n=e(681);r.exports=e(7057)?function(a,i,o){return t.f(a,i,n(1,o))}:function(a,i,o){return a[i]=o,a}},639:(r,s,e)=>{var t=e(3816).document;r.exports=t&&t.documentElement},1734:(r,s,e)=>{r.exports=!e(7057)&&!e(4253)(function(){return Object.defineProperty(e(2457)("div"),"a",{get:function(){return 7}}).a!=7})},7242:r=>{r.exports=function(s,e,t){var n=t===void 0;switch(e.length){case 0:return n?s():s.call(t);case 1:return n?s(e[0]):s.call(t,e[0]);case 2:return n?s(e[0],e[1]):s.call(t,e[0],e[1]);case 3:return n?s(e[0],e[1],e[2]):s.call(t,e[0],e[1],e[2]);case 4:return n?s(e[0],e[1],e[2],e[3]):s.call(t,e[0],e[1],e[2],e[3])}return s.apply(t,e)}},9797:(r,s,e)=>{var t=e(2032);r.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return t(n)=="String"?n.split(""):Object(n)}},6555:(r,s,e)=>{var t=e(7234),n=e(6314)("iterator"),a=Array.prototype;r.exports=function(i){return i!==void 0&&(t.Array===i||a[n]===i)}},5286:r=>{r.exports=function(s){return typeof s=="object"?s!==null:typeof s=="function"}},8851:(r,s,e)=>{var t=e(7007);r.exports=function(n,a,i,o){try{return o?a(t(i)[0],i[1]):a(i)}catch(l){var c=n.return;throw c!==void 0&&t(c.call(n)),l}}},9988:(r,s,e)=>{"use strict";var t=e(2503),n=e(681),a=e(2943),i={};e(7728)(i,e(6314)("iterator"),function(){return this}),r.exports=function(o,c,l){o.prototype=t(i,{next:n(1,l)}),a(o,c+" Iterator")}},2923:(r,s,e)=>{"use strict";var t=e(4461),n=e(2985),a=e(3415),i=e(7728),o=e(7234),c=e(9988),l=e(2943),f=e(468),d=e(6314)("iterator"),v=!([].keys&&"next"in[].keys()),x="@@iterator",b="keys",w="values",O=function(){return this};r.exports=function(P,E,y,j,u,h,g){c(y,E,j);var S=function(V){if(!v&&V in R)return R[V];switch(V){case b:return function(){return new y(this,V)};case w:return function(){return new y(this,V)}}return function(){return new y(this,V)}},L=E+" Iterator",D=u==w,U=!1,R=P.prototype,F=R[d]||R[x]||u&&R[u],C=F||S(u),A=u?D?S("entries"):C:void 0,N=E=="Array"&&R.entries||F,B,H,k;if(N&&(k=f(N.call(new P)),k!==Object.prototype&&k.next&&(l(k,L,!0),!t&&typeof k[d]!="function"&&i(k,d,O))),D&&F&&F.name!==w&&(U=!0,C=function(){return F.call(this)}),(!t||g)&&(v||U||!R[d])&&i(R,d,C),o[E]=C,o[L]=O,u)if(B={values:D?C:S(w),keys:h?C:S(b),entries:A},g)for(H in B)H in R||a(R,H,B[H]);else n(n.P+n.F*(v||U),E,B);return B}},7462:(r,s,e)=>{var t=e(6314)("iterator"),n=!1;try{var a=[7][t]();a.return=function(){n=!0},Array.from(a,function(){throw 2})}catch(i){}r.exports=function(i,o){if(!o&&!n)return!1;var c=!1;try{var l=[7],f=l[t]();f.next=function(){return{done:c=!0}},l[t]=function(){return f},i(l)}catch(d){}return c}},5436:r=>{r.exports=function(s,e){return{value:e,done:!!s}}},7234:r=>{r.exports={}},4461:r=>{r.exports=!1},4351:(r,s,e)=>{var t=e(3816),n=e(4193).set,a=t.MutationObserver||t.WebKitMutationObserver,i=t.process,o=t.Promise,c=e(2032)(i)=="process";r.exports=function(){var l,f,d,v=function(){var O,P;for(c&&(O=i.domain)&&O.exit();l;){P=l.fn,l=l.next;try{P()}catch(E){throw l?d():f=void 0,E}}f=void 0,O&&O.enter()};if(c)d=function(){i.nextTick(v)};else if(a&&!(t.navigator&&t.navigator.standalone)){var x=!0,b=document.createTextNode("");new a(v).observe(b,{characterData:!0}),d=function(){b.data=x=!x}}else if(o&&o.resolve){var w=o.resolve(void 0);d=function(){w.then(v)}}else d=function(){n.call(t,v)};return function(O){var P={fn:O,next:void 0};f&&(f.next=P),l||(l=P,d()),f=P}}},3499:(r,s,e)=>{"use strict";var t=e(4963);function n(a){var i,o;this.promise=new a(function(c,l){if(i!==void 0||o!==void 0)throw TypeError("Bad Promise constructor");i=c,o=l}),this.resolve=t(i),this.reject=t(o)}r.exports.f=function(a){return new n(a)}},5345:(r,s,e)=>{"use strict";var t=e(7057),n=e(7184),a=e(4548),i=e(4682),o=e(508),c=e(9797),l=Object.assign;r.exports=!l||e(4253)(function(){var f={},d={},v=Symbol(),x="abcdefghijklmnopqrst";return f[v]=7,x.split("").forEach(function(b){d[b]=b}),l({},f)[v]!=7||Object.keys(l({},d)).join("")!=x})?function(d,v){for(var x=o(d),b=arguments.length,w=1,O=a.f,P=i.f;b>w;)for(var E=c(arguments[w++]),y=O?n(E).concat(O(E)):n(E),j=y.length,u=0,h;j>u;)h=y[u++],(!t||P.call(E,h))&&(x[h]=E[h]);return x}:l},2503:(r,s,e)=>{var t=e(7007),n=e(5588),a=e(4430),i=e(9335)("IE_PROTO"),o=function(){},c="prototype",l=function(){var f=e(2457)("iframe"),d=a.length,v="<",x=">",b;for(f.style.display="none",e(639).appendChild(f),f.src="javascript:",b=f.contentWindow.document,b.open(),b.write(v+"script"+x+"document.F=Object"+v+"/script"+x),b.close(),l=b.F;d--;)delete l[c][a[d]];return l()};r.exports=Object.create||function(d,v){var x;return d!==null?(o[c]=t(d),x=new o,o[c]=null,x[i]=d):x=l(),v===void 0?x:n(x,v)}},9275:(r,s,e)=>{var t=e(7007),n=e(1734),a=e(1689),i=Object.defineProperty;s.f=e(7057)?Object.defineProperty:function(c,l,f){if(t(c),l=a(l,!0),t(f),n)try{return i(c,l,f)}catch(d){}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(c[l]=f.value),c}},5588:(r,s,e)=>{var t=e(9275),n=e(7007),a=e(7184);r.exports=e(7057)?Object.defineProperties:function(o,c){n(o);for(var l=a(c),f=l.length,d=0,v;f>d;)t.f(o,v=l[d++],c[v]);return o}},4548:(r,s)=>{s.f=Object.getOwnPropertySymbols},468:(r,s,e)=>{var t=e(9181),n=e(508),a=e(9335)("IE_PROTO"),i=Object.prototype;r.exports=Object.getPrototypeOf||function(o){return o=n(o),t(o,a)?o[a]:typeof o.constructor=="function"&&o instanceof o.constructor?o.constructor.prototype:o instanceof Object?i:null}},189:(r,s,e)=>{var t=e(9181),n=e(2110),a=e(9315)(!1),i=e(9335)("IE_PROTO");r.exports=function(o,c){var l=n(o),f=0,d=[],v;for(v in l)v!=i&&(t(l,v)&&d.push(v));for(;c.length>f;)t(l,v=c[f++])&&(~a(d,v)||d.push(v));return d}},7184:(r,s,e)=>{var t=e(189),n=e(4430);r.exports=Object.keys||function(i){return t(i,n)}},4682:(r,s)=>{s.f={}.propertyIsEnumerable},188:r=>{r.exports=function(s){try{return{e:!1,v:s()}}catch(e){return{e:!0,v:e}}}},94:(r,s,e)=>{var t=e(7007),n=e(5286),a=e(3499);r.exports=function(i,o){if(t(i),n(o)&&o.constructor===i)return o;var c=a.f(i),l=c.resolve;return l(o),c.promise}},681:r=>{r.exports=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}},4408:(r,s,e)=>{var t=e(3415);r.exports=function(n,a,i){for(var o in a)t(n,o,a[o],i);return n}},3415:(r,s,e)=>{var t=e(3816),n=e(7728),a=e(9181),i=e(3953)("src"),o=e(18),c="toString",l=(""+o).split(c);e(5645).inspectSource=function(f){return o.call(f)},(r.exports=function(f,d,v,x){var b=typeof v=="function";if(b&&(a(v,"name")||n(v,"name",d)),f[d]===v)return;b&&(a(v,i)||n(v,i,f[d]?""+f[d]:l.join(String(d)))),f===t?f[d]=v:x?f[d]?f[d]=v:n(f,d,v):(delete f[d],n(f,d,v))})(Function.prototype,c,function(){return typeof this=="function"&&this[i]||o.call(this)})},2974:(r,s,e)=>{"use strict";var t=e(3816),n=e(9275),a=e(7057),i=e(6314)("species");r.exports=function(o){var c=t[o];a&&c&&!c[i]&&n.f(c,i,{configurable:!0,get:function(){return this}})}},2943:(r,s,e)=>{var t=e(9275).f,n=e(9181),a=e(6314)("toStringTag");r.exports=function(i,o,c){i&&!n(i=c?i:i.prototype,a)&&t(i,a,{configurable:!0,value:o})}},9335:(r,s,e)=>{var t=e(3825)("keys"),n=e(3953);r.exports=function(a){return t[a]||(t[a]=n(a))}},3825:(r,s,e)=>{var t=e(5645),n=e(3816),a="__core-js_shared__",i=n[a]||(n[a]={});(r.exports=function(o,c){return i[o]||(i[o]=c!==void 0?c:{})})("versions",[]).push({version:t.version,mode:e(4461)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},8364:(r,s,e)=>{var t=e(7007),n=e(4963),a=e(6314)("species");r.exports=function(i,o){var c=t(i).constructor,l;return c===void 0||(l=t(c)[a])==null?o:n(l)}},4193:(r,s,e)=>{var t=e(741),n=e(7242),a=e(639),i=e(2457),o=e(3816),c=o.process,l=o.setImmediate,f=o.clearImmediate,d=o.MessageChannel,v=o.Dispatch,x=0,b={},w="onreadystatechange",O,P,E,y=function(){var u=+this;if(b.hasOwnProperty(u)){var h=b[u];delete b[u],h()}},j=function(u){y.call(u.data)};(!l||!f)&&(l=function(h){for(var g=[],S=1;arguments.length>S;)g.push(arguments[S++]);return b[++x]=function(){n(typeof h=="function"?h:Function(h),g)},O(x),x},f=function(h){delete b[h]},e(2032)(c)=="process"?O=function(u){c.nextTick(t(y,u,1))}:v&&v.now?O=function(u){v.now(t(y,u,1))}:d?(P=new d,E=P.port2,P.port1.onmessage=j,O=t(E.postMessage,E,1)):o.addEventListener&&typeof postMessage=="function"&&!o.importScripts?(O=function(u){o.postMessage(u+"","*")},o.addEventListener("message",j,!1)):w in i("script")?O=function(u){a.appendChild(i("script"))[w]=function(){a.removeChild(this),y.call(u)}}:O=function(u){setTimeout(t(y,u,1),0)}),r.exports={set:l,clear:f}},2337:(r,s,e)=>{var t=e(1467),n=Math.max,a=Math.min;r.exports=function(i,o){return i=t(i),i<0?n(i+o,0):a(i,o)}},1467:r=>{var s=Math.ceil,e=Math.floor;r.exports=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)}},2110:(r,s,e)=>{var t=e(9797),n=e(1355);r.exports=function(a){return t(n(a))}},875:(r,s,e)=>{var t=e(1467),n=Math.min;r.exports=function(a){return a>0?n(t(a),9007199254740991):0}},508:(r,s,e)=>{var t=e(1355);r.exports=function(n){return Object(t(n))}},1689:(r,s,e)=>{var t=e(5286);r.exports=function(n,a){if(!t(n))return n;var i,o;if(a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;if(typeof(i=n.valueOf)=="function"&&!t(o=i.call(n)))return o;if(!a&&typeof(i=n.toString)=="function"&&!t(o=i.call(n)))return o;throw TypeError("Can't convert object to primitive value")}},3953:r=>{var s=0,e=Math.random();r.exports=function(t){return"Symbol(".concat(t===void 0?"":t,")_",(++s+e).toString(36))}},575:(r,s,e)=>{var t=e(3816),n=t.navigator;r.exports=n&&n.userAgent||""},6314:(r,s,e)=>{var t=e(3825)("wks"),n=e(3953),a=e(3816).Symbol,i=typeof a=="function",o=r.exports=function(c){return t[c]||(t[c]=i&&a[c]||(i?a:n)("Symbol."+c))};o.store=t},9002:(r,s,e)=>{var t=e(1488),n=e(6314)("iterator"),a=e(7234);r.exports=e(5645).getIteratorMethod=function(i){if(i!=null)return i[n]||i["@@iterator"]||a[t(i)]}},6997:(r,s,e)=>{"use strict";var t=e(7722),n=e(5436),a=e(7234),i=e(2110);r.exports=e(2923)(Array,"Array",function(o,c){this._t=i(o),this._i=0,this._k=c},function(){var o=this._t,c=this._k,l=this._i++;return!o||l>=o.length?(this._t=void 0,n(1)):c=="keys"?n(0,l):c=="values"?n(0,o[l]):n(0,[l,o[l]])},"values"),a.Arguments=a.Array,t("keys"),t("values"),t("entries")},5115:(r,s,e)=>{var t=e(2985);t(t.S+t.F,"Object",{assign:e(5345)})},6253:(r,s,e)=>{"use strict";var t=e(1488),n={};n[e(6314)("toStringTag")]="z",n+""!="[object z]"&&e(3415)(Object.prototype,"toString",function(){return"[object "+t(this)+"]"},!0)},851:(r,s,e)=>{"use strict";var t=e(4461),n=e(3816),a=e(741),i=e(1488),o=e(2985),c=e(5286),l=e(4963),f=e(3328),d=e(3531),v=e(8364),x=e(4193).set,b=e(4351)(),w=e(3499),O=e(188),P=e(575),E=e(94),y="Promise",j=n.TypeError,u=n.process,h=u&&u.versions,g=h&&h.v8||"",S=n[y],L=i(u)=="process",D=function(){},U,R,F,C,A=R=w.f,N=!!function(){try{var p=S.resolve(1),m=(p.constructor={})[e(6314)("species")]=function(I){I(D,D)};return(L||typeof PromiseRejectionEvent=="function")&&p.then(D)instanceof m&&g.indexOf("6.6")!==0&&P.indexOf("Chrome/66")===-1}catch(I){}}(),B=function(p){var m;return c(p)&&typeof(m=p.then)=="function"?m:!1},H=function(p,m){if(p._n)return;p._n=!0;var I=p._c;b(function(){for(var T=p._v,G=p._s==1,$=0,X=function(z){var q=G?z.ok:z.fail,J=z.resolve,Q=z.reject,K=z.domain,W,ee,ne;try{q?(G||(p._h==2&&_(p),p._h=1),q===!0?W=T:(K&&K.enter(),W=q(T),K&&(K.exit(),ne=!0)),W===z.promise?Q(j("Promise-chain cycle")):(ee=B(W))?ee.call(W,J,Q):J(W)):Q(T)}catch(oe){K&&!ne&&K.exit(),Q(oe)}};I.length>$;)X(I[$++]);p._c=[],p._n=!1,m&&!p._h&&k(p)})},k=function(p){x.call(n,function(){var m=p._v,I=V(p),T,G,$;if(I&&(T=O(function(){L?u.emit("unhandledRejection",m,p):(G=n.onunhandledrejection)?G({promise:p,reason:m}):($=n.console)&&$.error&&$.error("Unhandled promise rejection",m)}),p._h=L||V(p)?2:1),p._a=void 0,I&&T.e)throw T.v})},V=function(p){return p._h!==1&&(p._a||p._c).length===0},_=function(p){x.call(n,function(){var m;L?u.emit("rejectionHandled",p):(m=n.onrejectionhandled)&&m({promise:p,reason:p._v})})},Y=function(p){var m=this;if(m._d)return;m._d=!0,m=m._w||m,m._v=p,m._s=2,m._a||(m._a=m._c.slice()),H(m,!0)},te=function(p){var m=this,I;if(m._d)return;m._d=!0,m=m._w||m;try{if(m===p)throw j("Promise can't be resolved itself");(I=B(p))?b(function(){var T={_w:m,_d:!1};try{I.call(p,a(te,T,1),a(Y,T,1))}catch(G){Y.call(T,G)}}):(m._v=p,m._s=1,H(m,!1))}catch(T){Y.call({_w:m,_d:!1},T)}};N||(S=function(m){f(this,S,y,"_h"),l(m),U.call(this);try{m(a(te,this,1),a(Y,this,1))}catch(I){Y.call(this,I)}},U=function(m){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},U.prototype=e(4408)(S.prototype,{then:function(m,I){var T=A(v(this,S));return T.ok=typeof m=="function"?m:!0,T.fail=typeof I=="function"&&I,T.domain=L?u.domain:void 0,this._c.push(T),this._a&&this._a.push(T),this._s&&H(this,!1),T.promise},catch:function(p){return this.then(void 0,p)}}),F=function(){var p=new U;this.promise=p,this.resolve=a(te,p,1),this.reject=a(Y,p,1)},w.f=A=function(p){return p===S||p===C?new F(p):R(p)}),o(o.G+o.W+o.F*!N,{Promise:S}),e(2943)(S,y),e(2974)(y),C=e(5645)[y],o(o.S+o.F*!N,y,{reject:function(m){var I=A(this),T=I.reject;return T(m),I.promise}}),o(o.S+o.F*(t||!N),y,{resolve:function(m){return E(t&&this===C?S:this,m)}}),o(o.S+o.F*!(N&&e(7462)(function(p){S.all(p).catch(D)})),y,{all:function(m){var I=this,T=A(I),G=T.resolve,$=T.reject,X=O(function(){var z=[],q=0,J=1;d(m,!1,function(Q){var K=q++,W=!1;z.push(void 0),J++,I.resolve(Q).then(function(ee){if(W)return;W=!0,z[K]=ee,--J||G(z)},$)}),--J||G(z)});return X.e&&$(X.v),T.promise},race:function(m){var I=this,T=A(I),G=T.reject,$=O(function(){d(m,!1,function(X){I.resolve(X).then(T.resolve,G)})});return $.e&&G($.v),T.promise}})},2773:(r,s,e)=>{"use strict";var t=e(2985),n=e(9315)(!0);t(t.P,"Array",{includes:function(i){return n(this,i,arguments.length>1?arguments[1]:void 0)}}),e(7722)("includes")},1181:(r,s,e)=>{for(var t=e(6997),n=e(7184),a=e(3415),i=e(3816),o=e(7728),c=e(7234),l=e(6314),f=l("iterator"),d=l("toStringTag"),v=c.Array,x={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},b=n(x),w=0;w<b.length;w++){var O=b[w],P=x[O],E=i[O],y=E&&E.prototype,j;if(y&&(y[f]||o(y,f,v),y[d]||o(y,d,O),c[O]=v,P))for(j in t)y[j]||a(y,j,t[j],!0)}},8344:()=>{(function(r){var s="currentScript",e=r.getElementsByTagName("script");s in r||Object.defineProperty(r,s,{get:function(){try{throw new Error}catch(a){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/ig.exec(a.stack)||[!1])[1];for(t in e)if(e[t].src==n||e[t].readyState=="interactive")return e[t];return null}}})})(document)}},Z={};function M(r){if(Z[r])return Z[r].exports;var s=Z[r]={exports:{}};return re[r](s,s.exports,M),s.exports}return(()=>{M.n=r=>{var s=r&&r.__esModule?()=>r.default:()=>r;return M.d(s,{a:s}),s}})(),(()=>{M.d=(r,s)=>{for(var e in s)M.o(s,e)&&!M.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:s[e]})}})(),(()=>{M.o=(r,s)=>Object.prototype.hasOwnProperty.call(r,s)})(),(()=>{M.r=r=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}})(),(()=>{M.p="/"})(),M(6738)})()}); |
@@ -285,2 +285,3 @@ // modules are defined as an array | ||
frame.setAttribute('frameborder', '0'); | ||
var env = this.config.env; | ||
var ext = options.ext || {}; | ||
@@ -300,19 +301,18 @@ Object.assign(ext, { | ||
var baseUrl = 'https://www.gaoding.com'; | ||
var rePath = 'utm-editors'; | ||
if (this.config.env.includes('http')) { | ||
baseUrl = this.config.env; | ||
rePath = 'utms'; | ||
} | ||
if (this.config.env === 'local') { | ||
if (env === 'local') { | ||
baseUrl = 'http://design.dev.gaoding.com'; | ||
} else if (this.config.env === 'dev') { | ||
} else if (env === 'dev') { | ||
baseUrl = 'https://www.dev.gaoding.com'; | ||
} else if (this.config.env === 'stage') { | ||
} else if (env === 'stage') { | ||
baseUrl = 'https://stage.gaoding.com'; | ||
} | ||
frame.src = baseUrl + "/" + rePath + "/" + (this.config.appId ? this.config.appId : encodeURIComponent(location.hostname)) + "?" + queryUrl; // frame!.src = 'http://design.dev.gaoding.com/design?id=112070&third_party=haoche&' + queryUrl; | ||
if (env.includes('http')) { | ||
frame.src = env + ("" + (env.includes('?') ? '&' : '?') + queryUrl); | ||
} else { | ||
frame.src = baseUrl + "/utm-editors/" + (this.config.appId ? this.config.appId : encodeURIComponent(location.hostname)) + "?" + queryUrl; | ||
} // frame!.src = 'http://design.dev.gaoding.com/design?id=112070&third_party=haoche&' + queryUrl; | ||
this.frame = frame; | ||
@@ -319,0 +319,0 @@ window.addEventListener('message', this.cb); |
@@ -63,2 +63,3 @@ "use strict"; | ||
frame.setAttribute('frameborder', '0'); | ||
var env = this.config.env; | ||
var ext = options.ext || {}; | ||
@@ -77,19 +78,19 @@ Object.assign(ext, { | ||
var baseUrl = 'https://www.gaoding.com'; | ||
var rePath = 'utm-editors'; | ||
if (this.config.env.includes('http')) { | ||
baseUrl = this.config.env; | ||
rePath = 'utms'; | ||
} | ||
if (this.config.env === 'local') { | ||
if (env === 'local') { | ||
baseUrl = 'http://design.dev.gaoding.com'; | ||
} | ||
else if (this.config.env === 'dev') { | ||
else if (env === 'dev') { | ||
baseUrl = 'https://www.dev.gaoding.com'; | ||
} | ||
else if (this.config.env === 'stage') { | ||
else if (env === 'stage') { | ||
baseUrl = 'https://stage.gaoding.com'; | ||
} | ||
frame.src = baseUrl + "/" + rePath + "/" + (this.config.appId | ||
? this.config.appId | ||
: encodeURIComponent(location.hostname)) + "?" + queryUrl; | ||
if (env.includes('http')) { | ||
frame.src = env + ("" + (env.includes('?') ? '&' : '?') + queryUrl); | ||
} | ||
else { | ||
frame.src = baseUrl + "/utm-editors/" + (this.config.appId | ||
? this.config.appId | ||
: encodeURIComponent(location.hostname)) + "?" + queryUrl; | ||
} | ||
// frame!.src = 'http://design.dev.gaoding.com/design?id=112070&third_party=haoche&' + queryUrl; | ||
@@ -96,0 +97,0 @@ this.frame = frame; |
{ | ||
"name": "@gaoding/editor-sdk", | ||
"version": "0.2.8-beta", | ||
"version": "0.2.8-beta.0", | ||
"description": "稿定编辑器对外 SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3131
157693