kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
2 wiersze
7.7 KiB
JavaScript
2 wiersze
7.7 KiB
JavaScript
![]() |
(()=>{var e=function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(t){for(let e=0;e<this.length;e++)if(this[e]===t)return e;return-1});const i=(e,t)=>Array.prototype.slice.call(e,t);let e=null;"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?e=self:"undefined"!=typeof global?e=global:window&&(e=window);const t=e,u=e.document;var n="undefined"!=typeof navigator&&navigator.useragent?navigator.userAgent:"";let g=null;(/msie (\d+)/.test(n.toLowerCase())||/trident\/.*; rv:(\d+)/.test(n.toLowerCase()))&&(g=parseInt(RegExp.$1,10));function E(e,t){for(var n in e)if(!c(n)){var r=e[n];try{t[n]=r}catch(e){}}return t}function m(e,a,s){var t;for(t of Array.from(e))s._has(t)&&(a["on"+t]=(o=>function(e){var t,n,r={};for(t in e)c(t)||(n=e[t],r[t]=n===a?s:n);return s.dispatchEvent(o,r)})(t))}function b(o){let r={};const a=e=>r[e]||[],s={addEventListener:function(e,t,n){r[e]=a(e),0<=r[e].indexOf(t)||(n=void 0===n?r[e].length:n,r[e].splice(n,0,t))},removeEventListener:function(e,t){void 0===e?r={}:(void 0===t&&(r[e]=[]),-1!==(t=a(e).indexOf(t))&&a(e).splice(t,1))}};return s.dispatchEvent=function(){var t=i(arguments),e=t.shift(),n=(o||(t[0]=E(t[0],function(t){var e;if(u&&null!=u.createEventObject)return(e=u.createEventObject()).type=t,e;try{return new Event(t)}catch(e){return{type:t}}}(e))),s["on"+e]),r=(n&&n.apply(s,t),a(e).concat(a("*")));for(let e=0;e<r.length;e++)r[e].apply(s,t)},s._has=e=>!(!r[e]&&!s["on"+e]),o&&(s.listeners=e=>i(a(e)),s.on=s.addEventListener,s.off=s.removeEventListener,s.fire=s.dispatchEvent,s.once=function(e,t){var n=function(){return s.off(e,n),t.apply(null,arguments)};return s.on(e,n)},s.destroy=()=>r={}),s}const L=["load","loadend","loadstart"],w=["progress","abort","error","timeout"],c=e=>["returnValue","totalSize","position"].includes(e);var x=function(e,t){let n;switch(null==t&&(t={}),typeof e){case"object":var r,o=[];for(r in e){var a=e[r];n=r.toLowerCase(),o.push(n+`: `+a)}return o.join("\n")+"\n";case"string":o=e.split("\n");for(var s of Array.from(o))/([^:]+):\s*(.+)/.test(s)&&(n=null!=RegExp.$1?RegExp.$1.toLowerCase():void 0,s=RegExp.$2,null==t[n])&&(t[n]=s);return t}return[]};function r(){const i=new R,u={};let o=null,a=void 0,c=void 0,l=void 0;var s=0;function t(){if(l.status=o||i.status,-1===o&&g<10||(l.statusText=i.statusText),-1!==o){var e,t=x(i.getAllResponseHeaders());for(e in t){var n,r=t[e];l.headers[e]||(n=e.toLowerCase(),l.headers[n]=r)}}}function r(e){for(;s<e&&s<4;)y.readyState=++s,1===s&&y.dispatchEvent("loadstart",{}),2===s&&n(),4===s&&(n(),d()),y.dispatchEvent("readystatechange",{}),4===s&&(!1===u.async?p():setTimeout(p,0))}function f(e){if(4!==e)r(e);else{const n=N.listeners("after");var t=function(){var e;0<n.length?2===(e=n.shift()).length?(e(u,l),t()):3===e.length&&u.async?e(u,l,t):t():r(4)};t()}}const n=function(){y.status=l.status,y.statusText=l.statusText},d=function(){"text"in l&&(y.responseText=l.text),"xml"in l&&(y.responseXML=l.xml),"data"in l&&(y.response=l.data),"finalUrl"in l&&(y.responseURL=l.finalUrl)},p=function(){a||y.dispatchEvent("load",{}),y.dispatchEvent("loadend",{}),a&&(y.readyState=0)};function e(){a=!0}var h,v,y=b();u.xhr=y,i.onreadystatechange=function(e){try{2===i.readyState&&t()}catch(e){}if(4===i.readyState){if(c=!1,t(),i.responseType&&"text"!==i.responseType)"document"===i.responseType?(l.xml=i.responseXML,l.data=i.responseXML):l.data=i.response;else{l.text=i.responseText,l.data=i.responseText;try{l.xml=i.responseXML}catch(e){}}"responseURL"in i&&(l.finalUrl=i.responseURL)}f(i.readyState)},y.addEventListener("error",e),y.addEventListener("timeout",e),y.addEventListener("abort",e),y.addEventListener("progress",function(e){s<3?f(3):i.readyState<=3&&y.dispatchEvent("readystatechange",{})}),"withCredentials"in i&&(y.withCredentials=!1),y.status=0;for(h of Array.from(w.concat(L)))y["on"+h]=null;return y.open=function(e,t,n,r,o){s=0,a=!1,c=!1,u.headers={},u.headerNames={},u.status=0,u.method=e,u.url=t,u.async=!1!==n,u.user=r,u.pass=o,l={headers:{}},f(1)},y.send=function(e){let n,r;for(n of["type","timeout","withC
|